claudegel / sinope-zha

This is a custom quirks for sinope zigbee devices for testing before it is added to zha-device-handlers. It also explain how to setup those quirks in Home Assistant to use and test them before they are merged in zha-device-handlers
GNU General Public License v2.0
26 stars 5 forks source link

Cannot get energy usage from SP2600ZB #49

Open houlejm opened 2 months ago

houlejm commented 2 months ago

If I try to add energy usage from SP2600ZB to homeassistant energy dashboard it does not work. From https://www.home-assistant.io/docs/energy/faq/#troubleshooting-missing-entities I see that the sensor is missing some attributes.

Capture d’écran du 2024-08-31 11-59-06

I can get around the problem with a template:

This new sensor works.

Capture d’écran du 2024-08-31 14-03-15

Thanks

claudegel commented 2 months ago

it is just because in your zha sensor sensor.interrupteur_prise_1_summation_delivered there is no unique_id attribute without unique_id the energy dashboard do not monitor it.

state_class: total_increasing
zcl_unit_of_measurement: 0
status: NO_ALARMS
device_type: Electric Metering
unit_of_measurement: kWh
device_class: energy
friendly_name: Prise video Summation delivered

We are working on code remanufacturing in ZHA and I'll check to see if I can add unique_id attribute. Until that you will need to create specific sensor with unique_id to monitor your energy

houlejm commented 2 months ago

I do not believe that the unique_id is the reason. I tested that by removing the unique in the template that works and it still works.

It is more the device attributes that are missing: state_class: total_increasing device_class: energy unit_of_measurement: "kWh" as documented in: https://www.home-assistant.io/docs/energy/faq/#troubleshooting-missing-entities

I have a RM3500ZB that works ok without using a template and that SP2600ZB used to work in the energy dashboard.

Anyway, I am OK for now. Keep the good work with ZHA and Sinope

claudegel commented 2 months ago

What is the quirk name for your device SP2600ZB, Quirk: switch.SinopeTechnologiesSwitch ? or Quirk: switch.SinopeTechnologiesSwitch_V2 Can you make a device scan with ZHA 🧰 Toolkit: Scan Device and send me the file it will create in config/scans

houlejm commented 2 months ago

Tel que demandé: Quirk: zhaquirks.sinope.switch.SinopeTechnologiesSwitch_V2

SP2600ZB_Sinope-Technologies_0018471abf_scan_results.txt

JM P.S. Would you like to have the device in your hands?

claudegel commented 2 months ago

No I already have many SP2600ZB. I'll check if we can add sensor for summation_delivered with all the attributes it need to be usable by the energy daskboard directly in ZHA. As there is a lot of code changed in ZHA now it could take a little time. You can have a look at zha-toolkit. With it you can create a sensor from any cluster/attribute and it will update the data automatically.