SkyConnect: button only available via event (not binary_sensor)?

Hi everybody,

I just received my SkyConnect and connected it to my Homeassistant. Then I paired a Xiaomi Aqara button to test it. It found the device and lists it:

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 :wink:

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.

Both? Neither?

This has nothing to do with SkyConnect itself.

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.

But I generally hate using device triggers due to their reliance on device ID.

1 Like

I have two Xiaomi buttons and a Lowes Iris 4 button fob. Both types works the same as just described so it seems common.

1 Like

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.

1 Like

Thank you! This is it, or at least the closest to what I was looking for.

A very unfriendly presentation only a programmer could love.

:100:

Your screenshot translates to something like this in yaml

device_id: asdbafasdffadasdasd
domain: zha
platform: device
type: remote_button_short_press
subtype: remote_button_short_press

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).