As you can see, there are only Battery and Identify (those other two entities were disabled from the start); however, in logbook, you can see that the button was pushed.
When I look at developer-tools > event, I get this
So the button presses are definitely acknowledged by Homeassistant; but it seems kinda weird to me that I have to work with event here, which seems much more difficult than state. My other zigbee devices are connected through zigbee2mqtt, which gives a binary_sensor_<button> entity…
Can I configure SkyConnect so that it will provide a binary sensor entity? I wasn’t able to find that much information about SkyConnect (the website still just tells you to pre-order, but there are no docs), so I don’t know if this event stuff is a bug or a feature
It is because it is a button you have and not a switch.
A switch can be switched between multiple states.
A button only change state momentarily and then switch back right away.
It’s just the way ZHA presents buttons, regardless of the coordinator used.
A very unfriendly presentation only a programmer could love.
An automation DEVICE trigger may present the events as options under the trigger select, but I don’t have enough ZHA devices to know if it’s common for all button devices or is quirk dependent.
Good to know. I have a single aqara button as well, but it is under z2m in my primary zigbee net. Don’t think I ever tested it with ZHA.
I mostly use lutron caseta picos where I need a button, and until recently they were event dependent as well. A recent update exposes button entities, but I’m not sure that really helps as an automaton trigger.
Which is fine. But this code below is much easier to write when one is not using the web UI, but uses separate files for different things
trigger:
- platform: state
entity_id: binary_sensor.my_button
to: button_1_single
I always know my entity_ids, because I name them something like <room>/<usage> (= Livingroom/Wallswitch), but these random device_ids must be looked up (at least when having countless entities and/or not having perfect memory).
You are right. But while a button cannot have a state in a way a switch does, it can be handled differently; zigbee2mqtt would send something like button_1_single when pressing button 1 once, then immediately revert to none (or an empty string? not sure atm). So the button has a default state that it is always set to, and the “event state”, to which it only switches for ~1 second when the event happens.
So I understand what you are saying, but I still find it weird that HA handles it this way. If I hadn’t come from zigbee2mqtt, I guess this would be logical and fine, but having worked a certain way for years makes this solution feel very clumsy (but @jerrm s solution is something I can get used to).