Page 1 of 1

[kWh] Which device type to select to update with JSON

Posted: Wednesday 13 April 2016 3:20
by raymonvdm
There are several ways to get kWh data in Domoticz. But none of them seem to be matching to my setup :D


I have a kWh meter which sends me 3 kWh values once every x minutes. This is not a counter it is an actual value. So i created a dummy device (Electric Instant Counter) and think i need to use the following JSON url

Code: Select all


Electricity (instant and counter)
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=POWER;ENERGY

IDX = id of your device (This number can be found in the devices tab in the column "IDX")
POWER = current power
ENERGY = cumulative energy in Watt-hours (Wh) (this is just a "dummy" counter, all counting must be done by client)

I am correct to send the following JSON? Since POWER is in Watts and i only have kWh

Code: Select all

/json.htm?type=command&param=udevice&idx=29&nvalue=0&svalue=;6574000
But this seems to tell domoticz that the day usage of today is 6574.000 kwh, or do i need to wait for 24hs to get a normal reading? I want to achieve the same as the youless counter. I want to know the kwh usage per 24h

Note: I have 3 values per meter (L1 / L2 / L3) can i create a device to sort this out?
Note2: Maybe i don`t understand this due to the fact that it is translated form English to Dutch

Re: [kWh] Which device type to select to update with JSON

Posted: Thursday 14 April 2016 11:22
by raymonvdm
Is there anyone who can explain me which device type to add ?

Counter (RFXMeter) does not seem to do the trick

Or maybe it does ?

Code: Select all


http://:8080/json.htm?type=devices&rid=5

{
   "ActTime" : 1460626687,
   "ServerTime" : "2016-04-14 11:38:07",
   "Sunrise" : "06:41",
   "Sunset" : "20:33",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "Counter" : "97185.000 kWh",
         "CounterToday" : "198.000 kWh",
         "CustomImage" : 0,
         "Data" : "97185.000 kWh",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 2,
         "HardwareName" : "Dummy",
         "HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
         "HardwareTypeVal" : 15,
         "HaveTimeout" : false,
         "ID" : "14054",
         "LastUpdate" : "2016-04-14 11:30:02",
         "Name" : "Counter13",
         "Notifications" : "false",
         "PlanID" : "0",
         "PlanIDs" : [ 0 ],
         "Protected" : false,
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "RFXMeter counter",
         "SwitchTypeVal" : 0,
         "Timers" : "false",
         "Type" : "RFXMeter",
         "TypeImg" : "counter",
         "Unit" : 1,
         "Used" : 1,
         "ValueQuantity" : "",
         "ValueUnits" : "",
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "5"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}


Re: [kWh] Which device type to select to update with JSON

Posted: Thursday 14 April 2016 12:29
by Westcott
Hi Raymonvdm,
But this seems to tell domoticz that the day usage of today is 6574.000 kwh, or do i need to wait for 24hs to get a normal reading?
Yes, you do need to wait, because yesterday's total was zero.
Or start again, subtracting 6574 from each day's usage.
I use several of these devices, and have now spotted the CounterToday property thanks to your post.
Note: I have 3 values per meter (L1 / L2 / L3) can i create a device to sort this out?
There is a 3-phase device type, but I think it can only show Amps.