Howto, simple temperature that switch on / off device?

Moderator: leecollings

Post Reply
BarryT
Posts: 385
Joined: Tuesday 31 March 2015 22:06
Target OS: Linux
Domoticz version: 2024.3
Location: east netherlands
Contact:

Howto, simple temperature that switch on / off device?

Post by BarryT »

Hi,

can someone tell me a how to simple turn on or off a device by temperature?

Code: Select all

commandArray = {}

if (devicechanged['Temperatuur Buiten'] ~= nil then print("Temperatuur Buiten: " .. devicechanged['Temperatuur Buiten'] .. " WarmtepompBoiler:" .. otherdevices['WarmtepompBoiler'])
    
if (devicechanged['Temperatuur Buiten'] > 6 and otherdevices['WarmtepompBoiler'] == 'Off') then print("Buitentemperatuur boven 6 graden dus Boiler AAN na 5 minuten..") commandArray['WarmtepompBoiler'] == 'On'

elseif (devicechanged['Temperatuur Buiten'] < 6 and otherdevices['WarmtepompBoiler'] == 'On') then print("Buitentemperatuur onder 6 graden dus Boiler UIT..") commandArray['WarmtepompBoiler'] == 'Off'
end
end
return commandArray
does not work :(
User avatar
psubiaco
Posts: 233
Joined: Monday 20 August 2018 9:38
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Italy
Contact:

Re: Howto, simple temperature that switch on / off device?

Post by psubiaco »

Hi,
you have used == (comparison) instead of = (assignment) !!
You have to write commandArray["outputdevice"]="On"
Good luck
Paolo
--
I use DomBus modules to charge EV car, get a full alarm system, control heat pump, fire alarm detection, lights and much more. Video
Facebook page - Youtube channel
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest