Custom triggers - Software based triggers


#1

Hello All,

Ive just installed cyaenne on my pi3, i would like to know that apart from hardware triggers can i use software triggers as well to initiate actions from the pi. If yes, how do I configure a software trigger.


#2

What type of software trigger are you talking about? Currently they only have a schedule. I would also like to see some sort of API that accepts values/trigger from those values, possibly MQTT. As soon as they get the custom code portion working we can work around this though.


#3

An analogy I came up with the other day is like having an extension to the GPIO tab which is pretty much IP:OP HIGH:LOW table but make the extension in the form of a Variable Table at the bottom with Generic Variables that are available for tagging, naming, ranging like any other variable available for use withing the Pi (WebIOPi et for starters) but that a function in say python or a shell script can read / write to.
(I half cooked up a messy graphic for this…)
~ Andrew


#4

@prashantrar @ats1080s @picaxe Moving this to the Ideas / Suggestions category so I can track in road map. Hope you don’t mind.

-B


#5

I have been thinking about the same type of thing. I think (my opinion…) that it would be good if Cayenne stayed simple to use and stayed focused on making the things that are in process better and better (more display options on charts, and more control over the devices/sensors that are there, ability to customize the triggers with settable text etc.). It would be great if we had a “software” sensor or something like that which would enable us to hook into the Cayenne system with our own custom code. Although I wouldn’t try and add macros and other more complex things to the Cayenne system as I think it would likely severely sidetrack the development process and only have minimal benefit.

One thought that I have had and i will be trying over the next few days is to use a simple python script run on the pi that sets a gpio pin high or low based on calculations/algorithms that I want to implement, and then use the Cayenne system to read the gpio pin and use that as my bridge between my python code and the Cayenne world :). If I get anything to work I will post it up on projects…


#6

actually something simpler would be to allow http post as a trigger action.

Or maybe IFTTT as a device?

/brian chee


#7

There is a Maker Channel in IFTTT that can create a specific web hook to trigger the action or outcome you want on your Pi. For example I was thinking of a Raspberry Pi Zero that can be used to close a relay and switch on power to my garden lights and use sunset times as the trigger to switch them on and then a time event to turn them off.

The same mechanism could be used for a range of different timed events. It opens up Cayenne as the Actor to all of the channels in IFTT. I’m also thinking of adding Energenie sockets and a PiMote if these sockets don’t link to my Smappee.


#8

Here’s my +1 for the PiMote board. I’ve got these at home, and I have an idea for a home automation project so that I can control a fan in our house when it gets too humid. This would involved a DHT11 sensor (I know it’s currently not supported either) and would trigger an event, activating the PiMote to turn on an extractor fan.

I imagine this could be done in Python or C, but using Cayenne would be so much easier!