Ventilation & humidity switch...can't get it to work.

Post Reply
andyk
Posts: 12
Joined: Friday 25 November 2016 0:03
Target OS: Raspberry Pi
Domoticz version: 3.9527
Location: Germany
Contact:

Ventilation & humidity switch...can't get it to work.

Post by andyk » Sunday 02 September 2018 17:15

Hi all,


EDIT: Forgot to mention, the Humidity sensor is an Aeon Labs Multi 6 sensor. I am running Domoticz on a Pi, version v3.9527

In my bathroom, I have a fan, connected to a Fibaro FGS223 Double Relay. On the dashboard of Domoticz, I can switch the fan on and off.
However, I would like automate this, by creating an event which switches the fan on when a certain humidity level is reached/exceeded. So,
I created an event:
The attachment TempHumEvent.JPG is no longer available
However, nothing happens. The fan is not switched on (regular humidity levels are above 50 percent, so I would expect that this event switches on the fan pretty quickly). I tried to replace the "level(%) value" with just "value", but that doesn't make a difference.

However, when I look at the values in the devices overview, it shows temperature and humidity:
TempHumEvent.JPG
TempHumEvent.JPG (20.71 KiB) Viewed 386 times
Is that the problem ? Is there a way to isolate the humidity value ?
Or am I using the wrong blocks in my Blockly event script ?

Any help is appreciated...

Droll
Posts: 8
Joined: Monday 29 December 2014 0:50
Target OS: Linux
Domoticz version: 3.9202
Location: Norway
Contact:

Re: Ventilation & humidity switch...can't get it to work.

Post by Droll » Monday 03 September 2018 17:26

Image

This is a blocky I used, worked fine....
Try to remove the level bit..

One quick tip ...click on "Show current states" here you can see the pure value on the sensor you want to use ...


Arne Kjetil
Attachments
blocky_bad.jpg
blocky_bad.jpg (114.09 KiB) Viewed 358 times

andyk
Posts: 12
Joined: Friday 25 November 2016 0:03
Target OS: Raspberry Pi
Domoticz version: 3.9527
Location: Germany
Contact:

Re: Ventilation & humidity switch...can't get it to work.

Post by andyk » Tuesday 04 September 2018 17:17

Hi Arne,

thanks for the info. I removed the level logic, but still nothing happens. Manually, it works. However, when i click 'show current states', it shows temperature and humidity as values. Might that be the problem ? That the values are not equal ?

andyk
Posts: 12
Joined: Friday 25 November 2016 0:03
Target OS: Raspberry Pi
Domoticz version: 3.9527
Location: Germany
Contact:

Re: Ventilation & humidity switch...can't get it to work.

Post by andyk » Tuesday 04 September 2018 22:44

Apparantly I was too impatient. After removing the level logic like you said, the fan automatically was switched on after a while. So it works now.
But, the fan is not very strong and it took hours to get from 65% to 60%. So I guess I need a better fan.

Anyway, the blocky script works :D

SiskoBen
Posts: 1
Joined: Wednesday 05 September 2018 9:21
Target OS: Raspberry Pi
Domoticz version: 4.9954
Contact:

Re: Ventilation & humidity switch...can't get it to work.

Post by SiskoBen » Wednesday 05 September 2018 9:55

Hi,

I have almost the same setup and couldn't get it to work as i wanted using blocky and switched to dzVents which is (in my opinion) much more powerfull and a lot less of a guessing game than Blocky scripts.

I've got a Humidity sensor, an Aeon Labs Multi 6 sensor (known as "TempHum" in Domoticz)
I've got a Fibaro FGS223 Double Relay (known as "Ventilatie-Q1" and "Ventilatie-Q2" in Domoticz) controlling a 3-position switch for ventilation (actually a warmth recovery device "Ecolution" that uses the heat in the extracted air to preheat radiator water) Setting 1 is lowest, setting 3 is highest.

I have the following user variables defined:
'Ventilatie-HumTriggerOn' this is an integer that hold the percentage value at which the ventilation is put into the highest setting (75%)
'Ventilatie-HumTriggerOff' this is an integer that holds the percentage value at which the ventilation is put into the medium setting (55%),
'Ventilatie-Setting' this is an integer that holds the most recent setting

Since the manual 3-position switch is also connected to the FGS223 the real actual setting of the ventilation system is sort of unkown that is why i force a known state when switching by going via the setting 1 (Domoticz will not send a on or off command if it thinks the switch is already in the requested position)

The system works for almost a year now like this and the only slight issue i have found is that when overall humidity is high (for example on a very rainy/humid/warm day) the humidity will not drop below the 'triggerOff' level and stay on. I have a manual way to deal with this it is to go into Domoticz user variables and manually set the 'triggerOff' to a higher level (and once the script switches off the high setting restore the 'triggerOff' value)

Anyway here is my dzVents script for the bathroom ventilation (slightly anonymized to remove actual e-mail addresses).

Code: Select all

-- Check the wiki for dzVents
-- remove what you don't need
return {

	-- optional active section,
	-- when left out the script is active
	-- note that you still have to check this script
	-- as active in the side panel
	active = {

		true
	},
	-- trigger
	-- can be a combination:
	on = {

		-- device triggers
		devices = {
			-- scripts is executed if the device that was updated matches with one of these triggers
			'TempHum',
		},

		-- timer riggers
		timer = {
			-- timer triggers.. if one matches with the current time then the script is executed
			'every minute',
		},

		-- user variable triggers
		variables = {
            'Ventilatie-HumTriggerOn',
            'Ventilatie-HumTriggerOff',
			'Ventilatie-Setting',
		},

	},

	-- custom logging level for this script
	logging = {
        level = domoticz.LOG_DEBUG, -- domoticz.LOG_INFO, domoticz.LOG_DEBUG, domoticz.LOG_ERROR or domoticz.LOG_FORCE
        marker = "dzV_BadkamerHumVentilatie"
    },

	-- actual event code
	-- the second parameter is depending on the trigger
	-- when it is a device change, the second parameter is the device object
	-- similar for variables, scenes and groups and httpResponses
	-- inspect the type like: triggeredItem.isDevice
	execute = function(domoticz, triggeredItem, info)
		--[[

		The domoticz object holds all information about your Domoticz system. E.g.:

		local myDevice = domoticz.devices('myDevice')
		local myVariable = domoticz.variables('myUserVariable')
		local myGroup = domoticz.groups('myGroup')
		local myScene = domoticz.scenes('myScene')

		The device object is the device that was triggered due to the device in the 'on' section above.
		]] --

domoticz.log(tostring(domoticz.devices('TempHum').humidity),domoticz.LOG_DEBUG)

        -- BadkamerHumVentilatie aan
        if ((domoticz.devices('TempHum').humidity > domoticz.variables('Ventilatie-HumTriggerOn').value) and (domoticz.variables('Ventilatie-Setting').value ~= 3)) then
            domoticz.log("humidity > trigger and Setting ~= 3",domoticz.LOG_DEBUG)
            domoticz.email('Humidity > Trigger', 'Ventilatie naar stand 3 want vochtigheid van ' .. domoticz.devices('TempHum').humidity .. '% is groter dan limiet van ' .. domoticz.variables('Ventilatie-HumTriggerOn').value .. '%', 'youremail@gmail.com')
            domoticz.devices('Ventilatie-Q1').switchOff()
            domoticz.devices('Ventilatie-Q2').switchOff()
            domoticz.log("Ventilatie stand 1 ; Q1 = off ; Q2 = off",domoticz.LOG_DEBUG)
            domoticz.devices('Ventilatie-Q1').switchOff()
            domoticz.devices('Ventilatie-Q2').switchOn()
            domoticz.variables('Ventilatie-Setting').set(3)
            domoticz.log("Ventilatie stand 3 ; Q1 = off ; Q2 = on",domoticz.LOG_DEBUG)
        end
        
        -- BadkamerHumVentilatie aan bevestiging
        if ((domoticz.devices('TempHum').humidity > domoticz.variables('Ventilatie-HumTriggerOn').value) and (domoticz.variables('Ventilatie-Setting').value == 3)) then
            domoticz.log("humidity > trigger and Setting == 3",domoticz.LOG_DEBUG)
            domoticz.devices('Ventilatie-Q1').switchOff()
            domoticz.devices('Ventilatie-Q2').switchOn()
        end
        

        -- BadkamerHumVentilatie uit
        if ((domoticz.devices('TempHum').humidity < domoticz.variables('Ventilatie-HumTriggerOff').value) and (domoticz.variables('Ventilatie-Setting').value ~= 2)) then
            domoticz.log("humidity < trigger and Setting ~= 2",domoticz.LOG_DEBUG)
            domoticz.email('Humidity < Trigger', 'Ventilatie naar stand 2 want vochtigheid van ' .. domoticz.devices('TempHum').humidity .. '% is kleiner dan limiet van ' .. domoticz.variables('Ventilatie-HumTriggerOff').value .. '%', 'youremail@gmail.com')
            domoticz.devices('Ventilatie-Q1').switchOff()
            domoticz.devices('Ventilatie-Q2').switchOff()
            domoticz.log("Ventilatie stand 1 ; Q1 = off ; Q2 = off",domoticz.LOG_DEBUG)
            domoticz.devices('Ventilatie-Q1').switchOn()
            domoticz.devices('Ventilatie-Q2').switchOff()
            domoticz.variables('Ventilatie-Setting').set(2)
            domoticz.log("Ventilatie stand 2 ; Q1 = on ; Q2 = off",domoticz.LOG_DEBUG)
        end

        -- BadkamerHumVentilatie uit bevestiging
        if ((domoticz.devices('TempHum').humidity < domoticz.variables('Ventilatie-HumTriggerOff').value) and (domoticz.variables('Ventilatie-Setting').value == 2)) then
            domoticz.log("humidity < trigger and Setting == 2",domoticz.LOG_DEBUG)
            domoticz.devices('Ventilatie-Q1').switchOn()
            domoticz.devices('Ventilatie-Q2').switchOff()
        end


end
}

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest