Blockly IF statements
Posted: Saturday 17 June 2017 18:42
Hi
I'm trying to write a script that send an email when the temperature of my greenhouse exceeds a predefined temperature
test_temp is a dummy sensor (for testing purposes).
I am setting the temperature with the following URL (just the same way my ESP8266 remote sensor does):
http://192.168.1.7:8084/json.htm?type=c ... value=22.5
Where 192.168.1.7:8084 is my Synology NAS and 24 is the idx of my dummy sensor.
When call the json.htm url in my web browser the sensor is updated and the user variable changes as expected.
The issue is even if the svalue is less than 30 (22.5 in the example above) the email is being sent. Blockly seems to be ignoring the if statement and executing the conditional code regardless. I've even tried 'less than' and 'greater than or equal to' but the code after the if always runs!
This is the log:
2017-06-17 17:07:29.725 EventSystem: Event triggered: Greenhouse > Max_1
2017-06-17 17:07:29.725 Highest Greenhouse temperature today
2017-06-17 17:07:29.725 Branch ran again
2017-06-17 17:07:29.726 22.5
2017-06-17 17:07:29.726 Greenhouse is over 30C
2017-06-17 17:07:31.898 Notification sent (Email)
You can see that the value of the temperature sensor is 22.5 but the if statement should only run if the value of test_temp is greater than 30
I'm running V3.5877 of domoticz on my Synology 415Play
Any ideas where I am going wrong?
I'm trying to write a script that send an email when the temperature of my greenhouse exceeds a predefined temperature
test_temp is a dummy sensor (for testing purposes).
I am setting the temperature with the following URL (just the same way my ESP8266 remote sensor does):
http://192.168.1.7:8084/json.htm?type=c ... value=22.5
Where 192.168.1.7:8084 is my Synology NAS and 24 is the idx of my dummy sensor.
When call the json.htm url in my web browser the sensor is updated and the user variable changes as expected.
The issue is even if the svalue is less than 30 (22.5 in the example above) the email is being sent. Blockly seems to be ignoring the if statement and executing the conditional code regardless. I've even tried 'less than' and 'greater than or equal to' but the code after the if always runs!
This is the log:
2017-06-17 17:07:29.725 EventSystem: Event triggered: Greenhouse > Max_1
2017-06-17 17:07:29.725 Highest Greenhouse temperature today
2017-06-17 17:07:29.725 Branch ran again
2017-06-17 17:07:29.726 22.5
2017-06-17 17:07:29.726 Greenhouse is over 30C
2017-06-17 17:07:31.898 Notification sent (Email)
You can see that the value of the temperature sensor is 22.5 but the if statement should only run if the value of test_temp is greater than 30
I'm running V3.5877 of domoticz on my Synology 415Play
Any ideas where I am going wrong?