OK, I can take a look but I think its a bit over my head haha.
Not really sure where i’d find what I’d have to change to work with the Mija devices.
OK, I can take a look but I think its a bit over my head haha.
Not really sure where i’d find what I’d have to change to work with the Mija devices.
Thank you very much for a quick response!
I makes sense to look for that zha_event! My only problem is that I do not know where to look for
In sates there are only these four entities and nothing happens there - I do not see any events there. So please could you give me some coordinates to follow?
Has anyone got their Samsung Smartthings button to work? Mine only comes up as a binary_sensor (on/off) and temp and battery sensor. I also don’t see any zha_event logs when pushed.
@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.
Thanks @Musicman247 but i’m lost… and don’t have, nor want to install NodeRed… guess they still haven’t really implemented these fully 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