Skip to content

Instantly share code, notes, and snippets.

View AnthonMS's full-sized avatar

AnthonMS

View GitHub Profile
- type: custom:button-card
entity: media_player.living_room_tv
icon: mdi:television
name: Television
tap_action:
action: fire-dom-event
browser_mod:
command: popup
hide_header: true
card:
- type: vertical-stack
cards:
- type: custom:button-card
icon: mdi:television
label: Television
tap_action:
action: fire-dom-event
browser_mod:
command: popup
hide_header: true
- alias: Select Traffic light Effect
trigger:
platform: state
entity_id: input_select.traffic_light_effect
action:
service: mqtt.publish
data:
topic: "cmnd/SmartTrafficLight/switch"
payload_template: "{% if states.input_select.traffic_light_effect.state == 'Alle tændt' %} 1 {% elif states.input_select.traffic_light_effect.state == 'Omvendt alle tændt' %} 2 {% elif states.input_select.traffic_light_effect.state == 'Grøn' %} 3 {% elif states.input_select.traffic_light_effect.state == 'Gul' %} 4 {% elif states.input_select.traffic_light_effect.state == 'Rød' %} 5 {% elif states.input_select.traffic_light_effect.state == 'Alle loop' %} 6 {% elif states.input_select.traffic_light_effect.state == 'En loop' %} 7 {% elif states.input_select.traffic_light_effect.state == 'Almindelig trafiklys loop' %} 8 {% endif %}"