Setting Hue scene based on Harmony activity

I’ve set up an automation to change my Hue lights to a set scene depending on what time it is the following is the config Im using. Im wondering if this is the best way to have it set up

#### Set Hue scene to Relax
- alias: Watch TV Morning
  trigger:
  - platform: state
    entity_id: input_select.harmony
    to: Watch TV
  condition:
   - after: '05:00:00'
     before: '08:00:00'
     condition: time
  action:
    service: light.hue_activate_scene
    data:
      group_name: Living room
      scene_name: Relax

#### Set Hue scene to Tropical twilight
- alias: Watch TV Daytime
  trigger:
  - platform: state
    entity_id: input_select.harmony
    to: Watch TV
  condition:
   - after: '08:00:00'
     before: '16:00:00'
     condition: time
  action:
    service: light.hue_activate_scene
    data:
      group_name: Living room
      scene_name: Tropical twilight

#### Set Hue scene to Multicolour
- alias: Watch TV Evening
  trigger:
  - platform: state
    entity_id: input_select.harmony
    to: Watch TV
  condition:
   - after: '16:00:00'
     before: '05:00:00'
     condition: time
  action:
    service: light.hue_activate_scene
    data:
      group_name: Living room
      scene_name: Multicolour

I didn’t think ”to:” on its own was supposed to work anymore.

Why not? Should work fine.

OP:

You could potentially save a few lines doing templates for the times, but what you have is fine. Don’t forget to change light.hue_activate_scene to hue.hue_activate_scene when you upgrade to 0.60

Because it said in one of the not so recent releases that you had to use from: with to: and sure enough the automation id used it in stopped working and I have to use value_templates if I don’t use a from:

I don’t know where you read that (or why it doesn’t work for you) but it works fine here, and that approach wouldn’t make much sense for a lot of automations.

It was in the release notes and the trigger doc now only has a from: to: example.

Both clearly say optional independently of each other.

As I say, it’s definitely working here and is presumably working for the people whose GitHubs I regularly consult for ideas, so it should be working for you.

Indeed it does, wonder if it got put back shortly after, will give it another go :slight_smile:

1 Like