Page 1 of 1

Set Away Thermostat when no motion detected

Posted: Saturday 03 February 2018 15:32
by warmaniac
Hello there,

can somebody help me please with script for Netatmo Thermostat?
I want to set Away Thermostat switch to ON when is no movenment detected on my two xiaomi motion sensors for e.g. 2-3 hrs , is it possible ? When the motion is detected on one of them, then set Away thermostat switch to OFF position .

if somebody helps me it would be great ! I added pictures for better understanding which sensors I want to use.

Image
Image


Thank you a lot ! :mrgreen:

Re: Set Away Thermostat when no motion detected

Posted: Monday 05 February 2018 12:03
by emme
you can set it easly with dzVents:

Code: Select all

return {

    on = {
	   timer = { 'every minutes'}
	},
    },
	execute = function(dz)
		if (dz.devices('Pohybové Chodba').lastUpdate.minutesAgo > 120) and (dz.devices('Pohybové Obyvacka').lastUpdate.minutesAgo > 120) then
			dz.devices('Away Termostat').switchOff().checkFirst()
		end 
	end
}