openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.58k forks source link

[HomeWizard] request to add current and voltage channels to Wi-Fi P1 Meter thing #16988

Open NickB1 opened 3 months ago

NickB1 commented 3 months ago

Request to add current and voltage channels to Wi-Fi P1 Meter thing. This can be helpful for current based load balancing applications.

lsiepel commented 3 months ago

Not sure if the p1 telegram’ data is fully available in homewizard. Are you aware of some documentation?

NickB1 commented 3 months ago

The P1 telegram is fully available (https://api-documentation.homewizard.com/docs/endpoints/api-v1-telegram), not sure if the binding uses the telegram endpoint for it's channels though. Current and voltage data is also available in the recent measurement endpoint: https://api-documentation.homewizard.com/docs/endpoints/api-v1-data The measurement endpoint has some other useful data to like the monthly power peak, if work is being done to the binding it might be a good idea to add these as well.

NickB1 commented 3 months ago

Just took a look at the binding, it seems to use the /api/v1/data endpoint.

lsiepel commented 3 months ago

I have created a fix by adding these channels (active_current + L1/L2/L3 and active_current + L1/L2/L3) Are you able to test?

  1. Upgrade openHAB to version 4.2 milestone 4.
  2. Uninstalled the bundled HomeWizard binding.
  3. Drop this jar in your addon folder: https://1drv.ms/u/s!AnMcxmvEeupwjvdWkLJWkKqrC259XA?e=a4KupC
  4. Without re-creating the Thing, you should now have all new channels listed at the Thing in openHAB.

Can you confirm all channels are available (this tests upgrade instructions) and have the proper value (this tests the mapping) ?

NickB1 commented 3 months ago

Hi, thanks for the fast update! The voltages seem to be working. For the linked number items to the currents I get an UNDEF: image These are my items, maybe I did something wrong here? image

lsiepel commented 3 months ago

Current is in AMP not Volt, so the unit label is wrong in your definition file.

NickB1 commented 3 months ago

Ah yes, copy paste error, working fine now. I'm only seeing the same current on all three phases. I looked at the PR, maybe this is the error, getActiveCurrentL1() is used for the three phases: image

Summm1t commented 2 months ago

Thanks for picking this up!

I was also creating something for Homewizard at the same time, and would also create a PR, but I think I can better wait and incorporate your changes. However, you'll need to pass the checks of the CI build (which currently aren't).

I also want to add the Homewizard socket, water meter and KWH meters (1P and 3P). These products don't work currently, because the handler will only work when the meter_model has some value in it (HomeWizardHandler.java:146-149). Only the P1 meter will have this meter_model.

There was also an interesting PR some years ago, made by the founder of the Homewizard add-on: https://github.com/openhab/openhab-addons/pull/13495/files It's a pitty that this PR wasn't merged, because this one also handles the other Homewizard products.

lsiepel commented 2 months ago

Updated jar: https://1drv.ms/u/s!AnMcxmvEeupwjvhXkfIKBYTP1txbyg?e=BFXq1Q (4.3.0 snapshot, should be compatible with 4.2 stable)

Fixed the issue @NickB1 reporeted, also added two more channels (any power failure count + long power failure count)

NickB1 commented 2 months ago

Current looks good now, thanks!

lsiepel commented 1 month ago

Thanks for picking this up!

I was also creating something for Homewizard at the same time, and would also create a PR, but I think I can better wait and incorporate your changes. However, you'll need to pass the checks of the CI build (which currently aren't).

I also want to add the Homewizard socket, water meter and KWH meters (1P and 3P). These products don't work currently, because the handler will only work when the meter_model has some value in it (HomeWizardHandler.java:146-149). Only the P1 meter will have this meter_model.

There was also an interesting PR some years ago, made by the founder of the Homewizard add-on: https://github.com/openhab/openhab-addons/pull/13495/files It's a pitty that this PR wasn't merged, because this one also handles the other Homewizard products.

Trying to bring that PR to the finish line. If possible, would you be able to test that PR? Unfortunately it does not have the added channels from this issue, but it is just for testing.

Summm1t commented 1 month ago

Thanks for picking this up! I was also creating something for Homewizard at the same time, and would also create a PR, but I think I can better wait and incorporate your changes. However, you'll need to pass the checks of the CI build (which currently aren't). I also want to add the Homewizard socket, water meter and KWH meters (1P and 3P). These products don't work currently, because the handler will only work when the meter_model has some value in it (HomeWizardHandler.java:146-149). Only the P1 meter will have this meter_model. There was also an interesting PR some years ago, made by the founder of the Homewizard add-on: https://github.com/openhab/openhab-addons/pull/13495/files It's a pitty that this PR wasn't merged, because this one also handles the other Homewizard products.

Trying to bring that PR to the finish line. If possible, would you be able to test that PR? Unfortunately it does not have the added channels from this issue, but it is just for testing.

I personally don't have a P1 meter, that's why I want to add the other meters. So I cannot test the PR in a real-world situation.

lsiepel commented 1 month ago

Thanks for picking this up! I was also creating something for Homewizard at the same time, and would also create a PR, but I think I can better wait and incorporate your changes. However, you'll need to pass the checks of the CI build (which currently aren't). I also want to add the Homewizard socket, water meter and KWH meters (1P and 3P). These products don't work currently, because the handler will only work when the meter_model has some value in it (HomeWizardHandler.java:146-149). Only the P1 meter will have this meter_model. There was also an interesting PR some years ago, made by the founder of the Homewizard add-on: https://github.com/openhab/openhab-addons/pull/13495/files It's a pitty that this PR wasn't merged, because this one also handles the other Homewizard products.

Trying to bring that PR to the finish line. If possible, would you be able to test that PR? Unfortunately it does not have the added channels from this issue, but it is just for testing.

I personally don't have a P1 meter, that's why I want to add the other meters. So I cannot test the PR in a real-world situation.

So you don’t own any homewizard devices?

Summm1t commented 1 month ago

Thanks for picking this up! I was also creating something for Homewizard at the same time, and would also create a PR, but I think I can better wait and incorporate your changes. However, you'll need to pass the checks of the CI build (which currently aren't). I also want to add the Homewizard socket, water meter and KWH meters (1P and 3P). These products don't work currently, because the handler will only work when the meter_model has some value in it (HomeWizardHandler.java:146-149). Only the P1 meter will have this meter_model. There was also an interesting PR some years ago, made by the founder of the Homewizard add-on: https://github.com/openhab/openhab-addons/pull/13495/files It's a pitty that this PR wasn't merged, because this one also handles the other Homewizard products.

Trying to bring that PR to the finish line. If possible, would you be able to test that PR? Unfortunately it does not have the added channels from this issue, but it is just for testing.

I personally don't have a P1 meter, that's why I want to add the other meters. So I cannot test the PR in a real-world situation.

So you don’t own any homewizard devices?

I have Wi-Fi kWh meter 3-phase MID and Energy Socket