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

Upgrade to change the brightness from HA #19

Open
casamarbar opened this issue Nov 9, 2022 · 1 comment
Open

Upgrade to change the brightness from HA #19

casamarbar opened this issue Nov 9, 2022 · 1 comment

Comments

@casamarbar
Copy link

Thanks for your job
It would be possible to add a sensor to be able to change the brightness from HA of the screen?

@c99koder
Copy link

c99koder commented Feb 6, 2023

Create an input_number helper entity in Home Assistant called lcd_brightness that stores a value between 0 and 100, and then add the following to your esphome config to set the backlight level when the value changes:

sensor:
  - platform: axp192
    id: backlight
    

  - platform: homeassistant
    id: brightness
    entity_id: input_number.lcd_brightness
    internal: true
    on_value:
      then:
        lambda: |-
          id(backlight).set_brightness(id(brightness).state/100.0);
          id(backlight).update();

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