Advertisement
Wykop

Zmień kolor wartości lub tekstu i wartości na podstawie wartości stanu

Dec 23rd, 2022 (edited)
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. Zmień kolor wartości lub tekstu i wartości na podstawie wartości stanu
  2. kod:
  3.  
  4. type: entities
  5. entities:
  6. - entity: sensor.licznik_1_power
  7. card_mod:
  8. style:
  9. hui-generic-entity-row:
  10. $: |
  11. .text-content:not(.info) {
  12. color:
  13. {% if states(config.entity) | int <= 200 %}
  14. #e1e1e1
  15. {% elif states(config.entity) | int <= 400 %}
  16. greenyellow
  17. {% elif states(config.entity) | int <= 800 %}
  18. yellow
  19. {% elif states(config.entity) | int > 801 %}
  20. red
  21. {% endif %}
  22. ;
  23. }
  24. - entity: sensor.licznik_1_power
  25. card_mod:
  26. style: |
  27. :host {
  28. color:
  29. {% if states(config.entity) | int <= 200 %}
  30. #e1e1e1
  31. {% elif states(config.entity) | int <= 400 %}
  32. greenyellow
  33. {% elif states(config.entity) | int <= 800 %}
  34. yellow
  35. {% elif states(config.entity) | int > 801 %}
  36. red
  37. {% endif %}
  38. ;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement