Simplified scene

What is the best way to create a scene when you want to turn on devices in sequence e.g. Start device one, leave on 15minutes, Stop device one, start device two etc.

What I am doing is slightly more complicated than that as it requires associated pump to start etc but that is the gist.

I have created a Binarylight and action that is accessed through a scene to do this but is it the best way.

I am attaching my files, because I am not sure if I am explaining myself very well or not :-\

Also note my code sucks, very little error checking and a mash of coding styles, but it works :slight_smile:

Have you tried the advanced tab of a scene? It allows more flexibility in terms of actions and times compared to the commands tab.

@strangely
No, but have now.

My question was wrong it should have been “Where does this code belong?”

The scene on this is as follows: -

  1. Creates table of valve == pump and sorts.
  2. Creates table of valves ~= skip and sorts.
  3. Loop through valves associated with each pump and turns on valve then pump for a period set by timer.

I did this as the Rain8Net has no internal programming except a watchdog timer for shutoff (which is more of a safety feature) and the modules can be daisy chained so you could end of with substantial number of (2040) individual valves.

I think the EtherRain unit has the sequencial funtiionality built in, but it looks like Rain8net doesnt. Although it does say this on the web “Default run timer for each zone to prevent over watering”, but is this the “watchdog” timer you mention and it isn’t user configurable? So essentially it is just a set of RS-232 triggered relays, and EtherRain isn’t much smarter but it does have enough to be able to be run via a website. IDK it does seem to hold some programming as it says “programming data is stored in non-volatile memory”.

I would think, if possible, it would be best to have the valve sequencing happen in the plug-in. So you can modify the settings for the device, adding the times for each zone, and then have a simple scene trigger it by time and/or day. I don’t know enough, but it looks like this isn’t possible or you would have done it. You might be able to do it all with one scene and use Luup code in its Luup tab to get the sequence and times for the zones happening.

@shady
Address, timers (watchdog) etc are programmable on the Rain8net but it is done as a single unit (can’t be done insitu unless there are no other units on the same serial port)

I have done exactly as you suggest by adding a DEVICETYPE_BINARY_LIGHT called “Program” which you can call from a scene and it goes through the valve sequencing. I also added variables for timers and pumps etc.

From what you are saying it is probably the best approach, thanks for your feedback. Now I need someone to look at the code and tell me where I can do better.

[quote=“shady, post:4, topic:167857”]I think the EtherRain unit has the sequencial funtiionality built in, but it looks like Rain8net doesnt. Although it does say this on the web “Default run timer for each zone to prevent over watering”, but is this the “watchdog” timer you mention and it isn’t user configurable? So essentially it is just a set of RS-232 triggered relays, and EtherRain isn’t much smarter but it does have enough to be able to be run via a website. IDK it does seem to hold some programming as it says “programming data is stored in non-volatile memory”.

I would think, if possible, it would be best to have the valve sequencing happen in the plug-in. So you can modify the settings for the device, adding the times for each zone, and then have a simple scene trigger it by time and/or day. I don’t know enough, but it looks like this isn’t possible or you would have done it. You might be able to do it all with one scene and use Luup code in its Luup tab to get the sequence and times for the zones happening.[/quote]

We’re replacing our Hunter controllers with Rain8pro units–driven directly over serial. We extended the system so we could have more articulation, so the “new” controller is a Rain8pro driven over serial through an Aircable. Works great. Yes, the watchdog timers are “failsafe” only, and have to be programmed when the unit is the only one on the serial connection, since this is also how you have to connect to program the unit “address”. So for last summer, we drove the new unit off cron for starts, and let the watchdogs do shutoff. This new controller is running all drip, so fine-tuning wasn’t a priority. I’ve written a Perl script (that still needs work and testing) that will be this year’s driver. Woken by cron every minute (or when someone tickles the web interface), logging state, gallonage, etc to MySQL. Once it’s working well with the current Rain8pro, we’ll replace the 16-zone Hunter with two more.

Nice thing about the Rain8s is that you can run up to three zones simultaneously per power supply. We have four lawn zones, and everything else (12 so far) is drip. You typically want to run drip for an hour every few days. If they have to be sequential, that’s 12 hours. With two distinct Rain8 power supplies, we can run them 6 at a whack, getting all the watering done in the night, as you would prefer.

The really nice thing about the Pro modules is that they have per zone “on” buttons on the unit, and an “all off”, and lamps that indicate “on” status. Which means you can always turn them on/off at the controller, and visually see what’s running. More $$$, and RS-232 only, but it made sense to us. If we interface this to Vera, we’ll do it but having Vera tickle the web interface. But given that we want to interface this directly to our weather station data and such, it seemed like trying to dump it all on Vera was the wrong choice. We have Linux servers up 24/7. This gives them something to do with their free cycles.

–Richard

Anyone interested in giving the code a try, if you have a Rain8net/Pro.

There are some quirks and I have to write some sort of setup document but would like some feedback.

John