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

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.
Post Reply
Xztraz
Posts: 129
Joined: Tuesday 31 January 2017 22:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Xztraz » Monday 14 May 2018 1:22

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.
Last edited by Xztraz on Monday 14 May 2018 12:39, edited 2 times in total.

User avatar
waaren
Posts: 808
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post by waaren » Monday 14 May 2018 7:53

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"
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

Xztraz
Posts: 129
Joined: Tuesday 31 January 2017 22:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Xztraz » Monday 14 May 2018 11:35

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

Xztraz
Posts: 129
Joined: Tuesday 31 January 2017 22:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Xztraz » Monday 14 May 2018 12:30

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

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests