Help needed with Blocky sprinkler script

Post Reply
packetloss
Posts: 57
Joined: Monday 03 August 2015 20:27
Target OS: Raspberry Pi
Domoticz version: 3.9546
Location: Belgium
Contact:

Help needed with Blocky sprinkler script

Post by packetloss » Wednesday 30 May 2018 21:38

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.
Attachments
2.png
2.png (2.49 KiB) Viewed 423 times
1.png
1.png (13.77 KiB) Viewed 424 times

packetloss
Posts: 57
Joined: Monday 03 August 2015 20:27
Target OS: Raspberry Pi
Domoticz version: 3.9546
Location: Belgium
Contact:

Re: Help needed with Blocky sprinkler script

Post by packetloss » Friday 01 June 2018 9:38

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 387 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...

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests