P1 Sensor data

Moderator: leecollings

Post Reply
LjMouzer
Posts: 2
Joined: Monday 25 May 2020 11:31
Target OS: Linux
Domoticz version:
Contact:

P1 Sensor data

Post by LjMouzer »

Hi All,

I'm new to domoticz.

Im using a synology nas with domoticz to read out P1 smart meter data.
Now i would like to send that data to a tcp/ip client in crestron.
I allready managed to set up communication between crestron & domoticz. Now i need to find a way to filter the response data from domoticz

Currently the repply from http://192.168.1.21:8084/json.htm?type= ... favorite=1 is too long
Because my crestron tcp/ip client has a limit of 255 characters i would like to filter the json repply to use the "data" only.

How can i modify this response within a HTTP get url ?
Spoiler: show

Code: Select all

{
	"ActTime" : 1590399357,
	"AstrTwilightEnd" : "00:00",
	"AstrTwilightStart" : "00:00",
	"CivTwilightEnd" : "22:27",
	"CivTwilightStart" : "04:50",
	"DayLength" : "16:08",
	"NautTwilightEnd" : "23:32",
	"NautTwilightStart" : "03:45",
	"ServerTime" : "2020-05-25 11:35:57",
	"SunAtSouth" : "13:38",
	"Sunrise" : "05:34",
	"Sunset" : "21:43",
	"app_version" : "2020.1",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"Counter" : "2944.124",
			"CounterDeliv" : "150.706",
			"CounterDelivToday" : "0.209 kWh",
			"CounterToday" : "5.359 kWh",
			"CustomImage" : 0,
			"Data" : "1541521;1402603;51219;99487;30;0",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "0001",
			"LastUpdate" : "2020-05-25 11:35:57",
			"Name" : "Power",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Energy",
			"SwitchTypeVal" : 0,
			"Timers" : "false",
			"Type" : "P1 Smart Meter",
			"TypeImg" : "counter",
			"Unit" : 1,
			"Usage" : "30 Watt",
			"UsageDeliv" : "0 Watt",
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "1"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "239.5 V",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "00000001",
			"LastUpdate" : "2020-05-25 11:35:57",
			"Name" : "Voltage L1",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Voltage",
			"Timers" : "false",
			"Type" : "General",
			"TypeImg" : "current",
			"Unit" : 1,
			"Used" : 1,
			"Voltage" : 239.5,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "2"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "239.2 V",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "00000002",
			"LastUpdate" : "2020-05-25 11:35:57",
			"Name" : "Voltage L2",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Voltage",
			"Timers" : "false",
			"Type" : "General",
			"TypeImg" : "current",
			"Unit" : 1,
			"Used" : 1,
			"Voltage" : 239.19999999999999,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "3"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "376 Watt",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "0000000",
			"LastUpdate" : "2020-05-25 11:35:57",
			"Name" : "Usage L1",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Electric",
			"Timers" : "false",
			"Type" : "Usage",
			"TypeImg" : "current",
			"Unit" : 1,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "5"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "239 V",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "00000003",
			"LastUpdate" : "2020-05-25 11:35:57",
			"Name" : "Voltage L3",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Voltage",
			"Timers" : "false",
			"Type" : "General",
			"TypeImg" : "current",
			"Unit" : 1,
			"Used" : 1,
			"Voltage" : 239.0,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "4"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "35 Watt",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "0000000",
			"LastUpdate" : "2020-05-25 11:35:57",
			"Name" : "Usage L2",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Electric",
			"Timers" : "false",
			"Type" : "Usage",
			"TypeImg" : "current",
			"Unit" : 2,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "6"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "0 Watt",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "0000000",
			"LastUpdate" : "2020-05-25 11:35:56",
			"Name" : "Usage L3",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Electric",
			"Timers" : "false",
			"Type" : "Usage",
			"TypeImg" : "current",
			"Unit" : 3,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "7"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"Counter" : "557.757",
			"CounterToday" : "0.045 m3",
			"CustomImage" : 0,
			"Data" : "557.757",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "0001",
			"LastUpdate" : "2020-05-25 11:35:11",
			"Name" : "Gas",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Gas",
			"SwitchTypeVal" : 1,
			"Timers" : "false",
			"Type" : "P1 Smart Meter",
			"TypeImg" : "counter",
			"Unit" : 2,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "11"
		},
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"CustomImage" : 0,
			"Data" : "387 Watt",
			"Description" : "",
			"Favorite" : 1,
			"HardwareID" : 2,
			"HardwareName" : "Slimme meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "0000000",
			"LastUpdate" : "2020-05-25 11:35:56",
			"Name" : "Delivery L3",
			"Notifications" : "false",
			"PlanID" : "0",
			"PlanIDs" : 
			[
				0
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Electric",
			"Timers" : "false",
			"Type" : "Usage",
			"TypeImg" : "current",
			"Unit" : 6,
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "10"
		}
	],
	"status" : "OK",
	"title" : "Devices"
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 Sensor data

Post by waaren »

LjMouzer wrote: Monday 25 May 2020 11:41 Currently the repply from http://192.168.1.21:8084/json.htm?type= ... favorite=1 is too long
Because my crestron tcp/ip client has a limit of 255 characters i would like to filter the json repply to use the "data" only.

How can i modify this response within a HTTP get url ?
I don't know of a way to do this within the 'pulling' HTTP Get.

Can crestron be configured to receive domoticz data pushed by either MQTT or HTTP Get / -Put ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
LjMouzer
Posts: 2
Joined: Monday 25 May 2020 11:31
Target OS: Linux
Domoticz version:
Contact:

Re: P1 Sensor data

Post by LjMouzer »

waaren wrote: Monday 25 May 2020 13:03
LjMouzer wrote: Monday 25 May 2020 11:41 Currently the repply from http://192.168.1.21:8084/json.htm?type= ... favorite=1 is too long
Because my crestron tcp/ip client has a limit of 255 characters i would like to filter the json repply to use the "data" only.

How can i modify this response within a HTTP get url ?
I don't know of a way to do this within the 'pulling' HTTP Get.

Can crestron be configured to receive domoticz data pushed by either MQTT or HTTP Get / -Put ?
It must be posible to program that within crestron, but I don’t have that knowledge....yet ^_^
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest