#Is there an easier way to make this automation
9 messages · Page 1 of 1 (latest)
You can use a template to set the brightness ... you'll need to calculate how you want to translate the slider input to the brightness %
Looks like it already might be a standard 0-1 float, so just multiplying by 100 should do that for you
Like this?
automation:
- alias: "Adjust Light Brightness with Slider"
trigger:- platform: state
entity_id: sensor.brightness_slider
action: - service: light.turn_on
target:
entity_id: light.my_light
data:
brightness: >
{% set brightness = states('sensor.brightness_slider') | float %}
{{ (brightness * 2.55) | round(0) }}
- platform: state
my potentiometer value ranges from .02-.26
Hmm... no, that won't work if you want it to dim
brightness also goes from 0-255, whereas brightness_pct is 0-100
brightness_pct could be something like "{{ (((states('sensor.brightness_slider') | float) - 0.02) / 0.0024) | round() }}"
that was it thank you very much!!