Code wanted for pool pump On/off

I am A newbee and I?ve read a LUA code somewhere but can?t find it anymore, so please help!

I have a Vera plus, Fibaro door sensor and Fibaro temp sensor.
I need a code that switches my pool pump on/off depending on the pool temp.
Example:

  1. When the pool temp is <18C then the pump should be on at 8 till 10Am and 10 till 11 PM
  2. When the pool temp is between 18C and 24C the pump should be on at 8 till 10Am, 2 till 4 PM and 10 till 11 PM
  3. When the pool temp is >24C the pump should be on at 8 till 11 AM , 2 till 5 PM and 10 till 12 PM

Any help or ideas will be highly appreciated! Thanks!

You can do this easily using the reactor plugin.

Buxton, pls tell…I. Am a newbee, [ftp][/ftp]

Here’s the link to the plugin FAQ. This will get you going. http://forum.micasaverde.com/index.php/board,93.0.html

[quote=“BerrytH, post:1, topic:200572”]I am A newbee and I?ve read a LUA code somewhere but can?t find it anymore, so please help!

I have a Vera plus, Fibaro door sensor and Fibaro temp sensor.
I need a code that switches my pool pump on/off depending on the pool temp.
Example:

  1. When the pool temp is <18C then the pump should be on at 8 till 10Am and 10 till 11 PM
  2. When the pool temp is between 18C and 24C the pump should be on at 8 till 10Am, 2 till 4 PM and 10 till 11 PM
  3. When the pool temp is >24C the pump should be on at 8 till 11 AM , 2 till 5 PM and 10 till 12 PM

Any help or ideas will be highly appreciated! Thanks![/quote]

Keep it short and simple ;D

scene 1 turn pump on 8 AM
Scene 2 turn pump off 10 AM if temp < 24
Scene 3 turn pump off 11 AM
Scene 4 turn pump on 2 PM if temp > 18
Scene 5 turn pump off 4 PM if temp > 18 and < 24
Scene 6 turn pump off 5 PM
Scene 7 turn pump on 10 PM
Scene 8 turn pump off 11 PM if temp < 24
Scene 9 turn pump off 12 PM

[quote=“markoe, post:5, topic:200572”][quote=“BerrytH, post:1, topic:200572”]I am A newbee and I?ve read a LUA code somewhere but can?t find it anymore, so please help!

I have a Vera plus, Fibaro door sensor and Fibaro temp sensor.
I need a code that switches my pool pump on/off depending on the pool temp.
Example:

  1. When the pool temp is <18C then the pump should be on at 8 till 10Am and 10 till 11 PM
  2. When the pool temp is between 18C and 24C the pump should be on at 8 till 10Am, 2 till 4 PM and 10 till 11 PM
  3. When the pool temp is >24C the pump should be on at 8 till 11 AM , 2 till 5 PM and 10 till 12 PM

Any help or ideas will be highly appreciated! Thanks![/quote]

Keep it short and simple ;D

scene 1 turn pump on 8 AM
Scene 2 turn pump off 10 AM if temp < 24
Scene 3 turn pump off 11 AM
Scene 4 turn pump on 2 PM if temp > 18
Scene 5 turn pump off 4 PM if temp > 18 and < 24
Scene 6 turn pump off 5 PM
Scene 7 turn pump on 10 PM
Scene 8 turn pump off 11 PM if temp < 24
Scene 9 turn pump off 12 PM[/quote]

Thanks Markoe,

Looks quite simple but how is it possible to put 2 or more triggers in one scene?
Therefore I think a Lua code is necessary…but I?m probably wrong, right?
Please help,
Thanks!

Yes you are probably right. You can add multible trickers but there is OR tricker between >:(. I have been using the lua only so long that I forgot the VERA UI limitations.

You need to add something like this to lua section for scene 2, And similar way the scenes 4,5,8

[sup]
local WE_DEV = 20 --add your temp device id here
local WE_SID = “urn:upnp-org:serviceId:TemperatureSensor1”
local Temp1 = luup.variable_get(WE_SID,“CurrentTemperature”,WE_DEV)
if (Temp1 > 24 ) then
return false – this will stop the scene
end
[/sup]

You can find the device ID from advanced tab of you device (Device # XX).
Hope you manage to get your pool pump automation working. :slight_smile: