Value from soil moisture is not usable in Blockly If someone solves the problem he gets a drink from me.

Moderator: leecollings

Post Reply
k5austria
Posts: 1
Joined: Friday 21 April 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Value from soil moisture is not usable in Blockly If someone solves the problem he gets a drink from me.

Post by k5austria »

My gateway (MySensors USB) gets the data (analog) from soil moisture sensor. Measuring from soil moisture is ok. The problem is blockly. I want to turn on Waterpump via Sensor.The problem is that value from sensor triggers an error in Blockly (Error: EventSystem: Lua script error (Blockly), Name: 1_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to index global 'utilitydevice' (a nil value))

I am a beginner and need some help. Thanks!

The sketch :

Code: Select all

// Enable debug prints to serial monitor
#define MY_DEBUG

// Enable and select radio type attached
#define MY_RADIO_NRF24
#define CHILD_ID 0

#include <MySensors.h>
// Here we are setting up some water thresholds that we will
// use later. Note that you will need to change these to match
// your soil type and environment. It doesn't do much for me because I'm using domoticz
int thresholdUp = 400;
int thresholdDown = 075;
MyMessage msg(CHILD_ID, V_LEVEL);
unsigned long SLEEP_TIME = 30000;

// We are setting up the pin A0 on the redboard to be our sensor
// pin input:
int sensorPin = A0;

void presentation()
{
present(CHILD_ID, S_MOISTURE);
}

void loop()
{
int sensorValue;
sensorValue = analogRead(sensorPin);

//send back the values
send(msg.set(sensorValue));
// delay until next measurement (msec)
sleep(SLEEP_TIME);
}
Attachments
2017-05-06 00_27_17-Domoticz.png
2017-05-06 00_27_17-Domoticz.png (41.51 KiB) Viewed 684 times
2017-05-06 00_26_11-Domoticz.png
2017-05-06 00_26_11-Domoticz.png (184.68 KiB) Viewed 684 times
2017-05-06 00_25_17-Domoticz.png
2017-05-06 00_25_17-Domoticz.png (96.75 KiB) Viewed 684 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest