theneweinstein / pysomneo

GNU General Public License v3.0
9 stars 7 forks source link

Display settings #13

Open Nezz opened 1 year ago

Nezz commented 1 year ago

My wake up light has two display settings in the app:

Would it be possible to control these? I'd like enable always on during the day, but disable it during the night from Home Assistant.

Frank071 commented 8 months ago

These probably are brght (brightness) and dspon (true = always on) from the wusts call

Nezz commented 4 months ago

Thanks for adding support @theneweinstein. I gave it a try in home assistant. I noticed that when setting both the brightness and always on from the same automation, the first setting gets lost. Example:

  - service: number.set_value
    metadata: {}
    data:
      value: "1"
    target:
      entity_id: number.somneo_display_brightness
  - service: switch.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: switch.somneo_display_always_on

When the brightness is initially set to a different value, running this automation results in the newly set brightness being set for a split second, which gets reverted back to the initial setting by the always on switch.

Adding a two second delay between the two calls fixes the issue.