Keep getting errors in scripts

I keep getting this error spammed in the log

2017-07-08 01:39:20 ERROR (MainThread) [homeassistant.core] Invalid service data for script.turn_off: Entity ID motion_upstairs_timer is an invalid entity id for dictionary value @ data['entity_id']. Got 'motion_upstairs_timer'

this is the automation that calls it

- alias: 'Stair Lights AutoOn'
  hide_entity: false
  trigger:
    platform: state
    entity_id: sensor.upstairs_motion
    from: 'off'
    to: 'on'
  condition: 
    condition: or
    conditions:
      - condition: sun
        after: sunset
        after_offset: "-0:45:00"
      - condition: sun
        before: sunrise
        before_offset: "0:45:00"
      - condition: numeric_state
        entity_id: 'sensor.illumination_XXXXXXXXXXX'
        below: '400'
  action:
    - service: script.turn_off
      data:
        entity_id: script.motion_upstairs_timer
    - service: scene.turn_on
      entity_id: scene.stair_lights_on
    - service: homeassistant.turn_on
      entity_id: switch.stairs_fluxer_update

Have you tried it without the ‘data’ line?

- service: script.turn_off
  entity_id: script.motion_upstairs_timer

Yeah ive tried without data as well, but I seem to have the same issue still.

@matt2468 Try this then maybe and see if that fixes it. Just a shot in the dark.

 - service: homeassistant.turn_off
   entity_id: script.motion_upstairs_timer

Was my mistake in the script file I had this

- service: script.turn_off
      data:
        entity_id: motion_upstairs_timer

thanks for the help though!

1 Like