fsaris/EspHome-AwoX-BLE-mesh-hub

[BUG] Single light triggers whole group

Closed this issue · 9 comments

Hello @fsaris.

Sorry to bother again but I have noticed today some strange behaviour.
My problem is when I turn on a single light it will after a second turn on the rest of the lights in the group defined in Awox app.
No trigger from HA.
For example I have 3 lights in office, I turn on light above my desk and second later the other two lights are turned on.

Found out that this is happening only when the group for that zone/area is enabled. But there is more detail.

In #58 I mentioned the groups are duplicated for me and with this issue the duplication is kind of related I would say.
This behaviour is only happening when groups created from zones/areas are enabled.
When I disabled them and enabled the groups created from remote controllers it's working as usual.

Below is a log when one light was turned on and other 2 followed:
image

fsaris commented

If you check the logs you see that on the same second a command for a specific mesh_id (1115) and for a specific group_id (4).

Are you sure you didn't combine/group these "lights" in HA?

As I also mentioned in #58 I have groups in HA like this for office, living room and bedroom:
image

Dashboard in HA then looks like this so no accidental grouping and the 1115 id from log is the Entry light here:
image

But these HA groups are not connected to the groups from ESP. You can see there are single lights attached in that group.
So I expect when I turn on single light which is part of the HA group then the group state will be ON and other lights in group stays OFF. This was working normally before group feature and this is standard group behaviour in HA.

The same behaviour I would expect from the groups created from ESP. But all lights in group are turned on instead.
So I think there must be something that replicates the turn on command to all light in that group.
Something that is not coming from HA.

fsaris commented

Can you check the mqtt info (discovery info and linked topics with last x messages are visible there) for device "group 4" in HA? And also the logged events for that device? Curious what is shown there.

Sure.

image

Awox Office Group (light.awox_office_group)
MQTT discovery data:
Topic: homeassistant/light/group-4/config
Payload
schema: json
name: null
unique_id: group-4
icon: mdi:lightbulb-group
state_topic: awox-ble-mesh-hub/group-4/state
command_topic: awox-ble-mesh-hub/group-4/command
availability:

  • topic: awox-ble-mesh-hub/group-4/availability
  • topic: awox-ble-mesh-hub/status
  • topic: awox-ble-mesh-hub/connected
    availability_mode: all
    color_mode: true
    brightness: true
    brightness_scale: 255
    supported_color_modes:
  • rgb
  • color_temp
    min_mireds: 153
    max_mireds: 370
    device:
    identifiers:
    • esp-awox-mesh-group-4
      model: Group - 4
      manufacturer: ESPHome AwoX BLE mesh
      name: Group 4
      via_device: 0cb815c3aed0
      platform: mqtt
      Subscribed topics:
      awox-ble-mesh-hub/group-4/availability
      5 most recently received message(s)
      Received 14:05:36
      QoS: 0, Retained
      Payload: online
      Received 17:41:43
      QoS: 0
      Payload: online
      Received 17:41:59
      QoS: 0
      Payload: online
      Received 17:48:20
      QoS: 0
      Payload: online
      Received 18:17:31
      QoS: 0
      Payload: online
      awox-ble-mesh-hub/status
      10 most recently received message(s)
      Received 17:41:08
      QoS: 0
      Payload: online
      Received 17:41:20
      QoS: 0
      Payload: online
      Received 17:41:37
      QoS: 0
      Payload: online
      Received 17:41:51
      QoS: 0
      Payload: online
      Received 17:42:58
      QoS: 0
      Payload: offline
      Received 17:47:54
      QoS: 0
      Payload: online
      Received 17:47:59
      QoS: 0
      Payload: offline
      Received 17:48:10
      QoS: 0
      Payload: online
      Received 18:17:11
      QoS: 0
      Payload: offline
      Received 18:17:23
      QoS: 0
      Payload: online
      awox-ble-mesh-hub/connected
      10 most recently received message(s)
      Received 20:28:56
      QoS: 0
      Payload: online
      Received 20:29:01
      QoS: 0
      Payload: online
      Received 20:29:06
      QoS: 0
      Payload: online
      Received 20:29:11
      QoS: 0
      Payload: online
      Received 20:29:16
      QoS: 0
      Payload: online
      Received 20:29:21
      QoS: 0
      Payload: online
      Received 20:29:26
      QoS: 0
      Payload: online
      Received 20:29:31
      QoS: 0
      Payload: online
      Received 20:29:36
      QoS: 0
      Payload: online
      Received 20:29:41
      QoS: 0
      Payload: online
      awox-ble-mesh-hub/group-4/state
      10 most recently received message(s)
      Received 20:25:46
      QoS: 0
      Payload: state: 'ON'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:25:46
      QoS: 0
      Payload: state: 'ON'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:25:46
      QoS: 0
      Payload: state: 'ON'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:26:30
      QoS: 0
      Payload: state: 'OFF'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:26:30
      QoS: 0
      Payload: state: 'ON'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:26:30
      QoS: 0
      Payload: state: 'ON'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:26:30
      QoS: 0
      Payload: state: 'OFF'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:28:15
      QoS: 0
      Payload: state: 'OFF'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:28:15
      QoS: 0
      Payload: state: 'OFF'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Received 20:28:15
      QoS: 0
      Payload: state: 'OFF'
      color_mode: color_temp
      brightness: 67
      color_temp: 370
      color:
      r: 170
      g: 252
      b: 63
      Transmitted messages:
      awox-ble-mesh-hub/group-4/command
      10 most recently transmitted message(s)
      Transmitted 14:14:42
      QoS: 0
      Payload: state: 'ON'
      transition: 45
      color_temp: 173
      Transmitted 14:16:13
      QoS: 0
      Payload: state: 'ON'
      transition: 45
      color_temp: 174
      Transmitted 14:17:43
      QoS: 0
      Payload: state: 'ON'
      transition: 45
      color_temp: 174
      Transmitted 14:19:09
      QoS: 0
      Payload: state: 'OFF'
      Transmitted 18:16:30
      QoS: 0
      Payload: state: 'ON'
      transition: 1
      brightness: 161
      color_temp: 370
      Transmitted 18:18:06
      QoS: 0
      Payload: state: 'ON'
      transition: 1
      brightness: 160
      color_temp: 370
      Transmitted 20:23:43
      QoS: 0
      Payload: state: 'ON'
      transition: 1
      brightness: 68
      Transmitted 20:24:15
      QoS: 0
      Payload: state: 'ON'
      transition: 45
      brightness: 68
      Transmitted 20:25:46
      QoS: 0
      Payload: state: 'ON'
      transition: 45
      brightness: 67
      Transmitted 20:26:29
      QoS: 0
      Payload: state: 'OFF'
fsaris commented

Nothing under Transmitted messages:?

Oh sorry. I have updated above comment now.

fsaris commented

I can't see what exactly triggers it. But you see in the transmitted messages that the group is turned on by HA

Transmitted 20:23:43
QoS: 0
Payload: state: 'ON'
transition: 1
brightness: 68
Transmitted 20:24:15

The off and on after that one are triggered by you. At least that's what the log from your screenshot states.

Well yeah the group is turned on by HA thats correct.
But why also all lights in this group are turned ON instead of just one light which I want.
At the time only one single light was turned on in HA not a group of lights.

It would be best to show you as I am not sure if you know what I mean from the description.
Maybe if you will have some time and you have discord or some other app where I could share my screen so you can see directly what is going on for me?

UPDATE: Maybe I found something.... seems like it could be related to adaptive lighting I am using in HA. I need to dive into it a little bit more.

Ok so I found the root cause.
It's not a bug here in code also nothing wrong in Awox itself.

This all happens only when I use Awox made group in Adaptive lighting integration (AL).
So AL takes the group as single device so when I turn on any light then the AL comes to action changes brightness and temperature automatically if the light or group with that light is a part of it's config.
That means when the AL changes the brightness/temperature its done for the group not the single light which in the end results in turning on the rest of the lights inside such a group.

Solution for this is to configure all light entities I want in AL and don't try to make it simpler with groups.
image

Anyway thank you very much @fsaris for your time I stolen from you for no reason in the end.
Now I can finally think about how to implement Awox groups inside dashboards etc. to have smoother group controls.