Humidistat script
Moderator: leecollings
-
- Posts: 22
- Joined: Tuesday 07 February 2017 21:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Humidistat script
Hi,
I want to replace the humidistat control on my Furness with a z-wave controlled switch by reading the humidity from my z-wave thermostat and turning a switch "on" if the humidity drops below 45%.
My thermostat is a Honeywell Honeywell Lyric T6 Pro Zwave Plus Thermostat. I get to see the Humidity under the Temperature tab.
The issue I have is how to Index and read the value of the Humidity in a DZvents script?
Also, I'd like to add some logic that the script will detect the mode to be "Heat" and the Fan is on "Auto".
Thank you,
AlleyCat
I want to replace the humidistat control on my Furness with a z-wave controlled switch by reading the humidity from my z-wave thermostat and turning a switch "on" if the humidity drops below 45%.
My thermostat is a Honeywell Honeywell Lyric T6 Pro Zwave Plus Thermostat. I get to see the Humidity under the Temperature tab.
The issue I have is how to Index and read the value of the Humidity in a DZvents script?
Also, I'd like to add some logic that the script will detect the mode to be "Heat" and the Fan is on "Auto".
Thank you,
AlleyCat
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Humidistat script
Script below is only the basic part. For the other stuff you will have to explain what device types / sub types the thermostat and fan are in the domoticz devices tab.
Code: Select all
return
{
on =
{
devices =
{
206, -- change to idx number of your temperature / humidity sensor
},
},
logging =
{
level = domoticz.LOG_DEBUG
},
execute = function(dz, item)
_G.logMarker = _G.moduleLabel
local switch = dz.devices(204) -- change to idx number of your switch
dz.log('Device ' .. item.name .. '; temp ' .. item.temperature .. '° C, humidity: ' .. item.humidity ..'%' , dz.LOG_DEBUG)
if item.humidity < 45 then
switch.switchOn().checkFirst()
elseif item.humidity > 50 then
switch.switchOff().checkFirst()
end
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 22
- Joined: Tuesday 07 February 2017 21:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Humidistat script
Thank you. The basic script works like a charm.
The Idx for the Humidity is 126.
The second test is on device Idx 119, which is the Thermostat mode = "Heat"
This way the humidifier will be off in Cool or Off modes.
The Idx for the Humidity is 126.
The second test is on device Idx 119, which is the Thermostat mode = "Heat"
This way the humidifier will be off in Cool or Off modes.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Humidistat script
Small problem that I cannot create this Thermostat mode device type as virtual device on my system. So you will have to show me the complete output of the script below (> 100 lines per dump() so probably need to log to a logfile) also the output of line below from your webbrowser might be helpful.
Code: Select all
<domoticz ip:domoticz_port>/json.htm?type=devices&rid=119
Code: Select all
return
{
on =
{
devices =
{
126, -- change to idx number of your temperature / humidity sensor
},
},
logging =
{
level = domoticz.LOG_DEBUG
},
execute = function(dz, item)
_G.logMarker = _G.moduleLabel
local switch = dz.devices(204) -- change to idx number of your switch
dz.log('Device ' .. item.name .. '; temp ' .. item.temperature .. '° C, humidity: ' .. item.humidity ..'%' , dz.LOG_DEBUG)
if item.humidity < 45 then
switch.switchOn().checkFirst()
elseif item.humidity > 50 then
switch.switchOff().checkFirst()
end
dz.devices(120).dump()
dz.devices(119).dump()
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 22
- Joined: Tuesday 07 February 2017 21:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Humidistat script
Here is the browser output:
- Spoiler: show
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Humidistat script
Stil kind of guessing without having the dumps but maybe this will do it. If not then I really need to see the logs with the dumps
Code: Select all
return
{
on =
{
devices =
{
126, -- change to idx number of your temperature / humidity sensor
119,
},
},
logging =
{
level = domoticz.LOG_DEBUG
},
execute = function(dz, item)
_G.logMarker = _G.moduleLabel
local thermostat = dz.devices(119) -- Change to actual id's
local temperatureHumidity = dz.devices(126)
local switch = dz.devices(204)
dz.log('Device ' .. temperatureHumidity.name .. '; temp: ' .. temperatureHumidity.temperature .. '° C, humidity: ' .. temperatureHumidity.humidity ..'%' , dz.LOG_DEBUG)
dz.log('Device ' .. thermostat.name .. '; state: ' .. thermostat.state , dz.LOG_DEBUG)
if temperatureHumidity.humidity < 45 then
switch.switchOn().checkFirst()
elseif temperatureHumidity.humidity > 50 or thermostat.rawData[1] == 'Cool' or thermostat.rawData[1] == 'Off' then
switch.switchOff().checkFirst()
end
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 22
- Joined: Tuesday 07 February 2017 21:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Humidistat script
Sorry for the delay in posting the log. Please find the log below.
I want to activate the water shut-off valve only when the heating is on. Is there a way to test if the Heating is on?
Here are suggestions for a workaround in case we can't return if the Heating is on.
1) Is the Fan on? When the Thermostat Fan mode is set to Auto, the fan will work only if the Heating is on.
2) Perhaps we can test if the Temperature in the house is below the Thermostat settings.
Thank you very much.
I want to activate the water shut-off valve only when the heating is on. Is there a way to test if the Heating is on?
Here are suggestions for a workaround in case we can't return if the Heating is on.
1) Is the Fan on? When the Thermostat Fan mode is set to Auto, the fan will work only if the Heating is on.
2) Perhaps we can test if the Temperature in the house is below the Thermostat settings.
Thank you very much.
- Spoiler: show
-
- Posts: 22
- Joined: Tuesday 07 February 2017 21:19
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Humidistat script
Hi,
I want to add to the switch.switchOn().checkFirst() additional command to switch the fan mode to "1" = "On Low".
According to the the dump log, there are the following fan modes:
modes: 0;Auto Low;1;On Low;6;Circulat
How can I set the fan mode to 1 "On Low"?
Thanks,
AlleyCat
I want to add to the switch.switchOn().checkFirst() additional command to switch the fan mode to "1" = "On Low".
According to the the dump log, there are the following fan modes:
modes: 0;Auto Low;1;On Low;6;Circulat
How can I set the fan mode to 1 "On Low"?
Thanks,
AlleyCat
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Humidistat script
I have send you a DM on Tuesday 24 December 2019 at 7:19AlleyCat wrote: ↑Thursday 26 December 2019 22:35 Hi,
I want to add to the switch.switchOn().checkFirst() additional command to switch the fan mode to "1" = "On Low".
According to the the dump log, there are the following fan modes:
modes: 0;Auto Low;1;On Low;6;Circulat
How can I set the fan mode to 1 "On Low"?
Thanks,
AlleyCat
Please have a look and reply there . Thx
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: Google [Bot] and 1 guest