Awtrix + mqtt + HA

Hi everybody , i am a newbie with mqttanad ha.
I have made an automation to display on awtrix my solar production. this is ok but i want to display this information just during the day . I try to use teh sunrise an sunset condition the display does not stop after sunset.
Here is the code if somebody can help me … thx
Philippe
alias: Production Solaire
description: “”
trigger:

  • platform: time_pattern
    minutes: /1
    condition:

  • condition: sun
    before: sunset
    after: sunrise

  • condition: time
    after: “07:00:00”
    before: “22:00:00”
    action:

  • service: mqtt.publish
    data:
    qos: 1
    retain: false
    topic: awtrix_1e8be0/notify
    payload: |-
    {
    “icon”: “60900”,
    “text”:
    [
    {
    “t”: "Prodjour {{states(‘sensor.ecu_today_energy’)}} kwh "
    }

          ]
    }
    

    enabled: true

  • service: mqtt.publish
    metadata: {}
    data:
    qos: 0
    retain: false
    topic: awtrix_1e8be0/custom/prod
    payload: >-
    {“icon”: “21256”, “text”: “APS {{states(‘sensor.ecu_current_power’)
    }}W”, “duration”: 5 } alias: Prodution_Direct
    enabled: true

  • service: mqtt.publish
    metadata: {}
    data:
    qos: 0
    retain: false
    topic: awtrix_1e8be0/custom/bd
    payload: >-
    {“icon”: “21256”, “text”: “Dokio
    {{states(‘sensor.solar_brico_puissance’) }}W”, “duration”: 5 } alias:
    Prodution_BD
    enabled: true

  • service: mqtt.publish
    metadata: {}
    data:
    qos: 0
    retain: false
    topic: awtrix_1e8be0/custom/solarprod
    payload: >-
    {“icon”: “60900”, “text”: “Total {{states(‘sensor.solar’) }}W”,
    “duration”: 5 } alias: Prodution_Dokio
    enabled: true

  • service: mqtt.publish
    metadata: {}
    data:
    qos: 0
    retain: false
    topic: awtrix_1e8be0/custom/solarbrico
    payload: >-
    {“icon”: “52480”, “text”: “BD
    {{states(‘sensor.courant_panneaux_solaires_dokio_puissance’) }}W”,
    “duration”: 5 } alias: Prodution_Brico
    enabled: true
    mode: single

Hello Phil,
Thanks for coming here and asking a question.
Would you be so kind as to adjusting the format of your code so that we can read it properly & check the YAML spacing, etc. It is very hard for us to tell what is what when the text formatter jumbles everything like that.

Here is an example of how to fix it from the site FAQ Page.

How to help us help you - or How to ask a good question.

2 Likes