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

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

@Musicman247 i’ve done that… i don’t get zha_events I get what I posted originally. “Event state_changed…”

Ah, I see. Looks like you’re cutting off the second half of the call, though. What comes after the “entity_id” portion? That’s probably where the actual command value is. Can you post the whole debug message?

2019-01-31 12:06:37 DEBUG (MainThread) [bellows.uart] Data frame: b’1556b1ed542e14a059954b25ab5592bd629c22e512316f936ecc3689dd7f3f799f7e’

2019-01-31 12:06:37 DEBUG (MainThread) [bellows.uart] Sending: b’82503a7e’

2019-01-31 12:06:37 DEBUG (MainThread) [bellows.ezsp] Application frame 69 (incomingMessageHandler) received

2019-01-31 12:06:37 DEBUG (MainThread) [zigpy.zcl] [0x4e05:1:0x0012] ZCL request 0x000a: [[<Attribute attrid=85 value=<zigpy.zcl.foundation.TypeValue object at 0x7f8b30b62e48>>]]

2019-01-31 12:06:37 DEBUG (MainThread) [zigpy.zcl] [0x4e05:1:0x0012] Attribute report received: 85=1

2019-01-31 12:06:37 DEBUG (MainThread) [homeassistant.components.zha.sensor] Attribute updated: 85 1

2019-01-31 12:06:49 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6, old_state=<state zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6=online; nwk=0x4e05, ieee=00:15:8d:00:01:b9:78:b6, lqi=255, rssi=-45, friendly_name=buttonx1 @ 2019-01-31T11:42:48.002321-05:00>, new_state=<state zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6=online; nwk=0x4e05, ieee=00:15:8d:00:01:b9:78:b6, lqi=254, rssi=-46, friendly_name=buttonx1 @ 2019-01-31T11:42:48.002321-05:00>>

2019-01-31 12:06:49 WARNING (MainThread) [homeassistant.helpers.condition] Value cannot be processed as a number: <state zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6=online; nwk=0x4e05, ieee=00:15:8d:00:01:b9:78:b6, lqi=254, rssi=-46, friendly_name=buttonx1 @ 2019-01-31T11:42:48.002321-05:00> (Offending entity: )

2019-01-31 12:06:49 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140235794515224] Sending {‘id’: 2, ‘type’: ‘event’, ‘event’: {‘event_type’: ‘state_changed’, ‘data’: {‘entity_id’: ‘zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6’, ‘old_state’: <state zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6=online; nwk=0x4e05, ieee=00:15:8d:00:01:b9:78:b6, lqi=255, rssi=-45, friendly_name=buttonx1 @ 2019-01-31T11:42:48.002321-05:00>, ‘new_state’: <state zha.zha_lumi_lumi_sensor_switch_aq3_01b978b6=online; nwk=0x4e05, ieee=00:15:8d:00:01:b9:78:b6, lqi=254, rssi=-46, friendly_name=buttonx1 @ 2019-01-31T11:42:48.002321-05:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2019, 1, 31, 17, 6, 49, 2999, tzinfo=), ‘context’: {‘id’: ‘4b6b259de50047d78175c5eb279ee88a’, ‘user_id’: None}}}

Notice the 10 second delay as well :frowning:

Is this you just pressing the button once or is it twice like a double-click?

Anyone have the Tradfri motion sensor working? I get entities but the binary sensor never activates with motion…

I managed to get a hive dimmable bulb and an ikea bulb paired easilly they work well. I paired a xiaomi aquar temp and humidity the sensor the little round one, it reports temp and humidity fine. Not so sucessfuly an ikea 5 button dimmer it reports battery level and as a binary switch but it does not give any events so does not do anything usefull. An aqara humon body sensor i got paired it shows as a binary switch but never changes from off so again pretty uselsee. And finally i tried to paired a aqara single wireless switch wxkg03lm and no joy with that one. Running ha 0.86.4 in docker on an odroid hc1 wuth a xbee s2c. On a few occasions trying to add the aqara devices messed up the zigbee.db and i had to delete it and re start. And i get various error messages in the logs from either zigpy and zigpy_xbee

@techoguy
Is the colour transisition still an issue for you?
I recently had this issue with Hue globes and found the cause is ZHA in Home Assistant sending the colour command before the On command, which means the colour command while the light is OFF is ignored (as per ZCL specs).
I have raised an issue and one of the devs helped me by making a custom zha light py file that sends the colour command after the on command and the transitions work as expected with that.

I used the work around you used also, but note that brightness = 0 would actually be the same as an off command. It would need to be a brightness = 1 (or for some hue globes, brightness =2, as some take 1 as off).

1 Like

Great to know! I don’t use colors much so it hasn’t been an issue or something I look into.

I have been playing around with a couple Xiaomi Aqara devices on HA 0.86. (1 Door Sensor, 1 Motion Sensor).

When I first pair them they seem to work great. The show everything they are supposed to although I don’t think the battery level is accurate. The issue I am having though is after a day or two they seem to drop off the network and stop responding and need to be repaired. Anyone else having this issue?

1 Like

Yes, I have two Xiaomi Aquara door sensors and I’m experiencing the same issue. They drop off the network and the ZHA entity changes to offline. One sensor has been dropping ever 3 to 12 hours, the other sensor made it a few days before dropping offline.

I assume this is due to the Xiaomi devices being so picky about the parent devices.

Any ideas @dmulcahey?

Full log with ZHA debugging enabled:

logger:
  default: info
  logs:
    bellows.ezsp: debug
    bellows.zigbee.application: debug
    bellows.uart: debug
    homeassistant.components.zha: debug
    zigpy: debug
    zigpy.application: debug
    zigpy.zdo: debug

Screenshots:


It’s a common issue with Xiaomi devices. There are a few routers that hold them well. Google it and you’ll find info. I’ll post links to the info I have after work this evening.

1 Like

Thanks! I hadn’t looked at your code yet but I assumed it was doing something clever with keep alives or timeouts to keep the sensors online - is there something we can modify at the bellows level to make these more stable?