Advertisement
joaopedros2

Untitled

Aug 22nd, 2022
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | Source Code | 0 0
  1. type: custom:button-card
  2. tap_action:
  3. action: toggle
  4. hold_action:
  5. action: more-info
  6. entity: switch.portao_1_folha
  7. show_state: false
  8. show_label: true
  9. show_name: true
  10. show_last_changed: false
  11. name: Portão Pedestre
  12. size: 54px
  13. state:
  14. - operator: template
  15. value: |
  16. [[[
  17. return states['binary_sensor.portao_1_folha_external_input'].state === 'off'
  18. ]]]
  19. label: Fechado
  20. - operator: default
  21. icon: mdi:door-open
  22. label: Aberto
  23. styles:
  24. card:
  25. - font-weight: bold
  26. - background: |
  27. [[[
  28. if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return '#33211f';
  29. else return '#263926';
  30. ]]]
  31. name:
  32. - font-size: 14px
  33. - color: |
  34. [[[
  35. if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return 'white';
  36. else return 'white';
  37. ]]]
  38. icon:
  39. - animation: |
  40. [[[
  41. if (states['binary_sensor.portao_1_folha_external_input'].state === 'on') return 'blink 2s ease 15';
  42. ]]]
  43. - color: |
  44. [[[
  45. if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return '#DB4437';
  46. else return '#43A047';
  47. if (states['binary_sensor.portao_2_folha_external_input'].state === 'on') return 'gray';
  48. ]]]
  49. label:
  50. - font-size: 12px
  51. - color: |
  52. [[[
  53. if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return 'gray';
  54. else return 'gray';
  55. ]]]
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement