Set Away Thermostat when no motion detected

Moderator: leecollings

Post Reply
warmaniac
Posts: 24
Joined: Wednesday 12 April 2017 15:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Set Away Thermostat when no motion detected

Post 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:
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: Set Away Thermostat when no motion detected

Post 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
}
The most dangerous phrase in any language is:
"We always done this way"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest