Philips Somneo Wakeup Light in HA

Sorry for my late reply. I’m using Wyleks smartsleep one. Here’s some more from the logs:

  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, in async_device_update
    raise exc
  File "/config/custom_components/smartsleep/light.py", line 171, in async_update
    self._state, self._brightness = self._data.somneo.sunset_status()
AttributeError: 'Somneo' object has no attribute 'sunset_status'
2023-01-04 17:42:22.259 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.smartsleep_sunset fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, in async_device_update
    raise exc
  File "/config/custom_components/smartsleep/light.py", line 171, in async_update
    self._state, self._brightness = self._data.somneo.sunset_status()
AttributeError: 'Somneo' object has no attribute 'sunset_status'
2023-01-04 17:42:36.344 ERROR (MainThread) [homeassistant.components.system_log.external] Online
2023-01-04 17:42:52.260 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.smartsleep_sunset fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, in async_device_update
    raise exc
  File "/config/custom_components/smartsleep/light.py", line 171, in async_update
    self._state, self._brightness = self._data.somneo.sunset_status()```

In the pysomneo library I added the ability to set the PowerWake, but I never added it to the HomeAssistant integration. I was also under the impression that the PowerWake time was a delta, but apparently it is not, so I need to add some logic to properly adjust the PowerWake time when the alarm is changed. When I have some time, I can have a look to implement it, shouldn’t be to difficult I guess.

Yes I also thought it is a delta. It is used as a delta in the app but in the fact not. And there is also no logic in the Somneo to make the power wake time to follow a modified alarm. All the logic is made in the app side and sent to the device.

I will be very grateful if you find time to make this addition in the integration. I use it almost everyday as my wake-up is not the easiest :joy:

Good work on getting the Somneo light into HA. I just started to experiment with this.
Is it correct that the ligth during the wakeup phase is not showing in the two light entities, that is they remain off (light+night light) ?

Hi @theneweinstein congrats for adding services to change the light and sounds! Why did you create services and not entities ? Is it because you found the API to set light and sound but you cannot retrieve the information ?
Congrats again !

I created a version that supports the powerwake for testing. If you install the master branch via HACS it should work. I did some test myself and it seems to work, but I’'m not a heavy use of powerwake. If you could test it and let me know if it functions as expected, then I will release a new version supporting this.

Yes, indeed. Unfortenately during the wake-up phase the lights remain off in HA, would have been nice to trigger some automations otherwise.

Hi @arnoN7, I created services as I wanted to see how that would work :slight_smile:. Furthermore it would make the entities explode and likely you only change it every so often. However, there is no reason not to convert it into entities (you can retrieve the current settings from the API).

Thank you very much for you reactivity.
I made some tests and it seems to work as intended now. I will test it a bit more during the following days.

I don’t know if I should post on Github or here.
When I first used the integration it created 15 alarms (I think I had only 6 or 7 in the App). After playing with it I can set the most used alarms from an automation. I cleaned up the original App to have only 2 alarms remaining.
The Integration didn’t update the number of alarms so I tried deleting them with the servicecall which gives me a "unknown URL’.
Would I need to re-install the integration to get those other 12 alarms away?

The new version 3.1.6 solves the problem !
Thanks @theneweinstein

sorry…maybe its my fault. but i cant controll the brightness.
am i blind or the feature is gone?

I just noticed that the ‘somneo alarm status’ becomes unkown as soon as the alarm triggers, (light starts to go up) when the alarm is acknowledged on the lamp it gets back to "turned off’.
Can I check somewhere what the ‘unknown’ response from my lamp is?