Can I publish acutator state twice?


#1

I’m making an automated watering system. I want to switch the pump with a digital acutator from cayenne’s react, although for reliability I’d like it to turn off by itself. Is it possible to receive an “on” command from an acutator widget, publish “on” state + “ok” response and send an “off” state after eg. a minute? If so, how to do it? What sequence identifier should I use? Could it be done with ESP8266 Cayenne library?

Thanks


#2

Sure, you would just use the standard virtualWrite command.

Cayenne.virtualWrite(channel, 0, "digital_actuator", "d")

Replace channel with the channel you selected for the actuator
0 is the state (change to 1 if you need to invert)