I am trying to set up an LED strip to be a progress bar for my 3d printer. I think the best way is to use an automation that is triggered on the “change in progress” of the printer.
I have the action setting and displaying the progress of the printer.
The problem is it does not change. it changes if I manually run the automation. either from setting a trigger time or “run automation”
tried calling a second automation from the first. including a delay. then calling the first from the second. that only ran twice.
Is there a better way than automation? How can I get the automation to run periodically?
this is my first HA project. So I don’t know if this is the best way.
Thank you for any suggestions.
Please post the YAML configuration of your automation so we can see what is going on. You can find the configuration from the Automation editor by clicking the expansion menu (3-dots) at the top right and select “Edit in YAML”. Copy the entire configuration and paste it in this thread.
alias: X1C PROGRESS
description: “”
triggers:
- type: value
device_id: 2ac8825144dbade3feac36cb9da25cf8
entity_id: 49033e832eb93b7f49eefcb0cdf330f6
domain: sensor
trigger: device
above: 0
below: 99999
conditions:
actions: - action: light.turn_on
metadata: {}
data:
rgb_color:
- 37
- 94
- 208
effect: Percent
brightness_pct: 25
target:
entity_id: light.wled_segment_2 - metadata: {}
data:
value: “{{ states(‘sensor.x1c_00m09a362400845_print_progress’) | float(0) }}”
target:
entity_id: number.wled_segment_2_intensity
action: number.set_value
mode: single
It looks like you may be misunderstanding how triggers work. The trigger you are using will only fire when the sensor’s value changes from something outside the range of 0-99999 to a value inside the range. It will not trigger on value changes within the range:
You will need to switch to a State trigger instead of a Device trigger to accomplish what you are trying to do:
triggers:
- trigger: state
entity_id: sensor.x1c_00m09a362400845_print_progress
to: ~
The trigger above will fire on every value change. By using the null character ~ in to
, attribute-change events will be filtered out, so that triggering will be limited to state changes.
thank you very much for your help!
my first attempt at pasting it failed. But after lots of trying other things I tried again. Now it works as intended.
I need to learn more about YAML syntax and commands. thanks again.