Page 1 of 1

Help needed with Blocky sprinkler script

Posted: Wednesday 30 May 2018 21:38
by packetloss
Dear all,

I'd like to receive some help with the following. I have made a Lua script for making a virtual device that tells me how much rain has fallen in my neighbourhood [1]. I believe this virtual device is functioning OK, please see file 2.png.

I made a Blocky script (please see 1.png) that tries to see how much rain has fallen and to see if the time is 21:17 PM. The first 'line' of the Blocky script gives errors. When I replace the equation with something else, Blocky gives no errors.

The error I see in syslog is:

Code: Select all

May 30 21:17:00 elmo domoticz: EventSystem: Lua script error (Blockly), Name: sproeiinstallatie_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare nil with number
What is happing here? What is creating this error?

[1] https://www.domoticz.com/wiki/Virtual_weather_devices

Domoticz v3.9546.

Re: Help needed with Blocky sprinkler script

Posted: Friday 01 June 2018 9:38
by packetloss
packetloss wrote: Wednesday 30 May 2018 21:38

Code: Select all

May 30 21:17:00 elmo domoticz: EventSystem: Lua script error (Blockly), Name: sproeiinstallatie_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare nil with number

After working many hours on this, I discovered a text when I hover with the mouse over the rain device:
3.png
3.png (7.9 KiB) Viewed 945 times
So, this sucks. I would rather not have had the option to use this in Blocky, than discovering after hours of work it's not gonna function...