Soil moisture dashboard won't work


#1

I want to show the actual soil moisture from my setup on a thinger.io dashboard. My code is the following:
`
#include SPI.h
#include ESP8266WiFi.h
#include ThingerWifi.h

#define WIFI_SSID "xxxxxxxxxx"
#define WIFI_WPA2_PASSWORD "xxxxxxxxxx"

#define USER_USERNAME "xxxxxxxxxx"
#define DEVICE_ID "xxxxxxxxxx"
#define DEVICE_CREDENTIAL "xxxxxxxxxx"

ThingerWifi thing(USER_USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);

int mosture_Sensor = 0;

void setup() {
  Serial.begin(115200);
  thing.add_wifi(WIFI_SSID, WIFI_WPA2_PASSWORD);
  thing["water"] >> [](pson& out){ out = !analogRead(mosture_Sensor); };
}

void loop() {
  thing.handle();
}`

I think there is a problem wih the line thing["water"] >> [](pson& out){ out = !analogRead(mosture_Sensor); };

My dashboard looks like this

This one works fine, i’ll get my treshold.
int soil = analogRead(soilmosture_Sensor); Serial.println(soil);


#2

I think that the problem is that you are negating the analogRead with the ! before the call. Your code should be:

  thing["water"] >> [](pson& out){ out = analogRead(mosture_Sensor); };

hope it helps!


#3

True, thats the solutiom. Its weird, 'cause i thought, i had already done that. Whatever.
In other news: It is possible, to show the dashboard in the thinger.io app? It only show the value there, not a graph.