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

Adjustable brightness levels and Moodlight defaults #12

Closed
nagyrobi opened this issue Mar 14, 2021 · 7 comments
Closed

Adjustable brightness levels and Moodlight defaults #12

nagyrobi opened this issue Mar 14, 2021 · 7 comments

Comments

@nagyrobi
Copy link
Collaborator

nagyrobi commented Mar 14, 2021

Would be nice to have these configurable from yaml, as more plates can be present in the system and they may require different settings:

  • a service to set the idle_brightness and awake_brightness dynamically at HA runtime. To use with automations which could monitor light conditions in the room.
  • a default color for moodlight (specific to that room, for example) + service to change it
  • an option to switch moodlight on before turning screen off (now possible with automation, but can be triggered only after the screen turns off thus the unit blinks through full-dark for a moment, see below)
  • plates's short and long idle times (they are configurable form plate's web interface but would look nice to read them from there and set them from HA)
@nagyrobi
Copy link
Collaborator Author

nagyrobi commented Mar 14, 2021

Currently working (0.4.0-dev) moodlight switcher automations, which would work better if handled by component:

- alias: lanbon-moodlight-idle
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: sensor.plate_idle
      from: 'short'
      to: 'long'
  action:
    - service: mqtt.publish
      data:
        topic: hasp/plate/command/page
        payload: 1
    - service: mqtt.publish
      data:
        topic: hasp/plate/command/moodlight
        payload: '{"state":"ON","color":{"r":255,"g":0,"b":255}}'

- alias: lanbon-moodlight-idle-not
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: sensor.plate_idle
      from: 'long'
      to: 'off'
  action:
    - service: mqtt.publish
      data:
        topic: hasp/plate/command/moodlight
        payload: '{"state":"OFF","color":{"r":255,"g":0,"b":255}}'

@dgomes
Copy link
Collaborator

dgomes commented Mar 15, 2021

I will definitely implement moodlight as a HA light entity with all the associated services.

@nagyrobi
Copy link
Collaborator Author

Autodiscovery with 0.4.0-dev already does this for moodlight and backlight.

@nagyrobi
Copy link
Collaborator Author

But! Moodlight colors are forgotten between restarts.

@nagyrobi
Copy link
Collaborator Author

nagyrobi commented Mar 28, 2021

Tested with new component version:

  • turn on moodlight from HA entity (the one created by this component)
  • select a nice color
  • turn the moodlight on and off repeatedly from HA - everything's fine
  • reboot or power-cycle plate, wait for LWT to refresh the device
  • check moodlight entity: color forgotten.

@dgomes
Copy link
Collaborator

dgomes commented Mar 28, 2021

please check the latest release

@nagyrobi
Copy link
Collaborator Author

Color still forgotten by the component after power-cycling the plate.

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

2 participants