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.

Moderators: leecollings, remb0

Post Reply
Xztraz
Posts: 107
Joined: Tuesday 31 January 2017 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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.
Last edited by Xztraz on Monday 14 May 2018 12:39, edited 2 times in total.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

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

Post 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"
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Xztraz
Posts: 107
Joined: Tuesday 31 January 2017 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
Xztraz
Posts: 107
Joined: Tuesday 31 January 2017 21:54
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest