I have what is basically a switch case with seven simple numerical options and it takes >5s to switch from YAML editor to visual.
I’m willing to accept that I might have written this particular automation in a less than optimal way, so here it is for reference:
alias: Weather Jelly
description: >-
Turn on Abbott the jellyfish lamp at 6am to a color related to the forecasted
high temp. >80=red, >70=orange, >60=yellow, >50=green, >30=blue, >0=icy blue,
<1=purple
trigger:
- platform: time
at: "06:00:00"
condition: []
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: 80
sequence:
- service: light.turn_on
data:
brightness: 1
hs_color:
- 0
- 100
target:
entity_id: light.abbott
- conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: 70
sequence:
- service: light.turn_on
data:
brightness: 1
hs_color:
- 47
- 100
target:
entity_id: light.abbott
- conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: 60
sequence:
- service: light.turn_on
data:
brightness: 1
hs_color:
- 60
- 100
target:
entity_id: light.abbott
- conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: 50
sequence:
- service: light.turn_on
data:
brightness: 1
hs_color:
- 120
- 100
target:
entity_id: light.abbott
- conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: 30
sequence:
- service: light.turn_on
data:
brightness: 1
hs_color:
- 240
- 100
target:
entity_id: light.abbott
- conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
above: 0
sequence:
- service: light.turn_on
data:
brightness: 1
hs_color:
- 180
- 100
target:
entity_id: light.abbott
- conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_forecast_temperature
below: 1
sequence:
- service: light.turn_on
data:
brightness: 1
hs_color:
- 284
- 100
target:
entity_id: light.abbott
mode: single