Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid keys since Mila server maintenance #37

Open
TomBrien opened this issue May 29, 2024 · 2 comments
Open

Invalid keys since Mila server maintenance #37

TomBrien opened this issue May 29, 2024 · 2 comments

Comments

@TomBrien
Copy link

Since the Mila server maintenance, I see a lot of error in the HA log relating to updating the pm25 sensor. These seem to happen when ever trying to set the fan speed or when the update coordinator tries to update the sensor. The PM25 sensor appear to have not worked since arounf 18:00 BST 28/05/24

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 414, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 492, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 543, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mila/entities/location/aqi_sensor.py", line 21, in native_value
    pm25: float = self.device.get_value("outdoorStation.sensor.latest.value")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mila/devices/device.py", line 85, in get_value
    return self._device_data[data_path]
           ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/__init__.py", line 54, in __getitem__
    super(benedict, self).__getitem__(key))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in __getitem__
    return super(KeypathDict, self).__getitem__(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 42, in __getitem__
    return self._getitem_by_keys(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/benedict/dicts/keylist/keylist_dict.py", line 49, in _getitem_by_keys
    raise KeyError('Invalid keys: "{}"'.format(keys))
KeyError: 'Invalid keys: "[\'outdoorStation\', \'sensor\', \'latest\', \'value\']"'
@ontibut
Copy link

ontibut commented Oct 13, 2024

ever find a solution to this?

@simbaja
Copy link
Collaborator

simbaja commented Nov 3, 2024

I'd suggest selecting a different station, sometimes they don't have updated values from what I've seen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants