Negative temp value in Blockly

Moderator: leecollings

Post Reply
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Negative temp value in Blockly

Post by Treve »

The thermostat of the freezer is defective, I thought to solve this temporarily with a simple blockly. It seems that no negative values ​​are possible.
Can someone clarify and possibly offer me a solution.
Blockly negative temp.jpg
Blockly negative temp.jpg (20.03 KiB) Viewed 1141 times
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
willemd
Posts: 621
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Negative temp value in Blockly

Post by willemd »

Switch to DzVents, it is so much more powerful, although a small learning curve .....
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Re: Negative temp value in Blockly

Post by Treve »

Since I need a working script in the short term and have no time to learn myself into DZVentz.
I found a script from the late 'Waaren',

return {
on = { timer = { 'every minute' } },

execute = function(domoticz)
local Sensor = domoticz.devices('Omnik temperature')
if Sensor.temperature >= 25 then
domoticz.devices('Omnik Ventilator').switchOn()
end
end
}

and adapted it without any knowledge.

return {
on = { timer = { 'every minute' } },

execute = function(domoticz)
local Sensor = domoticz.devices('Vriezer')
if Sensor.temperature <= -16 then
domoticz.devices('Switch 7 Vriezer').switchOn()
elseif Sensor.temperature >= -18 then
domoticz.devices('Switch 7 Vriezer').switchOff()
end
end
}

Can this script work?
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
plugge

Re: Negative temp value in Blockly

Post by plugge »

You have to change:
if Sensor.temperature <= -16 then
in: if Sensor.temperature >= -16 then
and
elseif Sensor.temperature >= -18 then
in: elseif Sensor.temperature <= -18 then

Remember these are negative values.
If the script iteself works for you? Try it!
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Re: Negative temp value in Blockly

Post by Treve »

return {
on = { timer = { 'every minute' } },

execute = function(domoticz)
local Sensor = domoticz.devices('testtemp')
if Sensor.temperature <= 22 then
domoticz.devices('Lidl On/Off plug 4').switchOn()
elseif Sensor.temperature >= 24 then
domoticz.devices('Lidl On/Off plug 4').switchOff()
end
end
}


I created a test environment with positive temperatures, the switch turns On below 22' and Off above 24'.
Conclusion is, the script works.
Now investigate whether it also works with negative (freezing) values, or can anybody tells me if it will?
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Re: Negative temp value in Blockly

Post by Treve »

return {
on = { timer = { 'every minute' } },

execute = function(domoticz)
local Sensor = domoticz.devices('Vriezer')
if Sensor.temperature >= -18 then
domoticz.devices('Switch 7 Vriezer').switchOn()
elseif Sensor.temperature <= -19 then
domoticz.devices('Switch 7 Vriezer').switchOff()
end
end
}

This did the trick.
good find for someone who has never dealt with dzvents until this morning.
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests