Page 1 of 1
How to read data of Popp Rain General Sensor
Posted: Tuesday 07 July 2020 9:51
by henrivb
Hi I am trying to read the data of my Popp Rain Sensor shown below in my dzEvents script.
- device type = General
- subtype = Custom sensor
- Data = "4 mm" (see below)
how do I do that?
- Spoiler: show
Code: Select all
{
"ActTime" : 1594105062,
"AstrTwilightEnd" : "00:00",
"AstrTwilightStart" : "00:00",
"CivTwilightEnd" : "22:40",
"CivTwilightStart" : "04:45",
"DayLength" : "16:23",
"NautTwilightEnd" : "23:48",
"NautTwilightStart" : "03:36",
"ServerTime" : "2020-07-07 08:57:42",
"SunAtSouth" : "13:42",
"Sunrise" : "05:30",
"Sunset" : "21:54",
"app_version" : "2020.2 (build 12200)",
"result" :
[
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 77,
"CustomImage" : 0,
"Data" : "4 mm",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 24,
"HardwareName" : "Openzwave",
"HardwareType" : "OpenZWave USB",
"HardwareTypeVal" : 21,
"HaveTimeout" : true,
"ID" : "00000502",
"Image" : "Custom",
"LastUpdate" : "2020-07-06 16:48:40",
"Name" : "Z-Rain General Purpose",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" :
[
0
],
"Protected" : false,
"SensorType" : 1,
"SensorUnit" : "mm",
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Custom Sensor",
"Timers" : "false",
"Type" : "General",
"TypeImg" : "Custom",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "1080"
}
],
"status" : "OK",
"title" : "Devices"
}
Re: How to read data of Popp Rain General Sensor [Solved]
Posted: Tuesday 07 July 2020 10:33
by waaren
henrivb wrote: ↑Tuesday 07 July 2020 9:51
Hi I am trying to read the data of my Popp Rain Sensor shown below in my dzEvents script.
how do I do that?
can you try this?
Code: Select all
return
{
on =
{
devices =
{
1080,
},
},
logging =
{
level = domoticz.LOG_DEBUG,
},
execute = function(dz, item)
local amount = item.sValue
dz.log('Device ' .. item.name .. ' was updated to ' .. amount .. ' ' .. item.sensorUnit, dz.LOG_DEBUG)
end
}
Re: How to read data of Popp Rain General Sensor
Posted: Tuesday 07 July 2020 12:34
by henrivb
Thanks for getting back so quick. Your code looks good looks. I have put it in but now I need to wait until I get actual data from the rain sensor (it is on the roof att). I will get it tested very soon and will get back here to report if it worked. thanks !
Re: How to read data of Popp Rain General Sensor
Posted: Tuesday 07 July 2020 13:13
by henrivb
It works! thanks
Here is my complete script to determine rainfall in the past 3 days using the Popp&Co 700168 Z-Rain ZWave device. I use this to determine if I need to rain my garden.