Page 1 of 1

Blockly and soil moisture sensor

Posted: Monday 03 February 2020 18:44
by Treskil
Hi folks,

I'm trying to automate my little chilli pot garden. I wanted to measure soil moisture. So I've managed to connect capacitive soil moisture sensor to esp board and send the data to domoticz which runs on RPi2B+. This results in a reading on a sensor "abc":
abc sensor.PNG
abc sensor.PNG (9.7 KiB) Viewed 375 times
The problem is that when I try to use this value in blockly to start the water pump:
blockly script.PNG
blockly script.PNG (39.06 KiB) Viewed 375 times
I get the error message in log:

2020-02-03 18:40:16.337 Error: EventSystem: Lua script error (Blockly), Name: Script #2_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index a nil value (global 'utilitydevice')

What seems to the issue here? I have tried to find an answer on these forums to get this thing to work but I could not find any solution. Is this due to the value being of different type?

Re: Blockly and soil moisture sensor

Posted: Monday 03 February 2020 21:39
by Treskil
I have solved it myself. I figured out that changing the sensor type from "leaf wetness" to any other does the trick.