Events instead of states
-
Hi there,
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.
-
@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?
Suggested Topics
-
Forum Theme Problems
Announcements • 8 Apr 2014, 07:05 • hek 8 Apr 2014, 07:05 -
How I delete a node from HA and start over.
Home Assistant • 18 Oct 2024, 02:05 • OldSurferDude 18 Oct 2024, 02:05 -
Where to change settings?
Home Assistant • 15 Mar 2023, 14:58 • eiten 25 Jul 2024, 19:19 -
HVAC type sensor in homeassistant
Home Assistant • 17 Aug 2024, 10:50 • tbowmo 17 Aug 2024, 20:51 -
Home Assistant update changed USB port name
Home Assistant • 14 Jan 2024, 17:25 • therik 15 Jan 2024, 10:26