Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type: custom:button-card
- tap_action:
- action: toggle
- hold_action:
- action: more-info
- entity: switch.portao_1_folha
- show_state: false
- show_label: true
- show_name: true
- show_last_changed: false
- name: Portão Pedestre
- size: 54px
- state:
- - operator: template
- value: |
- [[[
- return states['binary_sensor.portao_1_folha_external_input'].state === 'off'
- ]]]
- label: Fechado
- - operator: default
- icon: mdi:door-open
- label: Aberto
- styles:
- card:
- - font-weight: bold
- - background: |
- [[[
- if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return '#33211f';
- else return '#263926';
- ]]]
- name:
- - font-size: 14px
- - color: |
- [[[
- if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return 'white';
- else return 'white';
- ]]]
- icon:
- - animation: |
- [[[
- if (states['binary_sensor.portao_1_folha_external_input'].state === 'on') return 'blink 2s ease 15';
- ]]]
- - color: |
- [[[
- if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return '#DB4437';
- else return '#43A047';
- if (states['binary_sensor.portao_2_folha_external_input'].state === 'on') return 'gray';
- ]]]
- label:
- - font-size: 12px
- - color: |
- [[[
- if (states['binary_sensor.portao_1_folha_external_input'].state === 'off') return 'gray';
- else return 'gray';
- ]]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement