Last active
December 6, 2025 22:15
-
-
Save gaetanars/136d0adea9f8609a13935ef973daace5 to your computer and use it in GitHub Desktop.
Blueprint HA pour l'affichage d'un capteur sur Awtrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: "Awtrix : Application perso (capteur)" | |
| description: "Permet de créer et gérer une app Awtrix basée sur un capteur" | |
| domain: automation | |
| homeassistant: | |
| min_version: 2024.6.0 | |
| input: | |
| awtrix_device: | |
| name: "Afficheur Awtrix" | |
| description: "Sélectionnez votre afficheur Awtrix 3" | |
| selector: | |
| device: | |
| integration: mqtt | |
| model: "AWTRIX 3" | |
| manufacturer: Blueforcer | |
| control_switch: | |
| name: "Interrupteur de contrôle" | |
| description: "L'interrupteur qui contrôle l'état de l'application" | |
| selector: | |
| entity: | |
| domain: input_boolean | |
| source_entity: | |
| name: "Source de données" | |
| description: "Entité numérique pour l'affichage (ex: sensor, input_number)" | |
| selector: | |
| entity: | |
| multiple: false | |
| domain: | |
| - sensor | |
| - input_number | |
| text_suffix: | |
| name: "Suffixe du texte" | |
| description: "Suffixe à afficher après la valeur du capteur" | |
| default: "" | |
| selector: | |
| text: | |
| text_prefix: | |
| name: "Préfixe du texte" | |
| description: "Préfixe à afficher avant la valeur du capteur" | |
| default: "" | |
| selector: | |
| text: | |
| icon: | |
| name: "Icône" | |
| description: "Nom de l'icône à afficher" | |
| default: "" | |
| selector: | |
| text: | |
| push_icon: | |
| name: "Comportement de l'icône" | |
| default: "2" | |
| selector: | |
| select: | |
| options: | |
| - label: "Fixe" | |
| value: "0" | |
| - label: "Défile une fois" | |
| value: "1" | |
| - label: "Défile et réapparaît" | |
| value: "2" | |
| text_case: | |
| name: "Casse du texte" | |
| default: "0" | |
| selector: | |
| select: | |
| options: | |
| - label: "Global" | |
| value: "0" | |
| - label: "Majuscules" | |
| value: "1" | |
| - label: "Tel quel" | |
| value: "2" | |
| background_color: | |
| name: "Couleur de fond" | |
| description: "Couleur RGB [R,G,B]" | |
| default: "[0,0,0]" | |
| selector: | |
| color_rgb: | |
| text_color: | |
| name: "Couleur du texte" | |
| description: "Couleur RGB [R,G,B]" | |
| default: "[255,255,255]" | |
| selector: | |
| color_rgb: | |
| use_threshold: | |
| name: "Utiliser un seuil" | |
| description: "Activer la coloration conditionnelle" | |
| default: false | |
| selector: | |
| boolean: | |
| threshold_value: | |
| name: "Valeur seuil" | |
| description: "Valeur pour le changement de couleur" | |
| default: 0 | |
| selector: | |
| number: | |
| mode: box | |
| step: 0.1 | |
| color_below: | |
| name: "Couleur si inférieur" | |
| description: "Couleur RGB si valeur < seuil" | |
| default: "[0,0,0]" | |
| selector: | |
| color_rgb: | |
| color_above: | |
| name: "Couleur si supérieur" | |
| description: "Couleur RGB si valeur > seuil" | |
| default: "[0,0,0]" | |
| selector: | |
| color_rgb: | |
| repeat: | |
| name: "Répétitions" | |
| description: "-1 pour utiliser la durée" | |
| default: -1 | |
| selector: | |
| number: | |
| min: -1 | |
| mode: box | |
| duration: | |
| name: "Durée (secondes)" | |
| description: "Durée d'affichage" | |
| default: 0 | |
| selector: | |
| number: | |
| min: 0 | |
| mode: box | |
| lifetime: | |
| name: "Durée de vie (secondes)" | |
| description: "Durée de vie de l'app" | |
| default: 0 | |
| selector: | |
| number: | |
| min: 0 | |
| mode: box | |
| autoscroll: | |
| name: "Défilement automatique" | |
| description: "Activer le défilement automatique" | |
| default: true | |
| selector: | |
| boolean: | |
| effect: | |
| name: "Effet" | |
| description: "Effet d'animation du texte" | |
| default: "" | |
| selector: | |
| select: | |
| options: | |
| - label: "Aucun" | |
| value: "" | |
| - label: "Fade" | |
| value: "Fade" | |
| - label: "MovingLine" | |
| value: "MovingLine" | |
| - label: "BrickBreaker" | |
| value: "BrickBreaker" | |
| - label: "PingPong" | |
| value: "PingPong" | |
| - label: "Radar" | |
| value: "Radar" | |
| - label: "Checkerboard" | |
| value: "Checkerboard" | |
| - label: "Fireworks" | |
| value: "Fireworks" | |
| - label: "PlasmaCloud" | |
| value: "PlasmaCloud" | |
| - label: "Ripple" | |
| value: "Ripple" | |
| - label: "Snake" | |
| value: "Snake" | |
| - label: "Pacifica" | |
| value: "Pacifica" | |
| - label: "TheaterChase" | |
| value: "TheaterChase" | |
| - label: "Plasma" | |
| value: "Plasma" | |
| - label: "Matrix" | |
| value: "Matrix" | |
| - label: "SwirlIn" | |
| value: "SwirlIn" | |
| - label: "SwirlOut" | |
| value: "SwirlOut" | |
| - label: "LookingEyes" | |
| value: "LookingEyes" | |
| - label: "TwinklingStars" | |
| value: "TwinklingStars" | |
| - label: "ColorWaves" | |
| value: "ColorWaves" | |
| trigger_variables: | |
| device_id: !input awtrix_device | |
| triggers: | |
| - trigger: state | |
| entity_id: !input control_switch | |
| - trigger: state | |
| entity_id: !input source_entity | |
| - trigger: template | |
| value_template: "{{ states((device_entities(device_id)|select('search','uptime')|list)[0])|int < 30 }}" | |
| - trigger: time_pattern | |
| minutes: "/15" | |
| variables: | |
| device_id: !input awtrix_device | |
| device_topic: "{{ states((device_entities(device_id) | select('search','device_topic') | list)[0] | default('unknown')) }}" | |
| source_entity: !input source_entity | |
| app_name: "{{ source_entity.split('.')[1] | replace('-', '_') }}" | |
| text_suffix: !input text_suffix | |
| text_prefix: !input text_prefix | |
| icon: !input icon | |
| push_icon: !input push_icon | |
| text_case: !input text_case | |
| background_color: !input background_color | |
| text_color: !input text_color | |
| use_threshold: !input use_threshold | |
| threshold_value: !input threshold_value | |
| color_below: !input color_below | |
| color_above: !input color_above | |
| repeat: !input repeat | |
| duration: !input duration | |
| lifetime: !input lifetime | |
| autoscroll: !input autoscroll | |
| effect: !input effect | |
| actions: | |
| - choose: | |
| - conditions: | |
| - condition: state | |
| entity_id: !input control_switch | |
| state: "on" | |
| sequence: | |
| - action: mqtt.publish | |
| data: | |
| topic: "{{ device_topic }}/custom/{{ app_name }}" | |
| payload: >- | |
| {% set value = states(source_entity, rounded=True) | default('') %} | |
| { | |
| "text": "{{ text_prefix }}{{ value }}{{ text_suffix }}", | |
| "icon": "{{ icon }}", | |
| "pushIcon": {{ push_icon }}, | |
| "textCase": {{ text_case }}, | |
| "background": {{ background_color }}, | |
| "color": {% if use_threshold %} | |
| {% if value | float < threshold_value | float %} | |
| {{ color_below }} | |
| {% else %} | |
| {{ color_above }} | |
| {% endif %} | |
| {% else %} | |
| {{ text_color }} | |
| {% endif %}, | |
| "repeat": {{ repeat }}, | |
| "duration": {{ duration }}, | |
| "lifetime": {{ lifetime }}, | |
| "noScroll": {{ 'false' if autoscroll else 'true' }} | |
| {% if effect != "" %}, | |
| "effect": "{{ effect }}" | |
| {% endif %} | |
| } | |
| default: | |
| - action: mqtt.publish | |
| data: | |
| topic: "{{ device_topic }}/custom/{{ app_name }}" | |
| payload: "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment