Page 1 of 1
The Itho CVE Eco has 3 values to use now!
Posted: Tuesday 04 December 2018 22:26
by BarryT
I have some news for all of the Itho CVE ECO RFT users:
If you have a (wireless) switch to power on or off the box, you have now 3 values to work with:
Power OFF = FAN OFF
Power ON = LOW FAN
Power OFF for 2 seconds and then Power ON again, will let the FAN goes to HIGH.
This is tested with 2 boxes, and works perfect.
I use a script that will trigger the box to LOW (value 1) when 10% humidty is going up in 10 seconds, and the box will go to HIGH (send OFF for 2 sec, then ON again) (value 2) if the humidity is going up to 20%+ in 30 seconds.
After that the box will go OFF if limited time is exceeded (30 minutes) or humidity is back to 5% of its starting point..
Try it out!
Re: The Itho CVE Eco has 3 values to use now!
Posted: Wednesday 05 December 2018 9:05
by Skippiemanz
Hi,
I'm not an owner of the CVE box but interested in you're script.
Willing to share?
Re: The Itho CVE Eco has 3 values to use now!
Posted: Wednesday 05 December 2018 11:36
by BarryT
Skippiemanz wrote: ↑Wednesday 05 December 2018 9:05
Hi,
I'm not an owner of the CVE box but interested in you're script.
Willing to share?
I will do in this week, very busy atm!
Re: The Itho CVE Eco has 3 values to use now!
Posted: Thursday 06 December 2018 0:07
by ErikAtSpijk
I have a zehner RFZ, which hopefuly is simulair to the ITHO RFT, hence I would certainly be intrested in how you connected it to domoticz.
Re: The Itho CVE Eco has 3 values to use now!
Posted: Friday 07 December 2018 20:12
by BarryT
See here:
viewtopic.php?t=4421&start=100
Code: Select all
-------------------------------------------------------------------------------
-- This script keeps track of the humidity in a bathroom and will active the
-- fan(s) when there was a rise in humidity within the first 5 minutes.
--
-- It is fully configurable by using the constantes below. It should not be
-- needed to change anything to the code itselfs.
--
-- It can be used for multiple bathrooms on one Domoticz server because
-- it uses 'variable' user variables blocks per bathroom. And it can be used
-- on small and large bathrooms. See SMALL_ROOM constante here below.
--
-- To set it up add the following user variables to your Domoticz:
-- * humCounter[SENSOR_NAME] (e.g.: humCounterBathroom)
-- * humidityTmin5[SENSOR_NAME]
-- * humidityTmin10[SENSOR_NAME]
-- * targetFanOffHumidity[SENSOR_NAME]
-- * fanMaxTimer[SENSOR_NAME]
-- * fanFollowsProgram[SENSOR_NAME]
--
-- Create one Lua - Time script per bathroom (e.g. 'house_fans', 'shower_fan')
-- Testing is done by setting the testHumidity[SENSOR_NAME] to a fake humidity value
-------------------------------------------------------------------------------
--
-- declare some constants and settings
--
-- true for little bath room, false for normal bathrooms
SMALL_ROOM = true
-- start the fans as soon as possible
DIRECT_START = false
if SMALL_ROOM then
-- small bathroom (like 2x2 meter)
-- time in minutes when a the script logic will happen
SAMPLE_INTERVAL = 5
-- rise in humidity needed for a bath that will trigger the fan
FAN_DELTA_TRIGGER = 2
-- rise in humidity needed for a shower that will trigger the second fan
FAN_DELTA_TRIGGER2 = 5
-- maximum amount of minutes the fan can be on, in case we never reach the target humidity
FAN_MAX_TIME = 15
-- ventilator goes off if target+offset is reached
TARGET_OFFSET = 3
-- exact device name of the switch turning on/off the ventilator 2 (itho fan box stand 1)
FAN_NAME = 'Ventilatorbox'
-- exact device name of the switch turning on/off the ventilator 2 (itho fan box stand 2)
--FAN_NAME = 'Ventilatorbox'
-- exact device name of the switch turning on/off the ventilator 3 (itho fan box stand 3)
FAN_NAME2 = 'Ventilatorbox'
-- exact device name of the humidity sensor
SENSOR_NAME = 'Vochtigheid Badkamer'
else
-- normal bathroom (like 4x4 meter)
-- time in minutes when a the script logic will happen
-- SAMPLE_INTERVAL = 5
-- rise in humidity needed for a bath that will trigger the fan
-- FAN_DELTA_TRIGGER = 3
-- rise in humidity needed for a shower that will trigger the second fan
--FAN_DELTA_TRIGGER2 = 5
-- maximum amount of minues the fans can be on, in case we never reach the target humidity
--FAN_MAX_TIME = 15
-- ventilator goes off if target+offset is reached
-- TARGET_OFFSET = 2
-- exact device name of the switch turning on/off the ventilator 2 (itho fan box stand 2)
--FAN_NAME = 'Ventilator max'
-- exact device name of the switch turning on/off the ventilator 2 (itho fan box stand 2)
--FAN_NAME = 'Ventilator medium'
-- exact device name of the switch turning on/off the ventilator 3 (itho fan box stand 3)
--FAN_NAME2 = 'Ventilator max'
-- exact device name of the humidity sensor
--SENSOR_NAME = 'Badkamer'
end
-------------------------------------------------------------------------------
-- No changes needed below this lines
-------------------------------------------------------------------------------
commandArray = {}
-- adding info to the log
function addMsg(txt)
if txt == '' or txt == nil then
return
end
if msg ~= '' then
msg = msg .. '\n'
end
msg = msg .. txt .. '. '
end
-- send a notification
function sendNotication(txt)
if txt == '' or txt == nil then
return
end
commandArray['SendNotification'] = txt
end
-- switch on a device (with retry)
function switchOn(device, msg)
if (otherdevices[device] == 'Off') then
commandArray[#commandArray+1] = {[device] = "On"}
-- just to be sure, wait 30s and try again
commandArray[#commandArray+1] = {[device] = "On AFTER 30"}
-- and again after 60s
commandArray[#commandArray+1] = {[device] = "On AFTER 60"}
if (msg ~= '') then
addMsg(msg)
end
end
end
-- switch off a device (with retry)
function switchOff(device, msg)
if otherdevices[device] == 'On' then
commandArray[#commandArray+1] = {[device] = "Off"}
-- just to be sure, wait 30s and try again
commandArray[#commandArray+1] = {[device] = "Off AFTER 30"}
-- and again after 60s
commandArray[#commandArray+1] = {[device] = "Off AFTER 60"}
if (msg ~= '') then
addMsg(msg)
end
end
end
TEST_MODE_HUMVAR = 'testHumidity' .. SENSOR_NAME -- fake humidity value, give it a test value in domoticz/uservars
PRINT_MODE = true -- when true wil print output to log and send notifications
-- get the global variables:
-- this script runs every minute, humCounter is used to create SAMPLE_INTERVAL periods
humCounter = tonumber(uservariables['humCounter' .. SENSOR_NAME])
humidityTmin5 = tonumber(uservariables['humidityTmin5' .. SENSOR_NAME]) -- youngest reading
humidityTmin10 = tonumber(uservariables['humidityTmin10' .. SENSOR_NAME]) -- oldest reading
targetFanOffHumidity = tonumber(uservariables['targetFanOffHumidity' .. SENSOR_NAME]) -- target humidity
fanMaxTimer = tonumber(uservariables['fanMaxTimer' .. SENSOR_NAME])
fanFollowsProgram = tonumber(uservariables['fanFollowsProgram' .. SENSOR_NAME]) -- marker indicating that the programm is runing for a bath
target = 0 -- will hold the target humidity when the program starts
msg = '' -- extra info to show in debug/print mode
-- get the current humidity value
if (tonumber(uservariables[TEST_MODE_HUMVAR]) > 0) then
current = tonumber(uservariables[TEST_MODE_HUMVAR])
else
current = otherdevices_humidity[SENSOR_NAME]
end
-- check if the sensor is on or has some weird reading
if (current == 0 or current == nil) then
print('Current humidity is 0 or nil. Skipping this reading')
return commandArray
end
if (fanFollowsProgram == 0 and DIRECT_START) then
humCounter = SAMPLE_INTERVAL
addMsg('Direct start is active')
else
-- increase cycle counter (one run per minute)
humCounter = humCounter + 1
end
-- start the checks after the sample interval was reached (or direct start was enabled)
if (humCounter >= SAMPLE_INTERVAL) then
if (humidityTmin5 == 0) then
-- initialization, assume this is the first time
humidityTmin5 = current
humidityTmin10 = current
end
humCounter = 0 -- reset the cycle counter
-- pick the lowest history value to calculate the delta
-- this also makes sure that two relative small deltas in the past 2*interval minutes are treated as one larger rise
-- and therefore will still trigger the ventilator
-- I don't want to use a longer interval instead because I want the ventilator to start as soon as possible
-- (so rather after 5 minutes instead of after 15 minutes because the mirrors in the bathroom become kinda useless ;-)
delta = current - math.min(humidityTmin10, humidityTmin5)
-- pick the lowest history value
target = math.min(humidityTmin10, humidityTmin5) + TARGET_OFFSET
-- shift the previous measurements
humidityTmin10 = humidityTmin5
-- and store the current
humidityTmin5 = current
-- either the fan is off or it is on but the decrease program has not started
-- in that latter case we start the program anyway. This could happen if someone turns on the ventilator
-- manually because he/she is about to take a shower and doesn't like damp mirrors.
-- I don't do this because the ventilator removes heat from the bathroom and I want this to happen
-- as late as possible ;-)
if (otherdevices[FAN_NAME] == 'Off' or (otherdevices[FAN_NAME] == 'On' and fanFollowsProgram == 0)) then
-- likely someone turned off the ventilator while the program was running
if (fanFollowsProgram == 1 and otherdevices[FAN_NAME] == 'Off') then
fanFollowsProgram = 0
end
-- see if we have to turn it on
if (delta >= FAN_DELTA_TRIGGER) or (delta >= FAN_DELTA_TRIGGER2) then
-- time to start the fan
switchOn(FAN_NAME, 'Rise in humidity, turning on the fan, delta ' .. delta)
-- we need to turn the second fan on for the shower (or large bath :)
if (delta >= FAN_DELTA_TRIGGER2) then
commandArray[#commandArray + 1] = {['FAN_NAME2'] ='Off' }
commandArray[#commandArray + 1] = {['FAN_NAME2'] ='On' }
commandArray[#commandArray + 1] = {['FAN_NAME2'] ='Off AFTER 4' }
commandArray[#commandArray + 1] = {['FAN_NAME2'] ='On AFTER 6' }
-- switchOn(FAN_NAME2, 'Large rise in humidity, turning on the second fan, delta ' .. delta)
end
targetFanOffHumidity = target
fanFollowsProgram = 1
-- set the safety stop
fanMaxTimer = math.floor(FAN_MAX_TIME / SAMPLE_INTERVAL) - 1
addMsg('Target humidity for switching off the fans: ' .. targetFanOffHumidity)
sendNotication(FAN_NAME .. ' fan is on#The fan is activated at humidity ' .. current .. ', targetHumidity ' .. targetFanOffHumidity .. ', delta ' .. delta .. '#0')
end
else
if (fanMaxTimer > 0) then
-- possible that someone started the fan manually
fanMaxTimer = fanMaxTimer - 1
end
if (fanFollowsProgram == 1) then -- not manually started
-- ok, there is another FAN_DELTA_TRIGGER rise in humidity
-- when this happen we reset the fanMaxTimer to a new count down
-- because we have to ventilate a bit longer (and faster) due to the extra humidity
if (delta >= FAN_DELTA_TRIGGER) then
addMsg('Another large increase detected, resetting max timer, delta: ' .. delta)
fanMaxTimer = math.floor(FAN_MAX_TIME / SAMPLE_INTERVAL) - 1
-- and start the second fan
switchOff(FAN_NAME2)
end
-- if humidity delta decrease is more then second trigger we can
-- switch off the second fan
if (delta < -FAN_DELTA_TRIGGER2) then
switchOff(FAN_NAME2)
end
-- first see if it can be turned off
if (current <= targetFanOffHumidity or fanMaxTimer == 0) then
if (otherdevices[FAN_NAME2] == 'On') then
addMsg('The fans are deactivated at humidity ' .. current)
else
addMsg('The fan is deactivated at humidity ' .. current)
end
switchOff(FAN_NAME)
switchOff(FAN_NAME2)
if (fanMaxTimer == 0 and current > targetFanOffHumidity) then
addMsg(', target humidity ' .. targetFanOffHumidity ..
' not reached. Safety time-out activated (' .. FAN_MAX_TIME .. '-' .. FAN_MAX_TIME + SAMPLE_INTERVAL .. ' min)')
else
addMsg(', target humidity ' .. targetFanOffHumidity .. ' reached')
end
targetFanOffHumidity = 0
fanMaxTimer = 0
fanFollowsProgram = 0
-- reset history in this case.. we start all over
-- Tmin10 is still in the 'ventilator=On'-zone
humidityTmin10 = humidityTmin5
if PRINT_MODE == true then
sendNotication(FAN_NAME .. ' fan is off#' .. msg .. '#0')
end
else
-- we haven't reached the target yet
addMsg('Humidity delta: ' .. delta)
end
end
end
if PRINT_MODE == true then
print('---')
print('Checking humidity in ' .. SENSOR_NAME .. '...')
print('Current humidity : ' .. current)
print('humidityTmin5 : ' .. humidityTmin5)
print('humidityTmin10 : ' .. humidityTmin10)
print('fanMaxTimer : ' .. fanMaxTimer)
print('humCounter : ' .. humCounter)
print('targetFanOffHumidity : ' .. targetFanOffHumidity)
print('fanFollowsProgram : ' .. fanFollowsProgram)
print('fan 1 : ' .. FAN_NAME .. ' = ' .. otherdevices[FAN_NAME])
--print('fan 2 : ' .. FAN_NAME2 .. ' = ' .. otherdevices[FAN_NAME2])
if msg ~= '' then
print('Extra info\n---\n' .. msg .. '\n---')
end
end
end
-- save the globals
commandArray['Variable:humCounter' .. SENSOR_NAME] = tostring(humCounter)
commandArray['Variable:humidityTmin5' .. SENSOR_NAME] = tostring(humidityTmin5)
commandArray['Variable:humidityTmin10' .. SENSOR_NAME] = tostring(humidityTmin10)
commandArray['Variable:targetFanOffHumidity' .. SENSOR_NAME] = tostring(targetFanOffHumidity)
commandArray['Variable:fanMaxTimer' .. SENSOR_NAME] = tostring(fanMaxTimer)
commandArray['Variable:fanFollowsProgram' .. SENSOR_NAME] = tostring(fanFollowsProgram)
return commandArray
Re: The Itho CVE Eco has 3 values to use now!
Posted: Friday 07 December 2018 20:30
by BarryT
ErikAtSpijk wrote: ↑Thursday 06 December 2018 0:07
I have a zehner RFZ, which hopefuly is simulair to the ITHO RFT, hence I would certainly be intrested in how you connected it to domoticz.
I dont use the RFT buttons, none of them.
I just made a (433) on/off switch in the box, what can power on or power off the box.
So, if you switch the box to ON, then OFF for 2 seconds and turning ON again it is going to high.
Just use this script, and it works full automatic