pa-innovation / ha-doppler Goto Github PK
View Code? Open in Web Editor NEWCustom Home Assistant component for Sandman Doppler clocks
License: MIT License
Custom Home Assistant component for Sandman Doppler clocks
License: MIT License
latest
This won't work as the way the service call currently works it requires color, name, volume, status, and sound. It would be great to just use this to update the time for an existing alarm
service: sandman_doppler.add_alarm
data:
time: "06:00:00"
id: 0
target:
entity_id: switch.alarm_clock_alarm_0_doppler_system_alarm
And even if I include all the required info to send a service call, it just ignores the id that is input and creates a new alarm on the next open id number:
service: sandman_doppler.add_alarm
data:
time: "06:30:00"
color:
- 255
- 0
- 0
name: Doppler System
volume: 100
status: set
sound: Harp.mp3
id: 0
target:
entity_id: switch.alarm_clock_alarm_0_doppler_system_alarm
The service to add new alarms will not edit existing alarms as it should based on the service description "Sets an Alarm on the Doppler. If the ID is unused, the alarm will be created as new. If the ID is in use, the existing alarm will be replaced." It will create new alarms on the next open id number no matter what is put in the service call.
Also, it would be great to only require the entity and id number for the service from this integration. This way, any parameter(s) of the alarm could be adjusted without having to reset all of them.
N/A
Version 0.0.0
My device firmware is 0.1714 Cyclops
This is my const.py file:
`"""Constants for Sandman Doppler Clocks."""
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"
`
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'
`
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.
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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.