How to read data of Popp Rain General Sensor  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
henrivb
Posts: 22
Joined: Sunday 19 February 2017 12:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to read data of Popp Rain General Sensor

Post 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"
}
Attachments
Rain-devices.jpg
Rain-devices.jpg (54.5 KiB) Viewed 1017 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to read data of Popp Rain General Sensor  [Solved]

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

Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
henrivb
Posts: 22
Joined: Sunday 19 February 2017 12:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to read data of Popp Rain General Sensor

Post 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 !
Last edited by henrivb on Tuesday 07 July 2020 15:26, edited 1 time in total.
henrivb
Posts: 22
Joined: Sunday 19 February 2017 12:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to read data of Popp Rain General Sensor

Post 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.
regen.txt
(2.06 KiB) Downloaded 92 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest