Handling push buttons events


  • Hardware Contributor

    Hi !

    I'm planning to drive lights with my MySensors devices :

    I have some Mysensors devices with 8 light outputs (dimmers boards and relay boards),
    and I have some Mysensors devices with 8 push button inputs.

    I'm used to have 3 functions on the same button with my previous home automation system :
    I have the "short press" event, "long press begining" event, and the "long press release" event.
    Using these events, I usually set different actions on short press events and on long press begin events.
    This allows me , i.e., to drive 2 differents lights with the same button, or to set a dim level with a long press, and an ON/OFF command on a short press.

    How should I define my Mysensors devices to return the short press/long press/release events , that can be handled by domoticz ?
    What would be the best way to handle those kind of events in Domoticz ?

    Perhaps using the "V_TEXT" subdevice type could allow me to report differents events "PULSE/HOLD/RELEASE", but I suppose then I'll have to use nothing else but scripts to handle these on domoticz ?


  • Hero Member

    @napo7 I am doing something similar. At first I tried to have Domoticz handle the short/long keypresses. Not very succesfull because of timing. i.e. I was not able to get dimming realiable. In my case I have the actuator (key fob) time the key-press and send the dimming level. As there is no up/down dimming command I use the V_UP/ V_DOWN of the S_COVER.


  • Hardware Contributor

    Handling the short press/long press/release by the arduino is quite easy.
    I can already send a different event regarding what happens on each button, but the event has to be handled by domoticz 😉

    Previously, I was using a custom-made software for all my home automation.
    I handled the thing like this :
    When event is "pulse" :
    if timer is OFF and light is OFF :
    - Turn a timer ON for 5 seconds.
    - Turn light to 1st dim level (levels are 2, 5, 10, 30, 50 and 100%)
    if light is ON and timer is ON :

    • Reset timer to 5s.
    • Turn light to next dim level
      If light is ON but timer is OFF :
    • Turn light OFF

    when event is "hold" :
    -do another action (ie. turn on/off another light)...

    That was working corretly, I did put this script in a function that I could reuse for each light easily, but it was my own home automation system software, and now I want to turn to another system, no more time to fix/enhance my own software !


Log in to reply
 

Suggested Topics

  • 5
  • 1
  • 4
  • 8
  • 2
  • 4

63
Online

11.4k
Users

11.1k
Topics

112.7k
Posts