Domoticz - soil moisture + one relay = Lua script error (Blockly)
-
// 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); } -
// Enable debug prints to serial monitor
#define MY_DEBUG// Enable and select radio type attached
#define MY_RADIO_NRF24
#define CHILD_ID_MOISTURE 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_MOISTURE, S_HUM);
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_MOISTURE, S_HUM);
}void loop()
{
int sensorValue;
sensorValue = analogRead(sensorPin);//send back the values
send(msg.set(sensorValue));
// delay until next measurement (msec)
sleep(SLEEP_TIME);
}
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login


