Turn on Hue lights when motion

I have Home assistant running and also the envisalink dsc, and hue working but I can’t make them work together…

I would like to turn on the Living Room Hue lights when there is motion in the mancave and turn off after 1 minute but I can’t figure out what I’m missing

automation 5:
trigger:
platform: state
entity_id: binary_sensor.mancave_motion
state: ‘on’
action:
service: homeassistant.turn_on
entity_id: light.living

automation 6:
trigger:
platform: state
entity_id: binary_sensor.mancave_motion
from: ‘on’
to: ‘off’
for:
minutes: 1
action:
service: homeassistant.turn_off
entity_id: light.living

Try using the light.turn_on and light.turn_off services instead of the homeassistant services.

Thanks that did it … Now to figure out how to only do it from sunset to sunrise… Off to search some more…

Just set a condition for it. This might give you an idea.

# Harmony/Hue
- alias: 'Theater Lights'
  trigger:
    - platform: state
      entity_id: remote.living_room
      from: 'off'
  condition:
    condition: sun
    after: sunset
    after_offset: "-00:45:00"
  action:
    - service: scene.turn_on
      entity_id: scene.sunset
    - delay: 00:02:00
    - service: scene.turn_on
      entity_id: scene.sunset_dimmed

Note that you will have to have the sun component loaded to use this example; it isn’t included in a default set up.

Thanks… Got that loaded and now to find out how where to put the before sunrise part so that the light turns on after sunset and before sunrise.

The example I tried copying was a fail and caused problems… Lol

Got it after some searching. and I will see what happens after sunrise tomorrow. .Lol