Need a little help RE buttons

OK, so briefly I have the excellent Hubitat courtesy of @ogiewon up and running to interface my alarm system into HE via the alarm panel binary on/off 12v outputs. I have programmed them to mirror my alarms motions sensors and contacts using Hubitats motion and contact option. I have also configured the alarm panel to report out various states - armed, part armed, alarm triggered etc etc, with the Hubitat interface treating these as buttons. My thinking here being whilst 'armed' for example, the alarm panel 'holds' the button and so HE knows. Same for other states.

What i am having a hard time with is I expect actually quite simple (especially given how far I have come with this from scratch!). I have a dashboard which i'm using to report the state of all the sensors for testing purposes - i apply 12v , it lights up the motion icon in green, all good. I am trying to get some kind of virtual device (i think?) to be able to reflect the button condition, but seem to be struggling. Can someone give me a pointer as to what might be best? The buttons are all present in HE, it's just this last step that seems to have got me!

Thanks in advance.

The dashboard is not very good at displaying the status of buttons on dashboards as they are momentary devices (no on/off).

What you could do is a rule that turns on switches or updates a string variable based on which button was pressed last. Those could show on a dashboard.

Hi @Sebastien - that is exactly what I was trying to do but it didnt seem to work out. I made a virtual device - virtual switch and then placed it on my dashboard, and verified that when i manually toggle the VS from the device page it lights up/goes out. Then i linked to the button using simple automation rules as per below, but nothing happens on the dashboard.

Any thoughts? Or any other ways i can verify a button is reporting its action in?

1 Like

What do the logs of the COmm B1 VD look like? Also not sure you need optimization on if you're toggling a virtual switch.

1 Like

Thanks Brad. I think optimisation might be on by default, i have knocked it off. Th elogs were blank except for my manual on/offs from the device page.

I've now changed the switch trigger for a Hue hardware switch and it worked fine, so something is up with my implementation with the Hubitat to HE re buttons. I will look into it and pester poor @ogiewon on the Hubitat post if necessary.

Thanks all for the input.

If the logs are blank and since you have both debug and description text logging, it means that the rule is not running.

When you say you changed the trigger for a Hue HW switch, you mean that instead of using the “Comms” button you use the Hue switch?

Is it possible that you are not pushing the correct button on the “Comms” button?

Sorry yes, thats not clear is it. I changed the trigger to a hue button and it all worked ok.

I have now got to the bottom of it, but still need a little more advice! I looked in my arduino serial monitor and the button was reporting 'held' rather than 'pushed' - once i sorted this in HE it works great.

THe trouble i have left then, is how to turn on my virtual device when held, and turn off when released? I am using simple automation rules and can't quite get it to act that way.

And to partly answer my own question - using two separate rules in Rule Machine i can make it work. One for held - turn on, and one for released - turn off. I imagine there is a cleaner way to achieve this though?

Two Rule Machine (RM) rules will definitely work. Another option if you want a single rule:

Trigger:
“Comms” Button 1 held

Actions:
Turn on “COmm B1 VD”
Wait for “Comms” Button 1 Released
Turn off “COmm B1 VD”

1 Like

Thats great, thanks for your help Sebastien.

1 Like