Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current phase power usage empty (per phase) #8

Open
HV-NL opened this issue Jan 7, 2024 · 2 comments
Open

Current phase power usage empty (per phase) #8

HV-NL opened this issue Jan 7, 2024 · 2 comments

Comments

@HV-NL
Copy link

HV-NL commented Jan 7, 2024

I use a DSMR5 meter, which has a.o. power usage in its output

active_power_l1_w | 128
active_power_l2_w | 1806
active_power_l3_w | 18

The plugin (version 1.0.1) correctly creates the corresponding Domoticz entries:

  |   | 55 | HomeWizard WiFI P1 Meter | 00080069 | 105 | HomeWizard WiFI P1 Meter - Current phase-1 power usage | General | kWh | 0.000 kWh | - | - |   | 2024-01-07 13:17:06
  |   | 56 | HomeWizard WiFI P1 Meter | 0008006A | 106 | HomeWizard WiFI P1 Meter - Current phase-2 power usage | General | kWh | 0.000 kWh | - | - |   | 2024-01-07 13:17:06
  |   | 57 | HomeWizard WiFI P1 Meter | 0008006B | 107 | HomeWizard WiFI P1 Meter - Current phase-3 power usage | General | kWh | 0.000 kWh | - | - |   | 2024-01-07 13:17:06

These values are updated every 10 seconds , but always showing value "0.000 kWh"
All other data seems to be processed correctly.

@HV-NL
Copy link
Author

HV-NL commented Jan 8, 2024

I found the problem, and solved it locally. Now the counters show actual values.

During my repair action I also found another problem: active_power_id was updated with a mix of active_power_w and total_power

My changes are

4c4
< ##           Version:        1.0.1
---
> ##           Version:        1.0.2
5a6
> ##                           08-01-2024 HV-NL
8c9
< <plugin key="HomeWizardWifiP1Meter" name="HomeWizard Wi-Fi P1 Meter" author="Eraser" version="1.0.1" externallink="https://www.homewizard.nl/p1-meter">
---
> <plugin key="HomeWizardWifiP1Meter" name="HomeWizard Wi-Fi P1 Meter" author="Eraser" version="1.0.2" externallink="https://www.homewizard.nl/p1-meter">
175c176,177
<                 UpdateDevice(self.active_power_id, 0, numStr(self.active_power_w) + ";" + numStr(self.total_power), True)
---
>                 #UpdateDevice(self.active_power_id, 0, numStr(self.active_power_w) + ";" + numStr(self.total_power), True)
>                 UpdateDevice(self.active_power_id, 0, numStr(self.active_power_w) + ";" + numStr(self.active_power_w), True)
193c195
<                     UpdateDevice(self.active_power_l1_id, 0, numStr(self.active_power_l1_w) + ";0", True)
---
>                     UpdateDevice(self.active_power_l1_id, 0, numStr(self.active_power_l1_w) + ";" + numStr(self.active_power_l1_w), True)
202c204
<                     UpdateDevice(self.active_power_l2_id, 0, numStr(self.active_power_l2_w) + ";0", True)
---
>                     UpdateDevice(self.active_power_l2_id, 0, numStr(self.active_power_l2_w) + ";" + numStr(self.active_power_l2_w), True)
211c213
<                     UpdateDevice(self.active_power_l3_id, 0, numStr(self.active_power_l3_w) + ";0", True)
---
>                     UpdateDevice(self.active_power_l3_id, 0, numStr(self.active_power_l3_w) + ";" + numStr(self.active_power_l3_w), True)
``

@buxol
Copy link

buxol commented Feb 27, 2024

HV-NL, your solution is not working for me.
See the specifications of this device type: https://www.domoticz.com/wiki/Developing_a_Python_plugin#Available_Device_Types
Search for device 243-General -> 29-kWh on this page.

Electric (Instant+Counter)
nValue should be zero
sValue are two numbers separated by semicolon like "123;123456" The first number is the actual power in Watt, the second number is actual energy in kWh. When the option "EnergyMeterMode" is set to "Calculated", the second value is ignored
Optional argument Options can set the EnergyMeterMode.
Use Options={'EnergyMeterMode': '1' } to set energyMeterMode to "Calculated". Default is "From Device"

This worked for me:
Use the original code. The P1-meter doesn't provide the Wh information for the three phases, so please change the option EnergyMeterMode to Calculated in Domoticz GUI. This will ensure that Domoticz will calculate the Wh.

Also, the mix of total_power and active_power on line 175 is correct. Don't change it.

I do propose a change:
Use Options={'EnergyMeterMode': '1' } while creating the Power per fase devices to set the correct option on creation.
I tried it, but it doesn't seem to work correctly. The device is created, the option is set, but no values are shown.
So for now I changed the option manually via the Domoticz GUI after the device is created.

Option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants