#automation:
#  - id: arbetsrum_reglering_simon_work_state
#    alias: Arbetsrum – reglering med inkrementell styrning
#    trigger:
#      - platform: state
#        entity_id: input_select.simon_work_state
#      - platform: state
#        entity_id: sensor.h015l_device_temperature
#    mode: single
#    action:
#      - choose:
#          # === Jobbar hemma ===
#          - conditions:
#              - condition: state
#                entity_id: input_select.simon_work_state
#                state: "Hemma"
#            sequence:
#              - choose:
#                  # för kallt
#                  - conditions:
#                      - condition: numeric_state
#                        entity_id: sensor.h015l_device_temperature
#                        below: 19.5
#                    sequence:
#                      - service: climate.set_temperature
#                        target:
#                          entity_id: climate.arbetsrum
#                        data:
#                          temperature: >
#                            {{ state_attr('climate.arbetsrum', 'temperature') | float + 1 }}
#                  # för varmt
#                  - conditions:
#                      - condition: numeric_state
#                        entity_id: sensor.h015l_device_temperature
#                        above: 20.5
#                    sequence:
#                      - service: climate.set_temperature
#                        target:
#                          entity_id: climate.arbetsrum
#                        data:
#                          temperature: >
#                            {{ state_attr('climate.arbetsrum', 'temperature') | float - 1 }}
#                default: []
#
#          # === Inte hemmaläge ===
#          - conditions:
#              - condition: or
#                conditions:
#                  - condition: state
#                    entity_id: input_select.simon_work_state
#                    state: "På jobbet"
#                  - condition: state
#                    entity_id: input_select.simon_work_state
#                    state: "Okänd"
#            sequence:
#              - choose:
#                  # för kallt (håll runt 17)
#                  - conditions:
#                      - condition: numeric_state
#                        entity_id: sensor.h015l_device_temperature
#                        below: 16.5
#                    sequence:
#                      - service: climate.set_temperature
#                        target:
#                          entity_id: climate.arbetsrum
#                        data:
#                          temperature: >
#                            {{ state_attr('climate.arbetsrum', 'temperature') | float + 1 }}
#                  # för varmt
#                  - conditions:
#                      - condition: numeric_state
#                        entity_id: sensor.h015l_device_temperature
#                        above: 17.5
#                    sequence:
#                      - service: climate.set_temperature
#                        target:
#                          entity_id: climate.arbetsrum
#                        data:
#                          temperature: >
#                            {{ state_attr('climate.arbetsrum', 'temperature') | float - 1 }}
#                default: []
#        default: []
#