Advertisement
Fredo23

Untitled

Jan 7th, 2025 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.05 KB | Source Code | 0 0
  1. alias: Awtrix production direct bureau
  2. description: ""
  3. triggers:
  4.   - seconds: /15
  5.     trigger: time_pattern
  6. conditions: []
  7. actions:
  8.   - if:
  9.       - condition: numeric_state
  10.         entity_id: sensor.pv_power_inverse
  11.         below: 15.0
  12.     then:
  13.       - action: mqtt.publish
  14.         data:
  15.           qos: "0"
  16.           retain: false
  17.           topic: awtrix_c1df98/custom/production
  18.           payload: "{}"
  19.     else:
  20.       - action: mqtt.publish
  21.         data:
  22.           qos: "0"
  23.           retain: false
  24.           topic: awtrix_c1df98/custom/production
  25.           payload: |-
  26.             {
  27.               "text": "{{ states('sensor.pv_power_inverse')|float|round(0) }}W",
  28.               "icon": "{% if states('sensor.pv_power_inverse')|float > 2000 %}54156{% elif states('sensor.pv_power_inverse')|float > 1000 %}50557{% else %}50546{% endif %}",
  29.               "color": "#{% if states('sensor.pv_power_inverse')|float > 2000 %}04FE04{% elif states('sensor.pv_power_inverse')|float > 1000 %}BCF5BC{% else %}FF4E1A{% endif %}"
  30.             }
  31. mode: single
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement