Hi there!
I’m currently working on Greg Badros’s excellent Vantage integration, seeing if I can improve it for my setup.
One thing that bugs me – the buttons on Vantage keypads are currently represented as a sensor
object. I think it would be better to represent them as something with more semantics, such as a switch
or a binary_sensor
.
They are usually physically used as switches. You press them, and lights turn on and off. But sometimes they interact with more complex state or trigger arbitrarily complex complex actions on the Vantage system. And all they really are physically are pushbuttons, or momentary contact buttons (if you want to use technical terms…). They just have two states: pressed and released.
switch
doesn’t seem to have the right semantics. For something to be a switch, Home Assistant should be able to turn it on and off. And these are purely physical buttons – you can’t turn them on and off from software.
binary_sensor
seems perfect. Except… I notice that there is no device class called DEVICE_CLASS_BUTTON
for binary_sensor
. And none of the existing device classes describe a simple push button. Which makes me wonder… is there another type I’m supposed to be using? Or should I just add a DEVICE_CLASS_BUTTON
or DEVICE_CLASS_PUSHBUTTON
to binary_sensor?