Can you please add a momentary button


#1

Any chance of you adding a momentary button to the dashboard widgets.
Thanks
Rich


Customise the relay activation
#2

Hi Rich,

It has been requested. Developers are just busy getting the API released.

We’ve been told they will start hitting the backlog shortly after that.

If you are on Arduino, you can roll your own, by using a virtual digital. Have your virtual function trigger a physical I/O, then off after so long. Every time you click the button, it triggers the pushbutton pulse.

Cheers,

Craig


#3

Craig, do you have some example code to check this out? Def needed for my plan to implement a door lock.


#4

@devonmeyer,

I haven’t tried to do it yet, but I’d start by following the examples in this library and trigger a sequence every time the Virtual function is entered.

http://playground.arduino.cc/Code/Timer

Cheers,

Craig


#5

My solution to this is to create a normal On/Off button. Then create a trigger and add the button as the “If”, and match for the button “On”, for the “Then”, I set the same button to “Off”. It’s a bit tedious to do it for many buttons, but a good short term work around.

I’m using it to trigger opening a blind. When the button is pressed, it’s like pressing the button on the remote control, and the blind goes up (like a garage door would). It works great. An ideal implementation for this in my mind is when the button is pressed, it sends a single event saying it was pressed. What is happening for me at the moment is I get an event “1” and then an event “0” right away afterwards.

Thanks!


#6

This is indeed on our product roadmap/backlog that we’ll be breaking into when we have the API out the door. Thank you for sharing your workaround solutions until then.


#7

@rich-miller @kreggly @devonmeyer @trentd Do you guys see issue with implementing momentary push button on web dashboard? I’m not sure yet if the momentary button will work the same on a web interface as a mobile app…

-B


#8

I think it should work, but there are implementation details to worry about.

The happy path should work fine. Turn on. Wait. Turn off.

The issues I see are:

We don’t remember the state
Some other process changes the state
We lose communication and the state sticks
There is a long delay between state changes

If you implement with caveats, I think it’s fine.

Cheers,

Craig


#9

A Cayenne trigger would have to trip a “timer” function on the remote end. :wink:
In any case, the “remote” would have to do the controlling- to resolve the issues that Kreggly describes, -such as a retriggerable 1-shot.[quote=“kreggly, post:8, topic:1143”]
We don’t remember the state
Some other process changes the state
We lose communication and the state sticks
There is a long delay between state changes
[/quote]


#10

As Bill says, if you want the client side behavior to be predictable, then a function within the device should handle the off.

Here’s what I was thinking. If you guys handle a button that resets itself graphically, and offer up some sample code when adding the object, then golden.

The pulse function looks like it would do the trick.

int pulse(int pin, long period, int startingValue)

Cheers,

Craig


#11

Thanks @trentd for this work around, its working great for my project.
Rich