lmatula / ha_chint_pm

homeassistant Chint power meter integration
Creative Commons Zero v1.0 Universal
13 stars 7 forks source link

unknown error #14

Closed valentusys closed 7 months ago

valentusys commented 7 months ago

Hello Thank you for your work! I'm trying to connect a PD666-2S3 electricity meter. I get the message 'unknown' when I try to add a counter to HA. image

In the logs the message is:

Traceback (most recent call last):
  File "/config/custom_components/chint_pm/config_flow.py", line 345, in async_step_setup_network
    info = await validate_network_setup(user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/chint_pm/config_flow.py", line 127, in validate_network_setup
    decoder = BinaryPayloadDecoder.fromRegisters(rr.registers, byteorder=Endian.Big)
                                                                         ^^^^^^^^^^
  File "/usr/local/lib/python3.11/enum.py", line 784, in __getattr__
    raise AttributeError(name) from None
AttributeError: Big

I tried to receive data manually via modbus - they work correctly.

The addresses seem to match your documentation

valentusys commented 7 months ago

Previously helped: Replacement in config_flow.py file lines: Endian.Big on the: Endian.BIG

Unfortunately, I don't know how to make a pull request yet :)

valentusys commented 7 months ago

After changing Big to BIG, the device was detected, but still does not work: 2023-12-01 20:50:39.540 WARNING (MainThread) [homeassistant.config_entries] Config entry 'dtsu666' for chint_pm integration not ready yet: Could not update values: 'meter_type'; Retrying in background

lmatula commented 7 months ago

Fixd in 0.0.4