SpoturDeal / MMM-Domoticz

Read data from you Domoticz system
MIT License
8 stars 2 forks source link

How is energy usage measured ? #10

Closed RienduPre closed 5 years ago

RienduPre commented 5 years ago

Hi,

I want to show my energy usage on the MM based on Domoticz. I have a smart meter (P1) at home which shows the energy usage on 1 devices in Domoticz See images below The showed numbers on the mirror do not reflect the power meter values of my smart meter, it looks like all measurements are counted together.

Is it possible to point to just one device to show the energy usage ?

Thanks, Rien

2019-04-14_2230 2019-04-14_2228
RienduPre commented 5 years ago

I looked into the code and all my readings of all devices are added to each other, which is no good because the usage of my energy meter is also added to the total :-( I did exclude all usage devices except the Energy meter and now it looks good :-)

However, it would be more convenient to point only to one devices in Domoticz because I have to remember to exclude a new devices in MM2 too.

In addition I also have a device for my solar in Domoticz, it would be great if I could add this device to MM2 too, to see my energy production too on MM2

Thanks, Rien

SpoturDeal commented 5 years ago

Hello Rien,

Thanks for your remarks and bringing the energy use issue to my attention.

At this moment I am aware of this problem the energy company (Enexis) have planned to get the smart meter in my area (Noord-Oost Brabant) this quarter of 2019. As soon as the meter has been placed I will update the module.

The reason I'm not able to implement it at this moment is not knowing what domoticz api JSON on P1 will provide. Will also look in reverse the option of shown and not shown devices. Maybe you could send me an JSON example with just the P1 (included the version DSMR 3, 4 or 5) data.

Hopes this helps for now.

Best wishes,

Carl

RienduPre commented 5 years ago

Hi Carl,

Can you help me with how to get the information using JSON out of Domoticz?

Do you have an example command ?

Thanks, Rien

SpoturDeal commented 5 years ago

Hello Rien,

You can get the JSON with http://ipaddress:port/json.htm?type=devices&used=true&filter=all

like http://192.168.1.188:8088/json.htm?type=devices&used=true&filter=all

RienduPre commented 5 years ago

Ok here you go:

{ "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "Counter" : "75433.808", "CounterDeliv" : "0.397", "CounterDelivToday" : "0.000 kWh", "CounterToday" : "16.900 kWh", "CustomImage" : 0, "Data" : "35630643;39803165;111;286;890;0", "Description" : "", "Favorite" : 1, "HardwareID" : 10, "HardwareName" : "P1 Smart Meter", "HardwareType" : "P1 Smart Meter USB", "HardwareTypeVal" : 4, "HaveTimeout" : false, "ID" : "0001", "LastUpdate" : "2019-04-15 11:36:28", "Name" : "Energy 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" : "890 Watt", "UsageDeliv" : "0 Watt", "Used" : 1, "XOffset" : "0", "YOffset" : "0", "idx" : "518" }, { "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "Counter" : "13858.631", "CounterToday" : "7.626 m3", "CustomImage" : 0, "Data" : "13858.631", "Description" : "", "Favorite" : 1, "HardwareID" : 10, "HardwareName" : "P1 Smart Meter", "HardwareType" : "P1 Smart Meter USB", "HardwareTypeVal" : 4, "HaveTimeout" : false, "ID" : "0001", "LastUpdate" : "2019-04-15 11:36:08", "Name" : "Gas Meter", "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" : "519" },

SpoturDeal commented 5 years ago

Thanks will dive into it the coming weekend.

RienduPre commented 5 years ago

Thanks will dive into it the coming weekend.

Any news on this ?

SpoturDeal commented 5 years ago

I have been working on it last Monday. Trying with some fake data i could get it working properly in the way that it is backwards compatible with previous versions. It's not a good idea to have every user change there config file.

The reverse option for just checking the devices that are listed gave me a few hard to fix problems. And blocking out the energy use from the smart meter.

Give me some time, when I have the smart meter installed (2019-Q2).

If you exclude the P1 smart meter it won't show up..

(there was a smart meter module but i am not able to find it anymore.)

SpoturDeal commented 5 years ago

Hello @RienduPre ,

This morning my Smart Meter was installed. I have changed the system for Power Usage metering.

In the config file add the following lines to see the smart meter data in the list

smartMeter:  true,
smartMeterOffset: 0

If you are not the first user of the smartMeter you can set the smartMeterOffset.

Also made it possible to reverse the list of excludedDevices.

onlyShowExcluded,  true

Makes possible that only the devices that are excluded are shown.

RienduPre commented 5 years ago

Hi,

I added those 2 parameters, but don't see any change in my view

Can you post a screenshot, how this should look like?

SpoturDeal commented 5 years ago

Did you update the module?

cd MagicMirror/modules/MMM-Domoticz
git pull
pm2 restart MagicMirror

This is my screen shot my meter is very new

power Power2

If you are using onlyShowExcluded you must add 'Power' to the array.

SpoturDeal commented 5 years ago

Hello @RienduPre ,

Does it work properly now?

Grtz

Carl

RienduPre commented 5 years ago

Yes it is ? Thank you and sorry for the late reaction

RienduPre commented 5 years ago

One question though.

See attached screenshot, is it possible to show domoticz measurement from my Solar panels, Jacuzzi energy usage, water usage etc. too

Schermafbeelding 2019-05-25 om 13 40 50
SpoturDeal commented 5 years ago

Hallo Rien,

Kan je even via de email removed contact met me opnemen dan kunnen we overleggen hoe ik het er in kan krijgen. dit email adres is maar tijdelijk en heeft een typefout.

Met groet

Carel