Fredom wrote: ↑Wednesday 01 February 2023 20:50
anno wrote: ↑Wednesday 01 February 2023 15:31
Of course i already did that, not working, so i did seashed more and more, still nothing is working.....
I know i do something wrong, i don't know what and i can't find it.
Code: Select all
return
{
on =
{
devices = { 'Woonkamer keuken'}
},
execute = function(domoticz, roomSwitch)
if (roomSwitch.active and domoticz.devices('KeukenTM').temperature < 24.8) then
domoticz.devices('AWWoonkamer keuken').switchOn()
domoticz.notify('This rocks!',
'Turns out that it is getting warm here',
domoticz.PRIORITY_LOW)
end
end
}
Hi Anno,
I use the script below. With some adjustments according to your own needs.
Code: Select all
return
{
on =
{
devices =
{
'Humidity Garagekamer' --https://www.techpunt.nl/nl/xiaomi-aqara-temperatuur-en-vochtigheidssensor.html
}
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Ventilator wasdroger',
},
execute = function(dz, device)
local fan = dz.devices('Ventilator wasdroger') --
if ( device.temperature < 25 or device.humidity < 73 ) and fan.state == 'On' then
fan.switchOff().silent().repeatAfterSec(1, 2)
elseif ( device.temperature >= 25 or device.humidity >= 73 ) and fan.state == 'Off' then
fan.switchOn()
end
end
}
Yes, thanks, this did work,
Code: Select all
return
{
on =
{
devices =
{
'KeukenTM'
}
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Woonkamer keuken',
},
execute = function(dz, device)
local verdeler = dz.devices('Woonkamer keuken') --
if ( device.temperature > 24.8 ) and verdeler.state == 'On' then
verdeler.switchOff().silent().repeatAfterSec(1, 2)
elseif ( device.temperature < 24.5 ) and verdeler.state == 'Off' then
verdeler.switchOn()
end
end
}
I need to ask, why does you laundry dryer has a ventilator?
i think i can do a little more/better myself.
Code: Select all
--------------------------------------------------------------------------------------------------------------------------------
-- assumptions:
-- the setpoint is set by a dummy device (not a selector type)
local WP_SWITCH = 'Voorkamer zuid' -- switch device
local TEMP_SETPOINT = 'Thermostaat voorkamer zuid' -- selector dummy device
local TEMP_SENSOR_1 = 'Voorkamer zuidTM'
local BAT_THRESHOLD = 30
local LOGGING = true
return
{
on =
{
timer =
{
'every minute',
},
},
--LOG levell: This is the log level you want for this script. Can be domoticz.LOG_INFO, domoticz.LOG_MODULE_EXEC_INFO, domoticz.LOG_DEBUG or domoticz.LOG_ERROR
--marker: A string that is prefixed before each log message. That way you can easily create a filter in the Domoticz log to see just these messages.
logging =
{
level = LOGGING and domoticz.LOG_DEBUG or domoticz.LOG_ERROR,
--level = LOGGING and domoticz.LOG_ERROR,
marker = 'dzVents voorkamer zuid',
},
execute = function(dz)
-- collect all input data
local verdeler_switch_state = dz.devices(WP_SWITCH).state
local temp_1 = dz.devices(TEMP_SENSOR_1).temperature
local setpointValue = dz.devices(TEMP_SETPOINT).setPoint
-- info only on log level = LOG_DEBUG
dz.log('WP_SWITCH : ' .. verdeler_switch_state, dz.LOG_DEBUG)
dz.log('Temp_1 : ' .. temp_1, dz.LOG_DEBUG)
dz.log('Setpoint_value : ' .. setpointValue, dz.LOG_DEBUG)
-- now determine what to do
if (temp_1 >= setpointValue) then
dz.devices(WP_SWITCH).switchOff().silent()
dz.log('Target temperature reached, boiler off')
elseif (temp_1 <= (setpointValue -1)) then
dz.log('Average temperature more than 1 degree below setpointValue, switchOn during 10 minutes')
dz.devices(WP_SWITCH).switchOn().silent()
dz.devices(WP_SWITCH).switchOff().silent().afterMin(2)
elseif (temp_1 > (setpointValue -1)) then
dz.log('Average temperature less than 1 degree below setpointValue, switchOn during 5 minutes')
dz.devices(WP_SWITCH).switchOn().silent()
dz.devices(WP_SWITCH).switchOff().silent().afterMin(1)
end
end
}
Dzvents is really difficult to understand. Did find above code on the forum here, and did some modifications.