Page 1 of 1

json call from espesy to update value on soil moisture dummy sensor - Solved

Posted: Monday 14 May 2018 1:22
by Xztraz
Is it possible to update the value of a dummy sensor with the type soil moisture via json?
Can't find anything in wiki about soil moisture.

Trying to send data from espeasy to domoticz.

Re: json call to update value on soil moisture dummy sensor

Posted: Monday 14 May 2018 7:53
by waaren
http://domoticz_IP:domoticz_PORT/json.htm?type=command&param=udevice&idx=yyy&nvalue=xx

yyy = your device number
xx: moisture
00 - 09 ==> "saturated
10 - 19 ==> "adequately wet"
20 - 59 ==> "irrigation advice"
60 - 99 ==> "irrigation"
> 99 ==> "Dangerously dry"

Re: json call to update value on soil moisture dummy sensor

Posted: Monday 14 May 2018 11:35
by Xztraz
Alright.

That explains why the standard dummy sensors in espeasy won't update soil moisture.

All preset modes seem to send variations of svalue instead of nvalue.
GET /json.htm?type=command&param=udevice&idx=927&nvalue=0&svalue=3.00&rssi=9 HTTP/1.1

Re: json call to update value on soil moisture dummy sensor

Posted: Monday 14 May 2018 12:30
by Xztraz
Solution:

As adviced, nvalue needs to be set for soil moisture sensor in domoticz api. Thanks waaren

Since none of the predefined dummy sensor types does that i had to make up a rule in espeasy

Code: Select all

on SoilRaw#Raw do // this event comes in every minute
   TaskValueSet 5,1,[SoilRaw#Raw]/5       // set SoilMoist#Moisture dummy sensor
   SendToHTTP 192.168.1.199,8080,/json.htm?param=udevice&type=command&idx=927&nvalue=[SoilMoist#Moisture]
endon
I had to rearrange in the url a bit since a oddity in espeasy, param needs to be first. otherwise it mucks up the url