Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Home Assistant
  4. Events instead of states

Events instead of states

Scheduled Pinned Locked Moved Home Assistant
event button
2 Posts 2 Posters 56 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toddles
    wrote on last edited by
    #1

    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.

    alexeliteA 1 Reply Last reply
    0
    • T toddles

      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.

      alexeliteA Offline
      alexeliteA Offline
      alexelite
      wrote on last edited by
      #2

      @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?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      11

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular