Ik schakel mijn ventilatie op basis van luchtvochtigheid. En hij vergelijkt deze luchtvochtigheid met twee andere sensoren op dezelfde verdieping (wat anderen ook al doen zie ik in dit topic)..
return {
on = {
timer = {
'every minute' -- Runs every minute
},
devices = {
'Humidity-Badkamer', -- Replace with the name of your sensor A
'Humidity-Studeer', -- Replace with the name of your sensor B
'Humidity-Slaapkamer' -- Replace with the name of your sensor C
}
},
execute = function(domoticz, trigger)
local sensorA = domoticz.devices('Humidity-Badkamer') -- Replace with the name of your sensor A
local sensorB = domoticz.devices('Humidity-Studeer') -- Replace with the name of your sensor B
local sensorC = domoticz.devices('Humidity-Slaapkamer') -- Replace with the name of your sensor C
local targetSwitch = domoticz.devices('MV-Aan-Uit') -- Replace with the name of your switch (not used right now, we set the dimmer straigh away, see below)
local targetSwitch2 = domoticz.devices('FAN-speed') -- Replace with the name of your dimmer
-- Check if the last update of A is more than one hour ago
if sensorA.lastUpdate.secondsAgo> 3600 then
domoticz.log("Humidity sensor A has not been updated in the last hour. Exiting script.", domoticz.LOG_ERROR)
return
end
-- Check if the last update of B is more than one hour ago
if sensorB.lastUpdate.secondsAgo> 3600 then
domoticz.log("Humidity sensor B has not been updated in the last hour. Exiting script.", domoticz.LOG_ERROR)
return
end
-- Check if the last update of C is more than one hour ago
if sensorC.lastUpdate.secondsAgo> 3600 then
domoticz.log("Humidity sensor C has not been updated in the last hour. Exiting script.", domoticz.LOG_ERROR)
return
end
local humidityA = sensorA.humidity
local humidityB = sensorB.humidity
local humidityC = sensorC.humidity
-- Calculate the average humidity of sensors B and C
local averageBC = (humidityB + humidityC) / 2
local diff1 = (humidityA - averageBC)
-- Log humidity values
domoticz.log("Humidity A (Badkamer): " .. humidityA, domoticz.LOG_INFO)
domoticz.log("Humidity B (Studeer): " .. humidityB, domoticz.LOG_INFO)
domoticz.log("Humidity C (Slaapkamer): " .. humidityC, domoticz.LOG_INFO)
domoticz.log("Average humidity of B and C: " .. averageBC, domoticz.LOG_INFO)
domoticz.log("Difference between Badkamer and average B&C : " .. diff1, domoticz.LOG_INFO)
domoticz.log("If humidity of A is 10 higher then average B&C, fan will switch to lvl3")
domoticz.log("If humidity of A is 7 higher then average B&C, fan will switch to lvl2")
-- Set level of dimmer based on difference with other roooms
if humidityA >= averageBC + 10 then
targetSwitch2.dimTo(3)
domoticz.log("Humidity FANX to lvl3, average humidity bathroom is 10 higher then average B&C", domoticz.LOG_INFO)
return
end
if humidityA >= averageBC + 7 then
targetSwitch2.dimTo(2)
domoticz.log("Humidity FANX to lvl2, average humidity bathroom is 7 higher then average B&C", domoticz.LOG_INFO)
return
end
if humidityA >= averageBC then
targetSwitch2.dimTo(1)
domoticz.log("Humidity FANX to lvl1, average humidity bathroom comparable with other rooms", domoticz.LOG_INFO)
return
end
if humidityA <= averageBC then
targetSwitch2.dimTo(1)
domoticz.log("Humidity FANX to lvl1, average humidity bathroom comparable with other rooms", domoticz.LOG_INFO)
return
end
end
}Ik meet de boel met een 3-tal Aqara sensoren en mijn automation systeem is Domoticz.
Mechanische ventilatie is een Orcon MVS-15R met afstandsbediening (MV heeft zelf geen slimmigheden of sensoren). De afstandsbediening hebt ik gecloned naar
FanX RF USB Dongle zodat ik in Domoticz de Orcon kon aansturen.
Ik heb specifiek gekozen voor een MV zonder eigen sensoren, dat kan allemaal weer kapot ook en er zijn zelfs gevallen bekend waarbij de MV niet meer werk ALLEEN maar omdat een sensor kapot is.
Nog een toevoeging;
Denk naast automation ook na over media!!! Ik heb een tweetal marine speakers ingebouwd in het verlaagde plafond. Vanaf daar lopen er gewoon speaker kabels (door een gat in het betonplafond) naar zolder.. Daar hangt een T-amp en een Airport Express (airplay).. Maar je kan vanalles verzinnen. Ik ben nog steeds blij met deze oplossing en ik ben ook blij dat ik zaken uit elkaar getrokken heb.. Een speaker in een spiegel is leuk maar vervang je minder snel (bijvoorbeeld)...
[
Voor 6% gewijzigd door
FreakNL op 20-08-2026 09:55
]