The LUA/PHP part is works fine by itself. However, I also want to be able to get the setpoint value on a regular basis from the thermostat (separate script that pulls information from Tado every minute and updates devices if they've changed, but if I update the device it'll trigger running of the script again and likely end up in a never ending loop. Any suggestions?
Code as it stands:
Code: Select all
local tadosetpoint = 'Tado Setpoint'
commandArray = {}
if devicechanged[tadosetpoint] then
tadosetpoint_temp = tonumber(otherdevices_svalues[tadosetpoint])
if tadosetpoint_temp > 25 then
print('Tado Setpoint too HIGH - Out of permissible range')
elseif tadosetpoint_temp < 6 then
print('Tado Setpoint too LOW - Out of permissible range')
else
os.execute('php70 -f /volume1/web/heating/tado.php '..tadosetpoint_temp)
print('Tado Setpoint Change to: '..tadosetpoint_temp)
end
end
return commandArray