Calculation in dials

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Calculation in dials

Post by pvklink »

Hi,

I just bought a new p1-meter, the (youless LS120). And this device collects its values a bit different.

the data of the powersensor, id 3272 = {a,b,c,d,e,f,}
where a= total usage low tarif
where b= total usage high tarif
where c= usage/deliv low tarif
where d= usage/deliv high tarif
where e= current usdage/delivery
where f= unknown

I want to make my dial so that the main value is the current usage
and 3 other values
1. total usage begin of the year (a+b)
2. total delivery/usage (c+d)
3. new adjusted total usage a+b-c-d

I tried some myself, but thsi did not work,
Can Someone give me a hint? , Do i need JS for this to calculate?

Code: Select all

blocks['p1_electra'] = 		{
				idx: '3272',		// was 3272
				title: 'Electra gebruik',
				width: 4,
				type: 'dial',
				subtype: 'usage',	// to show actual power instead of daily energy counter
				inverted: true,		// Value is positive if energy leaving the house is higher than energy consumption
				isSetpoint: false,	// waare instellen via de needle
				isNeedle: true,		// needle follows main value
				showring: true,
     				showunit: true,
     				shownumbers: true,
				showvalue: true,	// show mainvalue
				values: [
          				{value: 'Data0+Data1', label: 'Start', unit: 'Watt',scale: 0.1},	
          				{value: 'Data2+Data3', label: 'Total usage/deliv', unit: 'Watt',scale: 0.1},	
          				{value: 'Data0+Data1-Data2-Data3', label: 'New Total', unit: 'Watt',scale: 0.1},	
					],
        			color: 'white',
				flash: false,
        			last_update: true,
				decimals: 0,
				animation: false,
				fixed: false,		// removes needle and data
				hide_data: true,
        			min: -5000,
        			max: 5000,
				}
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
HvdW
Posts: 591
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Calculation in dials

Post by HvdW »

Is this helpfull?
Bugs bug me.
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Calculation in dials

Post by pvklink »

yeah!
I can use this as a template for my calculations!
Never thougt about dzvents...
Was searching within dashticz and looking at js scripts
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
HvdW
Posts: 591
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Calculation in dials

Post by HvdW »

c - delivery low
d - delivery high
e - current usage
f - current delevery
usage and delivery for e and f may be swapped (no time to look it up now)
Bugs bug me.
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Calculation in dials

Post by pvklink »

great, i will check e and f..
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
HvdW
Posts: 591
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: Calculation in dials

Post by HvdW »

e - usage
f - delivery

Try something like: http://192.168.1.your-RPI-ip:8181/json. ... ces&rid=15
You'll get somthing like this:

Code: Select all

{
	"ActTime" : 1695113509,
	"AstrTwilightEnd" : "21:37",
	"AstrTwilightStart" : "05:17",
	"CivTwilightEnd" : "20:14",
	"CivTwilightStart" : "06:40",
	"DayLength" : "12:26",
	"NautTwilightEnd" : "20:55",
	"NautTwilightStart" : "05:59",
	"ServerTime" : "2023-09-19 10:51:49",
	"SunAtSouth" : "13:27",
	"Sunrise" : "07:14",
	"Sunset" : "19:40",
	"app_version" : "2023.2",
	"result" : 
	[
		{
			"AddjMulti" : 1.0,
			"AddjMulti2" : 1.0,
			"AddjValue" : 0.0,
			"AddjValue2" : 0.0,
			"BatteryLevel" : 255,
			"Counter" : "46417.941",
			"CounterDeliv" : "37850.662",
			"CounterDelivToday" : "1.026 kWh",
			"CounterToday" : "3.471 kWh",
			"CustomImage" : 0,
			"Data" : "30206228;16211713;11118898;26731764;0;440",
			"Description" : "",
			"Favorite" : 1,
			"HardwareDisabled" : false,
			"HardwareID" : 4,
			"HardwareName" : "P1 smart meter",
			"HardwareType" : "P1 Smart Meter USB",
			"HardwareTypeVal" : 4,
			"HaveTimeout" : false,
			"ID" : "0001",
			"LastUpdate" : "2023-09-19 10:51:40",
			"Name" : "Power",
			"Notifications" : "false",
			"PlanID" : "7",
			"PlanIDs" : 
			[
				7
			],
			"Protected" : false,
			"ShowNotifications" : true,
			"SignalLevel" : "-",
			"SubType" : "Energy",
			"SwitchTypeVal" : 0,
			"Timers" : "false",
			"Type" : "P1 Smart Meter",
			"TypeImg" : "counter",
			"Unit" : 1,
			"Usage" : "0 Watt",
			"UsageDeliv" : "440 Watt",
			"Used" : 1,
			"XOffset" : "0",
			"YOffset" : "0",
			"idx" : "15"
		}
	],
	"status" : "OK",
	"title" : "Devices"
}
Your data is in "Data"
You can read about it here.

P1 USB readings:

Code: Select all

/KMP5 ZABF001587315111 (KMP lijkt de identificatie te zijn van Kamstrup)
0-0:96.1.1(205C4D246333034353537383234323121) (serienummer meter in hexadecimale ascii code) 
1-0:1.8.1(00185.000*kWh) (Totaal verbruik tarief 1 (nacht))
1-0:1.8.2(00084.000*kWh) (Totaal verbruik tarief 2 (dag))
1-0:2.8.1(00013.000*kWh) (Totaal geleverd tarief 1 (nacht))
1-0:2.8.2(00019.000*kWh) (Totaal geleverd tarief 2 (dag))
0-0:96.14.0(0001) (Actuele tarief (1))
1-0:1.7.0(0000.98*kW) (huidig verbruik)
1-0:2.7.0(0000.00*kW) (huidige teruglevering)
0-0:17.0.0(999*A) (maximum stroom per fase 
0-0:96.3.10(1) (stand van de schakelaar)
0-0:96.13.1() (bericht numeriek)
0-0:96.13.0() (bericht tekst)
0-1:24.1.0(3) (andere apparaten op de M-Bus) 
0-1:96.1.0(3238313031453631373038389930337131) (identificatie van de gasmeter)
0-1:24.3.0(120517020000)(08)(60)(1)(0-1:24.2.1)(m3) (tijd van de laatste gas meting (120517020000 = 17 mei 2012 2uur))
(00124.477) (Verbruikte hoeveelheid gas) 
0-1:24.4.0(1) (stand gasklep?) 
! (Afsluiter)
Bugs bug me.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest