Domoticz will show a negative value when my energy production is higher than my consumption, but Dashticz will show a positive value.


Or how can I change this so a negative value is shown?
Domoticz version 4.10717
Dashticz version 3.3.5 beta
Moderator: leecollings
Code: Select all
{
"ActTime" : 1583057176,
"AstrTwilightEnd" : "20:13",
"AstrTwilightStart" : "05:34",
"CivTwilightEnd" : "18:55",
"CivTwilightStart" : "06:52",
"DayLength" : "10:56",
"NautTwilightEnd" : "19:34",
"NautTwilightStart" : "06:13",
"ServerTime" : "2020-03-01 11:06:16",
"SunAtSouth" : "12:54",
"Sunrise" : "07:25",
"Sunset" : "18:22",
"app_version" : "4.10717",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Counter" : "8427.982",
"CounterDeliv" : "122.197",
"CounterDelivToday" : "0.520 kWh",
"CounterToday" : "1.919 kWh",
"CustomImage" : 0,
"Data" : "4034842;4393140;29147;93050;0;1898",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 7,
"HardwareName" : "Slimme meter",
"HardwareType" : "P1 Smart Meter USB",
"HardwareTypeVal" : 4,
"HaveTimeout" : false,
"ID" : "0001",
"LastUpdate" : "2020-03-01 11:06:16",
"Name" : "Slimme meter",
"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" : "0 Watt",
"UsageDeliv" : "1898 Watt",
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "57"
}
],
"status" : "OK",
"title" : "Devices"
}
Code: Select all
"Data" : "4034842;4393140;29147;93050;0;1898",
Not sure what you mean with "That url is from Domoticz, not Dashticz.".clinkadink wrote: ↑Sunday 01 March 2020 11:21 Thanks for the output of the device. That url is from Domoticz, not Dashticz.
http://127.0.0.1:8080/json.htm?type=devices&rid=IDX
It is Domoticz that is actually reporting a positive value, look at the end of this line in your Domoticz output:Therefore, they must apply some kind of calculation in the Domoticz tile it self. I.e. on the page. I am sorry, but I do not know how you can apply the same logic to a block in Dashticz. You can in a graph block with custom data (and a calculation) - but that doesn't help you in this case.Code: Select all
"Data" : "4034842;4393140;29147;93050;0;1898",
Maybe Lokonli will know if this is possible.
Code: Select all
"Data" : "4034999;4393140;30055;93050;2208;0",
Code: Select all
var data = device.Data;
var correctReading = data.split(';')[4] - data.split(';')[5];
Code: Select all
"Data" : "4034842;4393140;29147;93050;0;1898",
Code: Select all
"Data" : "4034999;4393140;30055;93050;2208;0",
We could create a customized Domoticz block for P1 devices.clinkadink wrote: ↑Sunday 01 March 2020 12:08 Understood. So there needs to be a calculation on the last two parts of data returned from your device.
In this case ... correctReading would be -1898.Code: Select all
var data = device.Data; var correctReading = data.split(';')[4] - data.split(';')[5];
And in this case ... correctReading would be 2208.Code: Select all
"Data" : "4034842;4393140;29147;93050;0;1898",
The problem is where to apply this logicCode: Select all
"Data" : "4034999;4393140;30055;93050;2208;0",
![]()
Users browsing this forum: No registered users and 0 guests