Git Product home page Git Product logo

Comments (3)

microraptor avatar microraptor commented on June 1, 2024 1

This happens, if no outdoor AQI is available. To fix it go in the Mila Cares App to Settings -> Your Hood -> Outdoor AQi -> Change and select a station with AQI by swiping left and right. If this doesn't fix the issue try adding the location again in the settings and add the mila to the new location.

Even if the outdoor AQI value is not interesting for a user, this is actually a big bug, because it makes the whole fan entity not work and some kind of exception handling is missing in the code.

from ha-mila.

freekeys avatar freekeys commented on June 1, 2024

Also getting this..

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/mila/devices/device.py:85
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 21:44:21 (5 occurrences)
Last logged: 21:47:58

[140376831107728] 'Invalid keys: "['outdoorStation', 'sensor', 'latest', 'value']"'
[140378013365776] 'Invalid keys: "['outdoorStation', 'sensor', 'latest', 'value']"'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 676, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 713, in _handle_entity_call
await result
File "/config/custom_components/mila/entities/appliance/fan.py", line 113, in async_turn_on
await self.async_set_preset_mode(PRESET_MODE_AUTOMAGIC)
File "/config/custom_components/mila/entities/appliance/fan.py", line 135, in async_set_preset_mode
await self.device.set_fan_mode(preset_mode)
File "/config/custom_components/mila/devices/appliance.py", line 69, in set_fan_mode
await self._coordinator.async_request_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 158, in async_request_refresh
await self._debounced_refresh.async_call()
File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 82, in async_call
await task
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 348, in _handle_coordinator_update
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 388, 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.10/site-packages/benedict/dicts/init.py", line 54, in getitem
super(benedict, self).getitem(key))
File "/usr/local/lib/python3.10/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in getitem
return super(KeypathDict, self).getitem(
File "/usr/local/lib/python3.10/site-packages/benedict/dicts/keylist/keylist_dict.py", line 42, in getitem
return self._getitem_by_keys(key)
File "/usr/local/lib/python3.10/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']"'

from ha-mila.

freekeys avatar freekeys commented on June 1, 2024

Logger: homeassistant.components.sensor
Source: custom_components/mila/devices/device.py:85
Integration: Sensor (documentation, issues)
First occurred: 20:56:58 (2 occurrences)
Last logged: 20:56:58

Error adding entities for domain sensor with platform mila
Error while setting up mila platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 673, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 777, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 388, 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.10/site-packages/benedict/dicts/init.py", line 54, in getitem
super(benedict, self).getitem(key))
File "/usr/local/lib/python3.10/site-packages/benedict/dicts/keypath/keypath_dict.py", line 36, in getitem
return super(KeypathDict, self).getitem(
File "/usr/local/lib/python3.10/site-packages/benedict/dicts/keylist/keylist_dict.py", line 42, in getitem
return self._getitem_by_keys(key)
File "/usr/local/lib/python3.10/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']"'

from ha-mila.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.