ZHA Zigbee Tested Devices...Please add your device results

@tosion you need to enable DEBUG logging (at least for homeassistant.core) and then in the home-assistant.log file look for zha_event[R] events, something like

2019-01-25 14:09:09 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[R]: unique_id=zha_event.lumi_lumi_sensor_switch_aq2_02133211_1, command=attribute_updated, args=attribute_id=0, attribute_name=on_off, value=Bool.false>
2019-01-25 14:09:09 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[R]: unique_id=zha_event.lumi_lumi_sensor_switch_aq2_02133211_1, command=attribute_updated, args=attribute_id=0, attribute_name=on_off, value=Bool.true>

to enable debug logging either update logger configuration section in configuration.yaml or call logger.set_default_level service with {"level": "debug"} data

OK - thanks!

Does this help - looks like event changes from kind of from false to true but how can I use it? No entity in states changes the state here?

2019-01-25 21:58:09 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[R]: unique_id=zha_event.lumi_lumi_sensor_switch_aq2_021315fc_1, command=attribute_updated, args=attribute_id=0, attribute_name=on_off, value=Bool.false>

2019-01-25 21:58:09 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[R]: unique_id=zha_event.lumi_lumi_sensor_switch_aq2_021315fc_1, command=attribute_updated, args=attribute_id=0, attribute_name=on_off, value=Bool.true>

On the other hand it seems to always happen in very same second and it always ends up to be Bool.true - never Bool.false in the end. So how to use this is another question? Can you really use this as trigger?

see event triggers
Something like:

- id: button_xiaomi
  alias: xiaomi button
  trigger:
  - platform: event
    event_type: zha_event
    event_data:
        unique_id: zha_event.lumi_lumi_sensor_switch_aq2_02132110_1
        attribute_name: on_off
        value: Bool.true
  action:
  - service: light.toggle
    entity_id: light.my_awesome_light

Many, many, many thanks!

Looks easy - you saved my day. I will test this tomorrow!

I followed the same directions but I unfortunately donā€™t seem to see any zha_events firing in the logs, despite setting default level to debug.

The button Iā€™m using is the WXXG11LM and it seems to have paired OK with ZHA.

This is me jamming on the button a few times. The events here just seem to be signal strength updates. I have the log viewer filtering for ā€œzhaā€ in the log text:

2019-01-25 22:52:50 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: <Entity None: 1> 0 Bool.false
2019-01-25 22:52:50 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: <Entity None: 0> 0 Bool.true
2019-01-25 22:52:52 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=zha.zha_01b86f7c, old_state=<state zha.zha_01b86f7c=online; nwk=0x90d0, ieee=00:15:8d:00:01:b8:6f:7c, lqi=255, rssi=-48 @ 2019-01-25T22:19:47.004677-05:00>, new_state=<state zha.zha_01b86f7c=online; nwk=0x90d0, ieee=00:15:8d:00:01:b8:6f:7c, lqi=254, rssi=-46 @ 2019-01-25T22:19:47.004677-05:00>>
2019-01-25 22:52:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140511315281400] Sending {'id': 2, 'type': 'event', 'event': {'event_type': 'state_changed', 'data': {'entity_id': 'zha.zha_01b86f7c', 'old_state': <state zha.zha_01b86f7c=online; nwk=0x90d0, ieee=00:15:8d:00:01:b8:6f:7c, lqi=255, rssi=-48 @ 2019-01-25T22:19:47.004677-05:00>, 'new_state': <state zha.zha_01b86f7c=online; nwk=0x90d0, ieee=00:15:8d:00:01:b8:6f:7c, lqi=254, rssi=-46 @ 2019-01-25T22:19:47.004677-05:00>}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2019, 1, 26, 3, 52, 52, 5971, tzinfo=<UTC>), 'context': {'id': '104505d7f58442f8a7381ed3a655862c', 'user_id': None}}}
2019-01-25 22:52:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140511195247840] Sending {'id': 2, 'type': 'event', 'event': {'event_type': 'state_changed', 'data': {'entity_id': 'zha.zha_01b86f7c', 'old_state': <state zha.zha_01b86f7c=online; nwk=0x90d0, ieee=00:15:8d:00:01:b8:6f:7c, lqi=255, rssi=-48 @ 2019-01-25T22:19:47.004677-05:00>, 'new_state': <state zha.zha_01b86f7c=online; nwk=0x90d0, ieee=00:15:8d:00:01:b8:6f:7c, lqi=254, rssi=-46 @ 2019-01-25T22:19:47.004677-05:00>}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2019, 1, 26, 3, 52, 52, 5971, tzinfo=<UTC>), 'context': {'id': '104505d7f58442f8a7381ed3a655862c', 'user_id': None}}}
2019-01-25 22:52:52 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: <Entity None: 1> 32768 2
2019-01-25 22:52:54 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: <Entity None: 1> 0 Bool.false
2019-01-25 22:52:54 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: <Entity None: 0> 0 Bool.true
2019-01-25 22:52:54 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: <Entity None: 1> 0 Bool.false
2019-01-25 22:52:54 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: <Entity None: 0> 0 Bool.true

I tried constructing an automation like the one @Quatuor suggested (btw, THANKS !) but the action I had (simple light toggle) didnā€™t happen when I pressed the button (but worked when I manually tripped the automation)

Thanks for all the hard work on ZHA ! Hopefully soon I can reduce the number of boxes on the shelf by 1 and decommission my deconz box for the other Zigbee stuff I have.

What version of HA?

0.86.2, docker version

Thanks - tested and it works!

- id: button_xiaomi
  alias: xiaomi button
  trigger:
  - platform: event
    event_type: zha_event
    event_data:
        unique_id: zha_event.lumi_lumi_sensor_switch_aq2_021315fc_1
        attribute_name: on_off
        value: Bool.true
  action:
  - service: light.toggle
    entity_id: light.ikea_of_sweden_tradfri_bulb_e27_cws_opal_600lm_fe837cca_1

Interested in this as well. For now, keeping mine connected to my old SmartThings hub and using API calls to HA, but would love to be able to cut out the middleman.

I just upgraded from 84.6 to 86.2. Several months ago I had set up the custom component to add ZHA battery levels for my iris and smartthings sensors, but eventually took it off. I had custom names for the batteries still in my configuration, but of course there were not battery sensors so they did not show up. Now with this update, I was suprised and happy to see them pop up on my screen. Butā€¦ They all show as unknown. Iā€™ve given them a good amount of time, but still all show unknown. Is there something i need to do? Do I need to remove and readd all my devices since they had old entries?

Thanks for the hard work on the zigbee devices, I felt like zigbee was not getting much love, and itā€™s nice to see this hard work!

EDIT: I ended up just removing and readding the devices and it looks to be working. Only took 10-20 minutes to get them all added

I do my event automations in node red so I could be wrong but your unique ID looks wrong to me. I think it should be the zha.xxx device of the one you are trying to trigger off of.

Edit: Iā€™m wrong. His example is right. The unique ID is right. The only difference from my automation is that I trigger off of ā€˜event.args.valueā€™. Value 0 is single tap, 2 is double and 3 is triple.

Thanks for a response!

Interesting!

In HA log:

unique_id=zha_event.lumi_lumi_sensor_switch_aq2_021315fc_1,

I followed instructions from Quatuor - I suppose his example works. Mine works also well, so ā€¦

Or did I understand something wrong?

See my edit. His example is correct. I was thinking z-wave events. Those are slightly different.

Well, i have a Xiomi button v2 attached and can see events like this in the log:

2019-01-28 10:24:07 DEBUG (MainThread) [zigpy.zcl] [0x4e05:1:0x0012] ZCL request 0x000a: [[<Attribute attrid=85 value=<zigpy.zcl.foundation.TypeValue object at 0x7f098034ba90>>]]
2019-01-28 10:24:07 DEBUG (MainThread) [zigpy.zcl] [0x4e05:1:0x0012] Attribute report received: 85=1
2019-01-28 10:24:07 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: 85 1
2019-01-28 10:24:10 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6,

How do I trigger off that? what attribute is being set to 1? (single click, double is 85=2, shake is 85=18, etc)

Sorry I couldnā€™t find it obviously in the threadā€“
are the Xiaomi Aqara sensors working in 0.86 without any additional configuration?
is this the PR that has them working in HA?
https://github.com/home-assistant/home-assistant/pull/19099

Instead of looking at the log, if you have NodeRed installed, put out an ā€œAll Eventsā€ node and attach a Debug node. When I did that and clicked the button, a ā€œzha_eventā€ message popped up in the debug window. This is the message that comes up when I click it three times:

{ā€œevent_typeā€:ā€œzha_eventā€,
ā€œeventā€:{ā€œunique_idā€:ā€œzha_event.lumi_lumi_sensor_switch_02ca334b_1ā€,
ā€œcommandā€:ā€œattribute_updatedā€,
ā€œargsā€:{ā€œattribute_idā€:32768,ā€œattribute_nameā€:ā€œUnknownā€,ā€œvalueā€:3}}}`

So I put ā€œzha_eventā€ as the event type in the Events Node and used two Split Nodes, one to read the ā€œpayload.event.unique_idā€ and the next to read the ā€œpayload.event.args.valueā€. Now I can program scenes for each number of times I press the button consecutively.

1 Like

Thanks @Musicman247 but iā€™m lostā€¦ and donā€™t have, nor want to install NodeRedā€¦ guess they still havenā€™t really implemented these fully :frowning: works great with zha_new, but i have other issues with that package so would rather stick with the offical.

if you could provide more code/examples/help that would be great.

Thanks

@cybergrimes yes, looks like its in, and i have a number of Xiaomi working okā€¦ the buttons are still giving me issues, as I donā€™t know how to access the event for button clicked, double, held, shake. I can see it in the logs, but donā€™t know how to automate/react to them in the yaml files :frowning:

set homeassistant.core logging level to debug ā€“ run logging.set_level service with {"homeassistant.core": "debug"} service data. Join the button and check the homeassistant log, eg tail -f ~/.homeassistant/home-assistant.log | grep zha_event

Ok, just like Quator says, set your logging level to ā€œdebugā€. You can add this to the configuration.yaml and do the same thing:

logger:
default: debug

Once youā€™ve pressed your button, look for a reference to a ā€œzha_eventā€. Mine looked like this when I double-clicked the button:

2019-01-30 21:59:07 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event zha_event[R]: unique_id=zha_event.lumi_lumi_sensor_switch_02c7f5fe_1, command=attribute_updated, args=attribute_id=32768, attribute_name=Unknown, value=2>

From that you just need the ā€œunique_idā€ and ā€œvalueā€ to set up your automation. Hereā€™s my automation in yaml.

  • id: ā€˜1548874688400ā€™
    alias: Button Double Press
    trigger:
    • event_data:
      args:
      value: 2
      unique_id: zha_event.lumi_lumi_sensor_switch_02c7f5fe_1
      event_type: zha_event
      platform: event
      condition:
      action:
    • data:
      entity_id: light.living_room
      service: light.turn_on

Made it in the Automations GUI, so I have a pic of that as well.

I have the original Mijia Wireless Switch (round button), but Iā€™m pretty sure the same method will apply to the newer button as well.

Hope this helps!

2 Likes