Awtrix et monitoring de la conso électrique +production solaire + temperature + TEMPO Rouge

Salut,
Profitant du deal dealabs j’ai acquis Ulanzi TC001. J’y ai mis Awtrix et tout est devenu possible :grin:
Grace au ChatGPT :robot: j’au pu créer une belle automatisation qui permet de monitorer la consommation de l’éléctricité du réseau, la température extérieur et la production solaire dans un cycle de 40 secondes. La consommation de l’éléctricité du réseau est rafraichit toutes les 5 secondes pendant 30 secondes, ensuite j’affiche le température pendant 5 secondes et à la fin la production solaire ( uniquement quand la production > 3w, autrement j’affiche la consommation de l’éléctricité du réseau à la place).
Et la cerise sur le gâteau, j’indique également quand le tarif TEMPO est Rouge.
Franchement je suis hyper content car grace au ChatGPT on peut créer des automatisations qu’on aurait jamais pu faire sans cette aide (en tout cas pour ceux qui connaissent pas le code).
Je partage ici le code pour ceux qui voudrait s’en inspirer:

alias: awtrix display power, solar, temperature, Tempo
description: ""
trigger:
  - platform: time_pattern
    seconds: /5
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: |
              {{ (now().minute * 60 + now().second) % 40 < 30 }}
        sequence:
          - service: mqtt.publish
            data:
              qos: "0"
              topic: awtrix_3dd9e4/custom/solar
              payload_template: |
                {
                  "icon": "49776",
                  "text": "{{ states('sensor.pin_rest') | round }}W",
                  "duration": 5
                }
              retain: true
      - conditions:
          - condition: template
            value_template: >
              {{ (now().minute * 60 + now().second) % 40 >= 30 and (now().minute
              * 60 + now().second) % 40 < 35 }}
        sequence:
          - service: mqtt.publish
            data:
              qos: "0"
              topic: awtrix_3dd9e4/custom/solar
              payload_template: |
                {
                  "icon": "2056",
                  "text": "{{ states('sensor.lumi_ext_temperature') }}°C",
                  "duration": 5
                }
              retain: true
      - conditions:
          - condition: template
            value_template: >
              {{ (now().minute * 60 + now().second) % 40 >= 35 and (now().minute
              * 60 + now().second) % 40 < 40 }}
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: >
                      {{
                      states('sensor.envoy_122321034989_current_power_production')
                      | float > 3 }}
                sequence:
                  - service: mqtt.publish
                    data:
                      qos: "0"
                      topic: awtrix_3dd9e4/custom/solar
                      payload_template: |
                        {
                          "icon": "27283",
                          "text": "{{ states('sensor.envoy_122321034989_current_power_production') | round }}W",
                          "duration": 5
                        }
                      retain: true
              - conditions:
                  - condition: template
                    value_template: >
                      {{
                      states('sensor.envoy_122321034989_current_power_production')
                      | float <= 3 }}
                sequence:
                  - service: mqtt.publish
                    data:
                      qos: "0"
                      topic: awtrix_3dd9e4/custom/solar
                      payload_template: |
                        {
                          "icon": "49776",
                          "text": "{{ states('sensor.pin_rest') | round }}W",
                          "duration": 5
                        }
                      retain: true
  - choose:
      - conditions:
          - condition: template
            value_template: |
              {{ (now().minute * 60 + now().second) % 40 == 0 }}
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: sensor.tempo_aujourd_hui
                    state: TEMPO_ROUGE
                sequence:
                  - service: light.turn_on
                    target:
                      entity_id: light.awtrix_3dd9e4_indicator_1
                    data: {}
              - conditions:
                  - condition: not
                    conditions:
                      - condition: state
                        entity_id: sensor.tempo_aujourd_hui
                        state: TEMPO_ROUGE
                sequence:
                  - service: light.turn_off
                    target:
                      entity_id: light.awtrix_3dd9e4_indicator_1
                    data: {}
mode: single

Voici ce que ça donne:
Tempo

8 « J'aime »

hello merci pour le partage ,

pour ma part j’ai modifier en affectant 1 topic diffèrent a chaques affichage /solar /cptlinky /tempext et ca marche mieux , les valeurs ne se croisent pas dans le topic :slight_smile:

2 « J'aime »

Hello, pour ma gourverne, ca apporte quoi de d’affecter 1 topic diffèrent a chaques affichage /solar /cptlinky /tempext?

Je viens de revevoir mon ulanzi, je vais me lancer dans sa config.

Hello, si tu utilises 1 seul topic tu va écraser les valeurs dès que tu vas modifier ce topic. En faisant plusieurs topic, tu peux avoir un paramétrage ou un temps d’affichage différent par exemple.

1 « J'aime »

Merci.
Je comprends pas tout. Tu peux donner gentiment un exemple ou partager 2-3 automatisations de ton Ulanzi?
Merci par avance.

bonsoir,

J’ai fait cette automatisation :

alias: Awtrix - data - 05min
description: ""
trigger:
  - platform: time_pattern
    minutes: /5
condition: []
action:
  - metadata: {}
    data:
      qos: 0
      retain: false
      topic: awtrix_a9b41c/custom/consohier
      payload: >-
        { icon: "21520",  scrollSpeed: 40,lifetime: 65, repeat: 2 ,text: " Conso
        hier : {{((states('sensor.select_sql_query')))}} Kwh - HP :
        {{((states('sensor.heure_pleine_j_1')))}} Kwh - HC :
        {{((states('sensor.heure_creuse_j_1')))}} Kwh"}
    action: mqtt.publish
mode: single

cela affiche la conso électrique de la veille toutes les 5 minutes. 

Ou celui la qui affiche la fin de la machine à laver :

alias: "AWTRIX : fin machine à laver"
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.prise_zigbee_orange_3_puissance
    below: 1
condition: []
action:
  - if:
      - condition: state
        entity_id: input_boolean.machine_a_laver
        state: "off"
    then:
      - target:
          entity_id:
            - input_boolean.machine_a_laver
        data: {}
        action: input_boolean.turn_on
      - metadata: {}
        data:
          message: Démarrage Machine à laver
        action: telegram_bot.send_message
    else:
      - metadata: {}
        data:
          message: Machine à laver terminée
        action: telegram_bot.send_message
      - metadata: {}
        data:
          qos: 0
          retain: false
          topic: awtrix_a9b41c/custom/slinge
          payload: "{  icon: \"24504\", lifetime: 600, text: \"Machine a laver termine\"}"
        action: mqtt.publish
      - target:
          entity_id: input_boolean.machine_a_laver
        data: {}
        action: input_boolean.turn_off
mode: single

J’espère que cela pourra t’aider

hello @Laurent_Vaugeois
Pourrais tu mettre ton code entre les balises stp ?

hello
C’est fait.
cordialement

désolé je n’avais pas vu les messages mais laurent a donné la réponse merci a lui

1 « J'aime »

Ma petite contribution qui donne ceci :

  • Le jour :
    AWTRIX_JOUR
  • La nuit :
    awtrix (3)

=> En haut à droite => Couleur actuelle TEMPO
=> En bas à droite => Prochaine couleur TEMPO

Automatisation Principale - Affichage Temperature, Production, Conso, Gain de facture
alias: Afficheur AWTRIX - Temperature, Production, Conso, Gain de facture
trigger:
  - platform: time_pattern
    seconds: /15
condition: []
action:
  - variables:
      seuil_prod_min: 0.1
      seuil_gain_min: 1.0
      current_screen: >
        {% if now().second >= 0 and now().second <= 14 %} 0 {% elif now().second
        >= 15 and now().second <= 29 %} 1 {% elif now().second >= 30 and
        now().second <= 44 %} 2 {% elif now().second >= 45 and now().second <=
        59 %} 3 {% endif %}
      daily_solar_energy: "{{ states('sensor.daily_solar_energy') | float }}"
      daily_grid_energy_imported: "{{ states('sensor.daily_grid_energy_imported') | float }}"
      daily_grid_energy_exported: "{{ states('sensor.daily_grid_energy_exported') | float }}"
      production: "{{ (states('sensor.solaire_power') | float / 1000) | round(1) }}"
      conso: "{{( states('sensor.enedis_power') | float / 1000 )| round(1)}}"
      temp_ext: "{{ (states('sensor.temperature_jardin') | float) | round(1) }}"
      gain_percentage: >
        {{ ((daily_solar_energy-daily_grid_energy_exported) /
        (daily_grid_energy_imported+(daily_solar_energy-daily_grid_energy_exported))
        * 100) | round(0) }}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ current_screen == 0 }}"
        sequence:
          - data:
              topic: awtrix_2d9594/custom/HomeAssistant
              payload: |
                {
                  "icon": "2355",
                  "text": "{{ temp_ext }}°C",
                  "duration": 2
                }
            action: mqtt.publish
      - conditions:
          - condition: template
            value_template: "{{ current_screen == 1 }}"
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ production < seuil_prod_min }}"
                sequence:
                  - data:
                      topic: awtrix_2d9594/custom/HomeAssistant
                      payload: |
                        {
                          "icon": "62775",
                          "text": "0 kW",
                          "duration": 2
                        }
                    action: mqtt.publish
              - conditions:
                  - condition: template
                    value_template: "{{ production >= seuil_prod_min }}"
                sequence:
                  - data:
                      topic: awtrix_2d9594/custom/HomeAssistant
                      payload: |
                        {
                          "icon": "62774",
                          "text": "{{ production }}kW",
                          "duration": 2
                        }
                    action: mqtt.publish
      - conditions:
          - condition: template
            value_template: "{{ current_screen == 2 }}"
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ conso <= 0 }}"
                sequence:
                  - data:
                      topic: awtrix_2d9594/custom/HomeAssistant
                      payload: |
                        {
                          "icon": "62777",
                          "text": "{{ -conso }}kW",
                          "duration": 2
                        }
                    action: mqtt.publish
              - conditions:
                  - condition: template
                    value_template: "{{ conso > 0 }}"
                sequence:
                  - data:
                      topic: awtrix_2d9594/custom/HomeAssistant
                      payload: |
                        {
                          "icon": "62776",
                          "text": "{{ conso }}kW",
                          "duration": 2
                        }
                    action: mqtt.publish
      - conditions:
          - condition: template
            value_template: "{{ current_screen == 3 }}"
        sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ gain_percentage <= seuil_gain_min }}"
                sequence:
                  - data:
                      topic: awtrix_2d9594/custom/HomeAssistant
                      payload: |
                        {
                          "icon": "25681",
                          "text": "0 %",
                          "duration": 2
                        }
                    action: mqtt.publish
              - conditions:
                  - condition: template
                    value_template: "{{ gain_percentage > seuil_gain_min }}"
                sequence:
                  - data:
                      topic: awtrix_2d9594/custom/HomeAssistant
                      payload: |
                        {
                          "icon": "25681",
                          "text": "{{ -gain_percentage }} %",
                          "duration": 2
                        }
                    action: mqtt.publish
mode: single

Automatisation Secondaire - Affichage des couleurs TEMPO
alias: Afficheur AWTRIX - Affichage des couleurs TEMPO
trigger:
  - platform: time_pattern
    seconds: /30
condition: []
action:
  - variables:
      current_screen: >
        {% if now().second >= 0 and now().second <= 29 %} 0 {% elif now().second
        >= 30 and now().second <= 59 %} 1 {% endif %}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ current_screen == 0 }}"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: sensor.rte_tempo_couleur_actuelle
                    state: Rouge
                sequence:
                  - data:
                      entity_id: light.awtrix_2d9594_indicator_1
                      rgb_color:
                        - 255
                        - 0
                        - 0
                    action: light.turn_on
              - conditions:
                  - condition: state
                    entity_id: sensor.rte_tempo_couleur_actuelle
                    state: Bleu
                sequence:
                  - data:
                      entity_id: light.awtrix_2d9594_indicator_1
                      rgb_color:
                        - 0
                        - 0
                        - 255
                    action: light.turn_on
              - conditions:
                  - condition: state
                    entity_id: sensor.rte_tempo_couleur_actuelle
                    state: Blanc
                sequence:
                  - data:
                      entity_id: light.awtrix_2d9594_indicator_1
                      rgb_color:
                        - 255
                        - 255
                        - 255
                    action: light.turn_on
              - conditions:
                  - condition: not
                    conditions:
                      - condition: state
                        entity_id: sensor.rte_tempo_couleur_actuelle
                        state: Rouge
                      - condition: state
                        entity_id: sensor.rte_tempo_couleur_actuelle
                        state: Bleu
                      - condition: state
                        entity_id: sensor.rte_tempo_couleur_actuelle
                        state: Blanc
                sequence:
                  - target:
                      entity_id: light.awtrix_2d9594_indicator_1
                    action: light.turn_off
                    data: {}
      - conditions:
          - condition: template
            value_template: "{{ current_screen == 1 }}"
        sequence:
          - choose:
              - conditions:
                  - condition: state
                    entity_id: sensor.rte_tempo_prochaine_couleur
                    state: Rouge
                sequence:
                  - data:
                      entity_id: light.awtrix_2d9594_indicator_3
                      rgb_color:
                        - 255
                        - 0
                        - 0
                    action: light.turn_on
              - conditions:
                  - condition: state
                    entity_id: sensor.rte_tempo_prochaine_couleur
                    state: Bleu
                sequence:
                  - data:
                      entity_id: light.awtrix_2d9594_indicator_3
                      rgb_color:
                        - 0
                        - 0
                        - 255
                    action: light.turn_on
              - conditions:
                  - condition: state
                    entity_id: sensor.rte_tempo_prochaine_couleur
                    state: Blanc
                sequence:
                  - data:
                      entity_id: light.awtrix_2d9594_indicator_3
                      rgb_color:
                        - 255
                        - 255
                        - 255
                    action: light.turn_on
              - conditions:
                  - condition: not
                    conditions:
                      - condition: state
                        entity_id: sensor.rte_tempo_prochaine_couleur
                        state: Rouge
                      - condition: state
                        entity_id: sensor.rte_tempo_prochaine_couleur
                        state: Bleu
                      - condition: state
                        entity_id: sensor.rte_tempo_prochaine_couleur
                        state: Blanc
                sequence:
                  - target:
                      entity_id: light.awtrix_2d9594_indicator_3
                    action: light.turn_off
                    data: {}
mode: single

Automatisation Secondaire - Vérification de l'affichage du bon écran
alias: Afficheur AWTRIX - Vérification de l'affichage du bon écran
description: ""
trigger:
  - platform: time_pattern
    seconds: "30"
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: sensor.awtrix_2d9594_current_app
        state: HomeAssistant
action:
  - action: button.press
    metadata: {}
    data: {}
    target:
      entity_id: button.awtrix_2d9594_next_app
mode: single

3 « J'aime »

merci, j’y ai pas pensé de mettre tempo le lendemain et j’ai une led de dispo, thx.

De rien.

J’ai aussi fait des logo perso plus compréhensible que ceux dispo dans la librairie de base :

  • Energie solaire => JOUR + NUIT
  • Conso depuis le réseaux => IMPORT + EXPORT
    image
2 « J'aime »

J’ai pas mal modifié mes automatisations pour obtenir quelque chose de plus propre.

Visuellement, cela ne change pas grand-chose hormis l’ajout de la consommation d’eau adoucie ainsi que la part d’eau chaude. Cela rend surtout les informations plus cohérentes à l’affichage, car elles sont maintenant toutes échantillonnées au même moment. De plus, j’ai regroupé les entités externes en variables, ce qui facilitera la configuration pour ceux qui souhaitent réutiliser le code.

IMPORTANT : N’oubliez pas d’activer le mode « transition automatique » pour que les écrans défilent. Il faut également adapter la périodicité de l’automatisation en fonction de la durée totale de vos écrans. Par exemple, j’ai 7 écrans de 8s donc nous sommes à 7x8=56s (6x dans l’automatisation + 1x de l’appli TIME de 8s)

Voilà le résultat :

  • Le jour :
    AWTRIX_JOUR
  • La nuit :
    AWTRIX_NUIT

=> En haut à droite => Couleur actuelle TEMPO
=> En bas à droite => Prochaine couleur TEMPO

Automatisation : Définition des écrans Custom
alias: Afficheur AWTRIX - Définition des écrans Custom
description: ""
trigger:
  - platform: time_pattern
    seconds: /56
condition: []
action:
  - variables:
      temperature: "{{ (states('sensor.temperature_jardin') | float) | round(1) }}"
      conso_eau_adoucie: "{{ (states('sensor.conso_eau_du_jour') | float * 1000 )| round(0)}}"
      conso_eau_chaude: >-
        {{ (states('sensor.conso_eau_chaude_du_jour') | float * 1000 )|
        round(0)}}
      conso_enedis: "{{( states('sensor.enedis_power') | float / 1000 )| round(1)}}"
      production: "{{ (states('sensor.solaire_power') | float / 1000) | round(1) }}"
      Energie_produite: "{{ states('sensor.daily_solar_energy') | float }}"
      energie_importee: "{{ states('sensor.daily_grid_energy_imported') | float }}"
      energie_exportee: "{{ states('sensor.daily_grid_energy_exported') | float }}"
      conso_enedis_gain: >-
        {{ ((Energie_produite-energie_exportee) /
        (energie_importee+(Energie_produite-energie_exportee)) * 100) |
        round(0)}}
      duree_temperature: 8
      duree_production: 8
      duree_enedis: 8
      duree_economies: 8
      duree_eau_adoucie: 8
      duree_eau_chaude: 8
      seuil_prod_min: 0.1
      seuil_gain_min: 2
      icon_temperature: "62850"
      icon_production_nuit: "62775"
      icon_production_jour: "62774"
      icon_enedis_import: "62776"
      icon_enedis_export: "62777"
      icon_eau_adoucie: "30124"
      icon_economies: "25681"
      icon_eau_chaude: "62876"
  - sequence:
      - sequence:
          - data:
              topic: awtrix_4620c0/custom/00_Temperature
              payload: |
                {
                  "icon": "{{ icon_temperature }}",
                  "text": "{{ temperature }}°C",
                  "duration": {{ duree_temperature }}
                }
            action: mqtt.publish
      - sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ production < seuil_prod_min }}"
                sequence:
                  - data:
                      topic: awtrix_4620c0/custom/01_Production_PV
                      payload: |
                        {
                          "icon": "{{ icon_production_nuit }}",
                          "text": "0 kW",
                          "duration": {{ duree_production }}
                        }
                    action: mqtt.publish
              - conditions:
                  - condition: template
                    value_template: "{{ production >= seuil_prod_min }}"
                sequence:
                  - data:
                      topic: awtrix_4620c0/custom/01_Production_PV
                      payload: |
                        {
                          "icon": "{{ icon_production_jour }}",
                          "text": "{{ production }}kW",
                          "duration": {{ duree_production }}
                        }
                    action: mqtt.publish
      - sequence:
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ conso_enedis <= 0 }}"
                sequence:
                  - data:
                      topic: awtrix_4620c0/custom/02_Enedis
                      payload: |
                        {
                          "icon": "{{ icon_enedis_export }}",
                          "text": "{{ -conso_enedis }}kW",
                          "duration": {{ duree_enedis }}
                        }
                    action: mqtt.publish
              - conditions:
                  - condition: template
                    value_template: "{{ conso_enedis > 0 }}"
                sequence:
                  - data:
                      topic: awtrix_4620c0/custom/02_Enedis
                      payload: |
                        {
                          "icon": "{{ icon_enedis_import }}",
                          "text": "{{ conso_enedis }}kW",
                          "duration": {{ duree_enedis }}
                        }
                    action: mqtt.publish
      - choose:
          - conditions:
              - condition: template
                value_template: "{{ conso_enedis_gain <= seuil_gain_min }}"
            sequence:
              - data:
                  topic: awtrix_4620c0/custom/03_Economies
                  payload: |
                    {
                      "icon": "{{ icon_economies }}",
                      "text": "0 %",
                      "duration": {{ duree_economies }}
                    }
                action: mqtt.publish
          - conditions:
              - condition: template
                value_template: "{{ conso_enedis_gain > seuil_gain_min }}"
            sequence:
              - data:
                  topic: awtrix_4620c0/custom/03_Economies
                  payload: |
                    {
                      "icon": "{{ icon_economies }}",
                      "text": "{{ -conso_enedis_gain }} %",
                      "rainbow": true,
                      "duration": {{ duree_economies }}
                    }
                action: mqtt.publish
      - sequence:
          - data:
              topic: awtrix_4620c0/custom/04_Eau_adoucie
              payload: |
                {
                  "icon": "{{ icon_eau_adoucie }}",
                  "text": "{{ conso_eau_adoucie }} L",
                  "duration": {{ duree_eau_adoucie }}
                }
            action: mqtt.publish
      - sequence:
          - data:
              topic: awtrix_4620c0/custom/05_Eau_chaude
              payload: |
                {
                  "icon": "{{ icon_eau_chaude }}",
                  "text": "{{ conso_eau_chaude }} L",
                  "duration": {{ duree_eau_chaude }}
                }
            action: mqtt.publish
mode: single

Automatisation : Gestion des couleurs TEMPO
alias: Afficheur AWTRIX - Gestion des couleurs TEMPO
description: ""
triggers:
  - minutes: /1
    trigger: time_pattern
conditions: []
actions:
  - variables:
      couleur_actuelle: sensor.rte_tempo_couleur_actuelle
      prochaine_couleur: sensor.rte_tempo_prochaine_couleur
  - sequence:
      - choose:
          - conditions:
              - condition: template
                value_template: "{{ states(prochaine_couleur) == 'Bleu' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator3
                  payload: "{\"color\":[0,0,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(prochaine_couleur) == 'Blanc' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator3
                  payload: "{\"color\":[255,255,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(prochaine_couleur) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator3
                  payload: "{\"color\":[255,0,0]}"
          - conditions:
              - condition: not
                conditions:
                  - condition: template
                    value_template: "{{ states(prochaine_couleur) == 'Bleu' }}"
                  - condition: template
                    value_template: "{{ states(prochaine_couleur) == 'Blanc' }}"
                  - condition: template
                    value_template: "{{ states(prochaine_couleur) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator3
                  payload: "{\"color\":[0,0,0]}"
      - choose:
          - conditions:
              - condition: template
                value_template: "{{ states(couleur_actuelle) == 'Bleu' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator1
                  payload: "{\"color\":[0,0,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(couleur_actuelle) == 'Blanc' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator1
                  payload: "{\"color\":[255,255,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(couleur_actuelle) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator1
                  payload: "{\"color\":[255,0,0]}"
          - conditions:
              - condition: not
                conditions:
                  - condition: template
                    value_template: "{{ states(couleur_actuelle) == 'Bleu' }}"
                  - condition: template
                    value_template: "{{ states(couleur_actuelle) == 'Blanc' }}"
                  - condition: template
                    value_template: "{{ states(couleur_actuelle) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix_4620c0/indicator1
                  payload: "{\"color\":[0,0,0]}"
mode: single

##############################################################

[EDIT du 01/10/2024] :

4 « J'aime »

Merci pour ton code, que j’essai tant bien que mal à intégrer… Lorsque je le colle j’ai ce message au moment d’enregistrer: Message malformed: Unable to determine action @ data[‹ actions ›][3]

J’ai pourtant bien l’integration RTE Tempo et donc les même nom de sensor, et j’ai modifié le nom de l’awtrix pour mettre le même que moi.
J’ai d’autre automatiion awtrix qui fonctionne correctement.

Une idée?

Voici un exemple d’une automation qui fonctionne

metadata: {}
data:
  qos: 0
  retain: false
  topic: awtrix/custom/consome
  payload: >-
    {"icon": "21256", "text":
    "{{states('sensor.shellypro3em_34987a4619cc_phase_c_active_power') | round
    }}W",  "duration": 5 }  alias: Prodution_Direct
enabled: true
action: mqtt.publish
alias: Conso

@Bensouil, peux-tu partager le code complet du yaml de ton automation qui ne fonctionne pas ?

le voici:

alias: Afficheur AWTRIX - Gestion des couleurs TEMPO
description: ""
triggers:
  - minutes: /1
    trigger: time_pattern
conditions: []
actions:
  - variables:
      couleur_actuelle: sensor.rte_tempo_couleur_actuelle
      prochaine_couleur: sensor.rte_tempo_prochaine_couleur
  - sequence:
      - choose:
          - conditions:
              - condition: template
                value_template: "{{ states(prochaine_couleur) == 'Bleu' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator3
                  payload: "{\"color\":[0,0,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(prochaine_couleur) == 'Blanc' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator3
                  payload: "{\"color\":[255,255,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(prochaine_couleur) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator3
                  payload: "{\"color\":[255,0,0]}"
          - conditions:
              - condition: not
                conditions:
                  - condition: template
                    value_template: "{{ states(prochaine_couleur) == 'Bleu' }}"
                  - condition: template
                    value_template: "{{ states(prochaine_couleur) == 'Blanc' }}"
                  - condition: template
                    value_template: "{{ states(prochaine_couleur) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator3
                  payload: "{\"color\":[0,0,0]}"
      - choose:
          - conditions:
              - condition: template
                value_template: "{{ states(couleur_actuelle) == 'Bleu' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator1
                  payload: "{\"color\":[0,0,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(couleur_actuelle) == 'Blanc' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator1
                  payload: "{\"color\":[255,255,255]}"
          - conditions:
              - condition: template
                value_template: "{{ states(couleur_actuelle) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator1
                  payload: "{\"color\":[255,0,0]}"
          - conditions:
              - condition: not
                conditions:
                  - condition: template
                    value_template: "{{ states(couleur_actuelle) == 'Bleu' }}"
                  - condition: template
                    value_template: "{{ states(couleur_actuelle) == 'Blanc' }}"
                  - condition: template
                    value_template: "{{ states(couleur_actuelle) == 'Rouge' }}"
            sequence:
              - action: mqtt.publish
                metadata: {}
                data:
                  qos: "0"
                  retain: false
                  topic: awtrix/indicator1
                  payload: "{\"color\":[0,0,0]}"
mode: single

Es-tu certains du chemin de tes topics MQTT :

topic: awtrix/indicator1 

Compares avec les miens, normalement ils contiennent le numéro de série de ton appareil si tu n’as rien changer.

Yes certain, mon autre automatisation fonction.
Je l’avais changé à l’époque quand j’était sous Jeedom je ne sais plus pourquoi…mais je l’ai gardé.

metadata: {}
data:
  qos: 0
  retain: false
  topic: awtrix/custom/tempext
  payload: >-
    {"icon": "5836", "text":
    "{{states('sensor.temperature_exterieur_temperature') }}°C",  "duration": 5
    }  alias: température_exterieur
enabled: true
action: mqtt.publish
alias: Tempext

Pour ma part si je colle l’intégralité du code de ton automation j’arrive à enregistrer sans aucun message d’erreur.

ho bas chelou cette histoire… je ne peux toujours pas exécuter l’action:
Unable to determine action @ data[0]

C’est pourtant bien dans autre action/Mqtt/Publier? J’ai essayer en recommençant à 0, une nouvelle automatisation, marche pas :unamused::disappointed_relieved: