Creating a 10 second Latch

Hi everyone,

I have been using Rpi3 with Cayenne for a couple of months now to schedule lights and log temperature and things like that. I recently added a motorized curtain to my room and it has programmable limits, so wont keep rolling once it hits the limits, however the button has to be pressed till it automatically stops. I tapped into the switches and hooked it into 2 relays, I can make 2 on-off switches in the Cayenne dashboard but I would like to know if there is a way I can make a widget which can be timed. Like I hit ON, it stays on for 10secs and turns off.

Another question is, I have RGB led strips in my room and I’d like to make it fade in to turn on or change colour, its hooked up through MOSFETs on a PWM expansion board, basically what I want to know is if Cayenne has programmable capabilites like an arduino has where when I activate a widget, it increases the pwm value from 0 to 255 at a particular rate.

Thanks for helping!

1 Like

Hi @jj_alukkas

We do have a timer functionality like this planned for a future release, but nothing in the Cayenne UI right now to help you accomplish the goal of this kind of timed button.

However, I think this could be accomplished if you switched from the original Raspberry Pi agent to our MQTT Python Pi Agent. The advantage here is that with the MQTT agent, you can use custom widgets to execute arbitrary code on the Pi device.

This way, instead of having a button that directly interacts with the relay (and is missing timer functionality), you could make one that runs a Python script. And that script would handle the logic of “turn on relay, wait 10 seconds, turn off relay”.

I think this same solution would help with your other question as well, this way you’re controlling the PWM value on the local machine via Python script as Cayenne doesn’t currently have a built in way to modulate the PWM at a specific rate like this via widget.

In both cases, this does not preclude you from having standard widgets to directly interact with the LED/relay.

2 Likes

Good morning

I would really like if this can get in to the app soon , I’ve got a Gate and only want to send a 2 sec latch to the gate to open and then automatically returned to off. I love the idea of this app.

As soon as we can get this in, I can add other things to.

Thank you.

I set a trigger that responds to a button push to close a relay then another trigger that responds to open the relay. It takes about 2 seconds for the second trigger to respond. I use a relay to activate a python script that reboots my pi3b, works like a charm. @adam was a great help! Or you can code it to tailer your needs. There are example of arduino I sure would help if you search threads in the community.

William