Hi all, new to vera, having difficulty understanding the syntax on the Lua scripting.
I have my bathroom fan turn on if the humidity is past a certain point and turn of when it get below a certain point. I would like to script in if the switch get turned off before it gets to the low set point, vera will turn the switch back on.
Here is what I have that is not working that I was going to trigger on the fan being turned off:
local HumSes = 36 -->Humidity Sensor ID
local Switch = 43 → Fan Switch to turn on if to high
HUM_SID = “urn:schemas-micasaverde-com:device:HumiditySensor:1”
local BathHumid = luup.variable_get( HUM_SID, “CurrentLevel”, HumSes)
Call =‘urn:upnp-org:serviceId:SwitchPower1’;Do =‘SetTarget’
if (BathHumid >= 43) then
luup.call_action(Call,Do,{newTargetValue=1},Switch)
end
Any help is appreciated…
Thanks