Events instead of states
toddles last edited by
Apologies if this is obvious or has been asked before (I did have a quick search!). I have a mysensors node with a keypad which I want to use to toggle various lights, turn on my alarm, fire scripts etc. I have registered an 'S_INFO' sensor and I'm able to send the a V_TEXT (single char) through to homeassistant no problem.
I am wondering if it's possible for homeassistant to treat these incoming messages as events rather than as possible state changes. Otherwise, without some internal hackery, I can't register repeated presses of the same button. So if I want key 2 to toggle a light, for example, I can't toggle it on then off without pressing another button to change the sensor state.
The solution I've opted for at the moment is that, whenever the sensor state is changed, I have a routine which changes the state back to something invalid (0). This way every key press is firing a 'state change', but it can be a bit buggy if the buttons are pressed in quick succession.
Thanks in advance for your help.
alexelite last edited by
@toddles I don't think you can trigger an event directly. HA mysensors integration changes the state of entities only.
Your node sends button state on one single sensor id, value dependent on key pressed? And you only send on depressed event not on release?
If so, why not send also a release event, or count the times one button is pressed before sending?