mk-maddin / wattpilot-HA

This is a custom component to allow control of Fronius Wattpilot wallbox/electro vehicle charging devices in Homeassistant.
Apache License 2.0
52 stars 8 forks source link

Get ChargerProp: Charger does not have property: qsw #47

Closed tramperb closed 2 weeks ago

tramperb commented 1 month ago

Describe the issue you are experiencing On restart of HA (2024.6.3), the following errors are seen in the logs:

This error originated from a custom integration.

Logger: custom_components.wattpilot.utils
Source: custom_components/wattpilot/utils.py:123
integration: Fronius Wattpilot (documentation)
First occurred: 5:03:32 PM (3 occurrences)
Last logged: 5:03:32 PM

wattpilot - GetChargerProp: Charger does not have property: qsw
wattpilot - GetChargerProp: Charger does not have property: wcch
wattpilot - GetChargerProp: Charger does not have property: wccw
This error originated from a custom integration.

Logger: custom_components.wattpilot.entities
Source: custom_components/wattpilot/entities.py:49
integration: Fronius Wattpilot (documentation)
First occurred: 5:03:32 PM (3 occurrences)
Last logged: 5:03:32 PM

q-Watt - qsw: __init__: Charger does not have a property: qsw (maybe an attribute?)
q-Watt - wcch: __init__: Charger does not have a property: wcch (maybe an attribute?)
q-Watt - wccw: __init__: Charger does not have a property: wccw (maybe an attribute?)
Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:600
integration: Sensor (documentation, issues)
First occurred: 5:03:32 PM (3 occurrences)
Last logged: 5:03:32 PM

Error adding entity None for domain sensor with platform wattpilot
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 738, in _async_add_entity
    entity_name = entity.name
                  ^^^^^^^^^^^
  File "/config/custom_components/wattpilot/entities.py", line 88, in name
    return self._name
           ^^^^^^^^^^
AttributeError: 'ChargerSensor' object has no attribute '_name'. Did you mean: 'name'?
2024-06-18 17:03:32.105 ERROR (MainThread) [custom_components.wattpilot.utils] wattpilot - GetChargerProp: Charger does not have property: qsw
2024-06-18 17:03:32.105 ERROR (MainThread) [custom_components.wattpilot.entities] q-Watt - qsw: __init__: Charger does not have a property: qsw (maybe an attribute?)
2024-06-18 17:03:32.368 ERROR (MainThread) [custom_components.wattpilot.utils] wattpilot - GetChargerProp: Charger does not have property: wcch
2024-06-18 17:03:32.368 ERROR (MainThread) [custom_components.wattpilot.entities] q-Watt - wcch: __init__: Charger does not have a property: wcch (maybe an attribute?)
2024-06-18 17:03:32.370 ERROR (MainThread) [custom_components.wattpilot.utils] wattpilot - GetChargerProp: Charger does not have property: wccw
2024-06-18 17:03:32.370 ERROR (MainThread) [custom_components.wattpilot.entities] q-Watt - wccw: __init__: Charger does not have a property: wccw (maybe an attribute?)
2024-06-18 17:03:32.382 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity None for domain sensor with platform wattpilot
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 738, in _async_add_entity
entity_name = entity.name
^^^^^^^^^^^
File "/config/custom_components/wattpilot/entities.py", line 88, in name
return self._name
^^^^^^^^^^
AttributeError: 'ChargerSensor' object has no attribute '_name'. Did you mean: 'name'?
2024-06-18 17:03:32.385 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity None for domain sensor with platform wattpilot
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 738, in _async_add_entity
entity_name = entity.name
^^^^^^^^^^^
File "/config/custom_components/wattpilot/entities.py", line 88, in name
return self._name
^^^^^^^^^^
AttributeError: 'ChargerSensor' object has no attribute '_name'. Did you mean: 'name'?
2024-06-18 17:03:32.388 ERROR (MainThread) [homeassistant.components.sensor] Error adding entity None for domain sensor with platform wattpilot
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 738, in _async_add_entity
entity_name = entity.name
^^^^^^^^^^^
File "/config/custom_components/wattpilot/entities.py", line 88, in name
return self._name
^^^^^^^^^^
AttributeError: 'ChargerSensor' object has no attribute '_name'. Did you mean: 'name'?

What version of Wattpilot integration is installed Release 0.2.2

What version of Wattpilot are you using 22KW-V2

Let me know if you need a diagnostic.

mk-maddin commented 1 month ago

hm.. I cannot reproduce this but if the charger object does not have corresponding object, it seems during connection / init with the charger something went wrong. The diagnostics information to see what really is received from the integration would be absolutely helpful here.

tramperb commented 1 month ago

Diagnostic log config_entry-wattpilot-d44e6143feb5320924098d9109d24866.json

and debug log, after a restart home-assistant_wattpilot_2024-06-18T08-37-43.873Z.log

mk-maddin commented 1 month ago

Your wattpilot does not seem to provide the properties qsw (Webserver Queue); wcch (HTTP Clients) & wccw (WEBSOCKET Clients). All of them being diagnostics properties disabled by default configuration. I have enabled them for testing and checked the diagnostics on my Wattpilot devices, but they all provide these properties fully fine.

Due to this I checked your firmware and found that you are running 41.7 Current release I am aware of (and only one I get as latest when checking for update) is 40.7.

Is this some kind of beta release or where did you get it from?

tramperb commented 1 month ago

Aaah, good point! Yes, I'm running 41.7. It was provided by Fronius (loaded by them remotely) as a fix for an issue with Wattpilot on a mesh wLAN. The wattpilot struggled to provide data to Solar.web (even though it remained connected to the LAN and continued to provide data to HA via the wattpilot API). I've struggled to have any interaction with Fronius technical staff so I have no idea what might have been changed in 41.7 The update to 41.7 did appear to fix the immediate issue but data in Solar.web has started to be not reported again, intermittantly. So, I imagine, this can be closed (although it may resurface when/if 41.7 is released into the wild).

mk-maddin commented 1 month ago

okay - interesting thing :)

As said I think current quick fix should be to disable the three entities. - Please check

In regards to public release I see three options as of now:

  1. disable these three entities at all (breaking change). Don't think this would be a lot of an issue as I am not sure if there are really use cases where this numbers are used within automations/HA
  2. create a general filter for properties based on the firmware version - but this would be a bigger rewrite of update logic because the firmware version needs to be initialized previously to any other property
  3. quick n dirty - just filter these specific cases during entity init

    I am looking at this topic having the 38.5 firmware version update in mind, too, because there Fronius updated the type of "Lock level selection" entity from bool to Enum and situation of "manual fix" required is more or less the same.

tramperb commented 1 month ago

Yes, 1. would seem to be the appropriate solution for those three entities.

There is also the ChargerSensor _name error in the log :

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:600
integration: Sensor (documentation, issues)
First occurred: 9:34:07 PM (3 occurrences)
Last logged: 9:34:07 PM

Error adding entity None for domain sensor with platform wattpilot
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 600, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 738, in _async_add_entity
    entity_name = entity.name
                  ^^^^^^^^^^^
  File "/config/custom_components/wattpilot/entities.py", line 88, in name
    return self._name
           ^^^^^^^^^^
AttributeError: 'ChargerSensor' object has no attribute '_name'. Did you mean: 'name'?
WillooWisp commented 2 weeks ago

I have 0.2.2, updated today, against my Wattpilot Go 22 v2 with firmware 40.7 and get a lot of similar error...

2024-06-29 17:40:49.767 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:51.724 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:51.724 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:51.725 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:51.725 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:53.761 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:53.761 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:53.762 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:53.762 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:54.771 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:54.771 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:54.772 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:54.772 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:55.747 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:55.747 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError) 2024-06-29 17:40:55.748 ERROR (MainThread) [custom_components.wattpilot.entities] Wattpilot - tma: _async_update_validate_property failed: 'ChargerSensor' object has no attribute '_entity_cfg' (builtins.AttributeError) 2024-06-29 17:40:55.748 ERROR (MainThread) [custom_components.wattpilot.sensor] Wattpilot - tma: _async_update_validate_platform_state failed: 'ChargerSensor' object has no attribute '_state_enum' (builtins.AttributeError)

mk-maddin commented 2 weeks ago

your error messages look more like no reload of the integration after you updated the charger - did you do?