Uncertain how to check temperatures in blockly

Moderator: leecollings

Post Reply
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Uncertain how to check temperatures in blockly

Post by FearNaBoinne »

First I tried numbers:
Image
Then I tried strings:
Image

But in both cases the temperature is apparently simultaneously above and below 25ºC!
Image

Only thing I haven't tried yet is compare to another sensor, but that'd be silly!
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Uncertain how to check temperatures in blockly

Post by waaren »

FearNaBoinne wrote: Sunday 07 July 2019 20:53 First I tried numbers:
Then I tried strings:
But in both cases the temperature is apparently simultaneously above and below 25ºC!
Number should work. Suggest to first test without time and with just a logmessage. If that works add time condition and last step is to add message to notification subsystem.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: Uncertain how to check temperatures in blockly

Post by FearNaBoinne »

waaren wrote: Sunday 07 July 2019 21:18
FearNaBoinne wrote: Sunday 07 July 2019 20:53 First I tried numbers:
Then I tried strings:
But in both cases the temperature is apparently simultaneously above and below 25ºC!
Number should work. Suggest to first test without time and with just a logmessage. If that works add time condition and last step is to add message to notification subsystem.
Suggest to first test without time
Without the time I have to wait for it to change, which happens once a day at most, not a valid solution...
and with just a logmessage. If that works add time condition and last step is to add message to notification subsystem.
Log or notification makes no difference.
Number should work.
As you can see, the system *does* see the correct value (17, {{temperaturedevice[360]}}=="Max Today"), but comparing it to a value doesn't work.

Blockly is a great concept, but the execution is terribly buggy...
I've got 16 event scripts (and counting), including this one, and only got ONE Blockly concept to work, all others I had to (reluctantly) go to LUA/dzEvents scripts, because Blockly just doesn't work...
I'll go redo redid this in dzEvents, because I really do not want to waste more time on this, when I can get this working in dzEvents in 2-3 minutes!
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Uncertain how to check temperatures in blockly

Post by waaren »

FearNaBoinne wrote: Sunday 07 July 2019 22:52
Suggest to first test without time
Without the time I have to wait for it to change, which happens once a day at most, not a valid solution...
Just tested and with a differently placed time condition the Blockly solution works.
temp check Blockly
temp check Blockly
tempcheck.png (101.21 KiB) Viewed 1567 times

Code: Select all

2019-07-08 00:57:00.496  Status: Time > 00:50 and temperature <  60  -- Time triggered
2019-07-08 00:57:00.497  Status: 21.4;45;1

2019-07-08 00:57:38.411  (Aeotec  Zwave stick) Temp + Humidity (Badkamer (Zwave)) -- device triggered
2019-07-08 00:57:38.696  Status: Time > 00:50 and temperature <  60
2019-07-08 00:57:38.696  Status: 21.4;45;1

2019-07-08 00:58:00.528  Status: Time > 00:50 and temperature <  60     -- time triggered
2019-07-08 00:58:00.528  Status: 21.4;45;1
I'll redid this in dzVents, because I really do not want to waste more time on this, when I can get this working in dzVents in 2-3 minutes!
Fully agree but for some domoticz users without any previous programming experience, the learning curve for Lua / dzVents / PHP / Python might scare them a bit.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: Uncertain how to check temperatures in blockly

Post by FearNaBoinne »

waaren wrote: Monday 08 July 2019 1:07 Just tested and with a differently placed time condition the Blockly solution works.

tempcheck.png

Code: Select all

2019-07-08 00:57:00.496  Status: Time > 00:50 and temperature <  60  -- Time triggered
2019-07-08 00:57:00.497  Status: 21.4;45;1

2019-07-08 00:57:38.411  (Aeotec  Zwave stick) Temp + Humidity (Badkamer (Zwave)) -- device triggered
2019-07-08 00:57:38.696  Status: Time > 00:50 and temperature <  60
2019-07-08 00:57:38.696  Status: 21.4;45;1

2019-07-08 00:58:00.528  Status: Time > 00:50 and temperature <  60     -- time triggered
2019-07-08 00:58:00.528  Status: 21.4;45;1
I'll try this, just for testing, but the other way *should* work as well!
waaren wrote: Monday 08 July 2019 1:07
I'll redid this in dzVents, because I really do not want to waste more time on this, when I can get this working in dzVents in 2-3 minutes!
Fully agree but for some domoticz users without any previous programming experience, the learning curve for Lua / dzVents / PHP / Python might scare them a bit.
That's why I think it is a great concept, and why I keep trying it... mostly unsuccesfully...
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: Uncertain how to check temperatures in blockly

Post by FearNaBoinne »

FearNaBoinne wrote: Monday 08 July 2019 8:34 That's why I think it is a great concept, and why I keep trying it... mostly unsuccesfully...
Quick update: Yes, the other way works for me as well... But nested IFs should work as well, esp. as it reduces the number of tests*... It looks that's where it broke... It just executed everything inside the outer IF, without taking the inner IF in to consideration...

*) In my version it only needs to do the time check, and only if it is the right time will it retrieve the temperature and do those comparisons... In the working version, it always has to check the time twice and always has to retrieve and check the temperature as well.
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Uncertain how to check temperatures in blockly

Post by waaren »

FearNaBoinne wrote: Monday 08 July 2019 8:41 ... But nested IFs should work as well, esp. as it reduces the number of tests*...
This remark triggered my memory. There are quite a number of posts on this forum that nested if's in Blockly does not seem to work. If you search for nested Blockly in the search window, you will find >= 57 posts
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: Uncertain how to check temperatures in blockly

Post by FearNaBoinne »

waaren wrote: Monday 08 July 2019 11:41
FearNaBoinne wrote: Monday 08 July 2019 8:41 ... But nested IFs should work as well, esp. as it reduces the number of tests*...
This remark triggered my memory. There are quite a number of posts on this forum that nested if's in Blockly does not seem to work. If you search for nested Blockly in the search window, you will find >= 57 posts
Sounds like a bug that needs to be fixed! ;)
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Uncertain how to check temperatures in blockly

Post by waaren »

FearNaBoinne wrote: Monday 08 July 2019 22:18 Sounds like a bug that needs to be fixed! ;)
True but for some reason I think this will not get to the top of the list of things that needs urgent fixing any time soon.. :D
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
FearNaBoinne
Posts: 144
Joined: Tuesday 30 April 2019 10:08
Target OS: Linux
Domoticz version: 2021.1
Location: Sector 0
Contact:

Re: Uncertain how to check temperatures in blockly

Post by FearNaBoinne »

If only I had buckets of spare time... ;)
RasPi, Raspbian , Domoticz v2021.1, Z-Wave Stick, RFLink, RFXtrx433e, Hue, Tuya (Tasmota/Mosquitto with Discovery), ESP(easy), MySensors.org, OTGW
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest