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

Error adding entity None for domain binary_sensor with platform sandman_doppler #6

Open
agarkauskas opened this issue Jun 29, 2024 · 0 comments

Comments

@agarkauskas
Copy link

Version of the custom_component

Version 0.0.0
My device firmware is 0.1714 Cyclops
This is my const.py file:

`"""Constants for Sandman Doppler Clocks."""

Base component constants

NAME = "Sandman Doppler"
DOMAIN = "sandman_doppler"

ATTR_DSN = "dsn"
ATTR_BUTTON = "button"
CONF_SUBTYPE = "subtype"

ATTR_DOPPLER_NAME = "doppler_name"

EVENT_BUTTON_PRESSED = f"{DOMAIN}_button_pressed"

SERVICE_SET_WEATHER_LOCATION = "set_weather_location"
SERVICE_ADD_ALARM = "add_alarm"
SERVICE_UPDATE_ALARM = "update_alarm"
SERVICE_DELETE_ALARM = "delete_alarm"
SERVICE_UPDATE_ALARM = "update_alarm"
SERVICE_SET_MAIN_DISPLAY_TEXT = "set_main_display_text"
SERVICE_SET_MINI_DISPLAY_NUMBER = "set_mini_display_number"
SERVICE_SET_RAINBOW_MODE = "set_rainbow_mode"
SERVICE_ACTIVATE_LIGHT_BAR_BLINK = "activate_light_bar_blink"
SERVICE_ACTIVATE_LIGHT_BAR_COMET = "activate_light_bar_comet"
SERVICE_ACTIVATE_LIGHT_BAR_PULSE = "activate_light_bar_pulse"
SERVICE_ACTIVATE_LIGHT_BAR_SET = "activate_light_bar_set"
SERVICE_ACTIVATE_LIGHT_BAR_SET_EACH = "activate_light_bar_set_each"
SERVICE_ACTIVATE_LIGHT_BAR_SWEEP = "activate_light_bar_sweep"
`

Configuration

Core 2024.6.4
Supervisor 2024.06.2
Operating System 12.4
Frontend 20240610.1

Add your logs here.

2024-06-28 23:31:03.942 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entity None for domain binary_sensor with platform sandman_doppler 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 828, in _async_add_entity original_icon=entity.icon, ^^^^^^^^^^^ File "/config/custom_components/sandman_doppler/binary_sensor.py", line 93, in icon return self.ed.icon_lambda(self.is_on) ^^^^^^^^^^ File "/config/custom_components/sandman_doppler/binary_sensor.py", line 87, in is_on return self.device_data[self.ed.state_key] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ KeyError: 'is_in_day_mode'

`

Describe the bug

After adding the integration and adding my Sandman Doppler device I can see the entities properly populated but after some time (1 hour) all the entities become disabled.
When I check the logs I can see several errors adding the entities, I will paste some examples here.

Debug log

2024-06-28 23:31:03.854 DEBUG (MainThread) [custom_components.sandman_doppler] Finished getting update for device Acordador (Doppler-189cc072) 2024-06-28 23:31:03.942 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entity None for domain binary_sensor with platform sandman_doppler 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 828, in _async_add_entity original_icon=entity.icon, ^^^^^^^^^^^ File "/config/custom_components/sandman_doppler/binary_sensor.py", line 93, in icon return self.ed.icon_lambda(self.is_on) ^^^^^^^^^^ File "/config/custom_components/sandman_doppler/binary_sensor.py", line 87, in is_on return self.device_data[self.ed.state_key] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ KeyError: 'is_in_day_mode' 2024-06-28 23:31:03.945 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entity binary_sensor.acordador_alexa for domain binary_sensor with platform sandman_doppler 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 914, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.__async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1061, in __async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1006, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 296, in state if (is_on := self.is_on) is None: ^^^^^^^^^^ File "/config/custom_components/sandman_doppler/binary_sensor.py", line 87, in is_on return self.device_data[self.ed.state_key] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ KeyError: 'connected_to_alexa' 2024-06-28 23:31:03.949 ERROR (MainThread) [homeassistant.components.light] Error adding entity light.acordador_day_display for domain light with platform sandman_doppler 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 914, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.__async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1063, in __async_calculate_state if state_attributes := self.state_attributes: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 1199, in state_attributes data[ATTR_BRIGHTNESS] = self.brightness ^^^^^^^^^^^^^^^ File "/config/custom_components/sandman_doppler/light.py", line 253, in brightness brightness = self.device_data[self.ed.brightness_key] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'day_display_brightness' 2024-06-28 23:31:03.954 ERROR (MainThread) [homeassistant.components.light] Error adding entity light.acordador_night_display for domain light with platform sandman_doppler 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 914, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.__async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1063, in __async_calculate_state if state_attributes := self.state_attributes: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 1199, in state_attributes data[ATTR_BRIGHTNESS] = self.brightness ^^^^^^^^^^^^^^^ File "/config/custom_components/sandman_doppler/light.py", line 253, in brightness brightness = self.device_data[self.ed.brightness_key] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'night_display_brightness' 2024-06-28 23:31:03.959 ERROR (MainThread) [homeassistant.components.light] Error adding entity light.acordador_day_button for domain light with platform sandman_doppler 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 914, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1355, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1000, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1126, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.__async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1063, in __async_calculate_state if state_attributes := self.state_attributes: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 1199, in state_attributes data[ATTR_BRIGHTNESS] = self.brightness ^^^^^^^^^^^^^^^ File "/config/custom_components/sandman_doppler/light.py", line 253, in brightness brightness = self.device_data[self.ed.brightness_key] ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'day_button_brightness'

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

1 participant