I am implementing an IR remote control thing, and I need to add a software push button (a button in the webthings app not a physical one) so the IR sends only while pressing.
I have tried the push button capability and it looks like I have to use a physical button since it is a read only.
I have tried the on off switch but I have to toggle it back off.
I have tried to simulate the effect using an on off switch and code to switch off after sometime but the the value of the switch turned to a three dots (neither on nor off).
So any help should be appreciated
I used a Virtual Device addon “Push Button” instance and a custom rule to fire events when the button was pushed.
Create a custom rule:
Condition: When “named button” is pushed OR [insert other conditions to trigger event]
Action: Perform real action AND reset “named button” to NOT pushed
Basically when the button is pushed an action is triggered. You must reset the button to not-pushed as one of the actions.
Thank you Eric for response, when I tried the virtual add-on push button it doesn’t work (the button stays not pushed) I have to enter to the push button’s detailed view and toggle the internal button and the button icon stays not pushed also!!
Should I make the custom rule from the rules tab?
I will try it and inform you
Documentation to provision Virtual Button documentation is poor IMO.
This is how I provisioned the virtual button as a “Pushed Event”
Then you add a new Thing, which created this thing for me. When I select “Pressed” it will trigger but remain pressed because it is not reset to not-pressed (I think, but cannot test at this moment).
I then create a rule that executed when the Pressed thing was TRUE to trigger the rule and reset the Pressed state to FALSE as one of it’s actions.
Finally, when my X10/Mochad Bash script detects specific X10 RF button presses, it executes a remote API call on my RPI to remotely set the Pressed thing property to “1” (true). I don’t have the exact syntax in memory but can dig out an example if needed.
I tried it @EricEdberg and works good (sometimes it hang pushed but I refresh the page and everything is okay).
I have a question, is pushedProperty a valid thing’s type (as far as I know it’s a property type) ?