Metainformationen zur Seite
  •  

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
home_assistant:home_assistant_rezepte:wled_fortschritt [08.03.2026] – markhome_assistant:home_assistant_rezepte:wled_fortschritt [07.11.2026] (aktuell) – mark
Zeile 1: Zeile 1:
 ====== WLED Druckfortschritt Anzeige ====== ====== WLED Druckfortschritt Anzeige ======
  
-===== Für einen Drucker =====+===== Für einen oder mehrere Drucker als Blueprint =====
  
-==== configuration.yaml ==== +Hierzu mit dem HA Editor eurer Wahl config -> blueprints -> automation einen eigenen Ordner anlegen.\\ 
- +darin z.B. eine Datei wled_print_progress.yaml und den unteren Inhalt einfügen.
-  * wled_segment_percent: kann verändert werden, muss nur eindeutig sein. +
-  * id: die ID Nr. des zu steurnden Segments, default wäre 0 +
-  * fx: ist die laufende Nr. der Anmiation in WLED, in diesem Fall müssen wir "Percent" nutzen +
-  * bri: die Helligkeit der LEDs +
-  * ix: wie viele LEDs sollen leuchten, der Wert wird dann aus der Automation (siehe unten) gesetzt+
  
 <code> <code>
- rest_command: +blueprint: 
-  wled_segment_percent: +  name: WLED print progress (multi printer, rotating) 
-    url: "http://172.16.10.233/json/state" +  description: 'Shows the progress of up to 4 printers on one WLED segment (Percent 
-    method: POST +    effect). Active printers are shown one after another, each for the chosen interval, 
-    headers: +    each in its own color. Printers that are idle/offline are skipped. When no printer 
-      Content-Type: application/json +    is printing, an optional idle preset or idle effect is applied. Leave the entities 
-    payload:> +    of unused printer slots empty.
-      { +
-        "seg":[ +
-          { +
-            "id":1, +
-            "on":true, +
-            "fx":98, +
-            "bri":100, +
-            "ix":{{ ix }} +
-          } +
-        ] +
-      }+
  
-</code>+    ' 
 +  domain: automation 
 +  input: 
 +    segment_light: 
 +      name: WLED segment (light) 
 +      description: Light entity of the segment used for the progress bar (not the 
 +        main segment). 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - light 
 +          integration: wled 
 +          multiple: false 
 +          reorder: false 
 +    intensity_entity: 
 +      name: WLED segment intensity (number) 
 +      description: Intensity entity of the same segment. 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - number 
 +          integration: wled 
 +          multiple: false 
 +          reorder: false 
 +    interval: 
 +      name: Display time per printer (seconds) 
 +      default: 5 
 +      selector: 
 +        number: 
 +          min: 1.0 
 +          max: 120.0 
 +          unit_of_measurement: s 
 +          mode: box 
 +          step: 1.0 
 +    inactive_states: 
 +      name: States that count as "not printing" 
 +      default: 
 +      - idle 
 +      - offline 
 +      - finish 
 +      - unknown 
 +      - unavailable 
 +      selector: 
 +        text: 
 +          multiple: true 
 +          multiline: false 
 +    idle_preset_entity: 
 +      name: Idle - WLED preset selector (optional) 
 +      description: 'Preset select entity of the WLED device. Note: a preset applies 
 +        to the whole device, not just this segment. Takes priority over the idle effect.
  
-==== Automation erstellen ====+        ' 
 +      default: '' 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - select 
 +          integration: wled 
 +          multiple: false 
 +          reorder: false 
 +    idle_preset_name: 
 +      name: Idle - preset name 
 +      description: Exact name of the preset to apply when no printer is printing. 
 +      default: '' 
 +      selector: 
 +        text: 
 +          multiline: false 
 +          multiple: false 
 +    idle_effect: 
 +      name: Idle - segment effect (optional) 
 +      description: 'Effect name for the progress segment when no printer is printing, 
 +        e.g. Rainbow. Only used if no idle preset is set. If both are empty, the segment 
 +        is turned off.
  
-Neue Automation erstellen, danach oben rechts die drei Punkte klicken und in yaml bearbeiten. \\ Dann den Inhalt ersetzen. +        ' 
- +      default: '' 
-  * alias: kann frei vergeben weredn, sollte eindeutig sein +      selector: 
-  * entity_id: vorher aus der Bambuintegration auslesen und entsprechend anpassen oder umstellen auch "im visuaellen editior bearbeiten" und dann einfach auswählen. +        text: 
-  * actions → data → action: muss zum obigen namen unter "rest_command" passen +          multiline: false 
-  * variables → ix: hierzu die selbe id wie unter entity_id eintragen, zur Not wieder vom Editior in yaml bearbeietn wechseln. +          multiple: false 
- +    p1_status: 
-<code> +      name: Printer 1 - status 
-alias: WLED Druckfortschritt anzeigen+      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p1_progress: 
 +      name: Printer 1 - progress (%) 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p1_color: 
 +      name: Printer 1 - color 
 +      default: 
 +      - 0 
 +      - 0 
 +      - 255 
 +      selector: 
 +        color_rgb: {} 
 +    p2_status: 
 +      name: Printer 2 - status (optional) 
 +      default: '' 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p2_progress: 
 +      name: Printer 2 - progress (%) (optional) 
 +      default: '' 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p2_color: 
 +      name: Printer 2 - color 
 +      default: 
 +      - 0 
 +      - 255 
 +      - 0 
 +      selector: 
 +        color_rgb: {} 
 +    p3_status: 
 +      name: Printer 3 - status (optional) 
 +      default: '' 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p3_progress: 
 +      name: Printer 3 - progress (%) (optional) 
 +      default: '' 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p3_color: 
 +      name: Printer 3 - color 
 +      default: 
 +      - 255 
 +      - 0 
 +      - 0 
 +      selector: 
 +        color_rgb: {} 
 +    p4_status: 
 +      name: Printer 4 - status (optional) 
 +      default: '' 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p4_progress: 
 +      name: Printer 4 - progress (%) (optional) 
 +      default: '' 
 +      selector: 
 +        entity: 
 +          domain: 
 +          - sensor 
 +          multiple: false 
 +          reorder: false 
 +    p4_color: 
 +      name: Printer 4 - color 
 +      default: 
 +      - 255 
 +      - 255 
 +      - 0 
 +      selector: 
 +        color_rgb: {} 
 +mode: restart 
 +max_exceeded: silent 
 +trigger_variables: 
 +  inactive_states: !input inactive_states 
 +  s1: !input p1_status 
 +  s2: !input p2_status 
 +  s3: !input p3_status 
 +  s4: !input p4_status 
 +  status_entities: '{{ [s1, s2, s3, s4] | select | list }}' 
 +variables: 
 +  inactive_states: !input inactive_states 
 +  idle_preset_entity: !input idle_preset_entity 
 +  idle_preset_name: !input idle_preset_name 
 +  idle_effect: !input idle_effect 
 +  s1: !input p1_status 
 +  s2: !input p2_status 
 +  s3: !input p3_status 
 +  s4: !input p4_status 
 +  pr1: !input p1_progress 
 +  pr2: !input p2_progress 
 +  pr3: !input p3_progress 
 +  pr4: !input p4_progress 
 +  c1: !input p1_color 
 +  c2: !input p2_color 
 +  c3: !input p3_color 
 +  c4: !input p4_color 
 +  printers: "{{ [\n  {'status': s1, 'progress': pr1, 'color': c1},\n  {'status': s2, 
 +    'progress': pr2, 'color': c2},\n  {'status': s3, 'progress': pr3, 'color': c3},\n 
 +    \ {'status': s4, 'progress': pr4, 'color': c4}\n] | selectattr('status') | list 
 +    }}"
 triggers: triggers:
-  - entity_id: sensor.p2s_22e8ba570400048_druckfortschritt +- trigger: template 
-    trigger: state+  value_template: '{{ status_entities | map(''states'') | reject(''in'', inactive_states) 
 +    | list | count> 0 }}' 
 +- trigger: template 
 +  value_template: '{{ status_entities | map(''states'') | reject(''in'', inactive_states) 
 +    | list | count == 0 }}' 
 +- trigger: homeassistant 
 +  event: start
 actions: actions:
-  - data: +- repeat: 
-      ix: "{{ ix }}" +    while: 
-    action: rest_command.wled_segment_percent +    - condition: template 
-mode: restart +      value_template: '{{ printers | map(attribute=''status'') | map(''states'') | 
-variables: +        reject(''in'', inactive_states) | list | count> 0 }}' 
-  ix: "{{ states('sensor.p2s_22e8ba570400048_druckfortschritt') | int }}"+    sequence: 
 +    - repeat: 
 +        for_each: '{{ printers }}' 
 +        sequence: 
 +        - if: 
 +          - condition: template 
 +            value_template: '{{ states(repeat.item.status) not in inactive_states 
 +              }}' 
 +          then: 
 +          - action: number.set_value 
 +            target: 
 +              entity_id: !input intensity_entity 
 +            data: 
 +              value: '{{ [[states(repeat.item.progress) | float(0) | int, 0] | max, 
 +                99] | min }}' 
 +          - action: light.turn_on 
 +            target: 
 +              entity_id: !input segment_light 
 +            data: 
 +              effect: Percent 
 +              rgb_color: '{{ repeat.item.color }}' 
 +          - delay: 
 +              seconds: !input interval 
 +- choose: 
 +  - conditions: 
 +    - condition: template 
 +      value_template: '{{ idle_preset_entity != '''' and idle_preset_name != '''' 
 +        }}' 
 +    sequence: 
 +    - action: select.select_option 
 +      target: 
 +        entity_id: '{{ idle_preset_entity }}' 
 +      data: 
 +        option: '{{ idle_preset_name }}' 
 +  - conditions: 
 +    - condition: template 
 +      value_template: '{{ idle_effect != '''' }}' 
 +    sequence: 
 +    - action: light.turn_on 
 +      target: 
 +        entity_id: !input segment_light 
 +      data: 
 +        effect: '{{ idle_effect }}' 
 +  default: 
 +  - action: light.turn_off 
 +    target: 
 +      entity_id: !input segment_light
  
 </code> </code>