input_select: bedroom_3_led_actions: icon: mdi:led-strip name: Bedroom 3 LED Controls initial: "----" options: - "----" - "Off" - "1 Hour Fade" automation: - id: set_the_bedroom_3_led_actions alias: Set the Bedroom 3 LED Actions trigger: entity_id: input_select.bedroom_3_led_actions platform: state action: service: mqtt.publish data: topic: viewroad-commands/bedroom3controls/windowledactions payload: '{% set mapping = { "----":"----", "Off":"off", "1 Hour Fade":"fade_1" } %} {% set dta = trigger.to_state.state %} {{ mapping[dta] }} '