custom-components / sensor.unifigateway

High level health status of UniFi Security Gateway devices via UniFi Controller
129 stars 40 forks source link

Problem since version 2024.2.2 #60

Open bucley opened 8 months ago

bucley commented 8 months ago

I can no longer get any information since the version of home assistant in 2024.2.2. Am I the only one or are other people in the same situation?

THANKS

bucley commented 8 months ago

Logger: homeassistant.helpers.template Source: helpers/template.py:2345 First occurred: 17:06:23 (16 occurrences) Last logged: 17:06:23

Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.unifi_status_www.attributes.xput_up }}' Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.unifi_status_www.attributes.speedtest_ping }}' Template variable error: 'None' has no attribute 'attributes' when rendering '{%- set time = states.sensor.unifi_status_www.attributes.uptime | int %} {%- set minutes = ((time % 3600) // 60) %} {%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %} {%- set hours = ((time % 86400) // 3600) %} {%- set hours = '{}hr '.format(hours) if hours > 0 else '' %} {%- set days = (time // 86400) %} {%- set days = '{}d '.format(days) if days > 0 else '' %} {{ 'Less than 1 min' if time < 60 else days + hours + minutes }}' Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.unifi_status_wlan.attributes.num_user }}' Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.sensor.unifi_status_lan.attributes.num_user }}'

geftactics commented 8 months ago

I am getting the following in main HA logs...

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1261, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 190, in wrapper
    result = method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/unifigateway/sensor.py", line 174, in update
    if sub['subsystem'] == self._sensor:
       ~~~^^^^^^^^^^^^^
TypeError: string indices must be integers, not 'str'
sthevenp commented 8 months ago

I have the same issue

plouf34 commented 7 months ago

Same for me to

Liionboy commented 7 months ago

same issue at me