Motion automation not working after update

He There!

I’ve updated to the latest Home assistant and somehow my automation is not working anymore.
I can’t see what is wrong in de zwave log and the hassio log file.

This is my automation:

- id: livingroom_lux_low_lights_on
  alias: Turn on lights when lux is low and motion is detected
  initial_state: 'on'
  trigger:
  - entity_id: binary_sensor.shenzhen_neo_electronics_co_ltd_battery_powered_pir_sensor_v2_sensor
    from: 'Off'
    platform: state
    to: 'On'
  condition:
  - condition: and
    conditions:
    - after: '18:00:00'
      before: 09:00:00
      condition: time
    - condition: state
      entity_id: group.living_room
      state: 'off'
    - condition: state
      entity_id: switch.front_door
      state: 'off'
    - condition: state
      entity_id: switch.hallway
      state: 'off'
    - condition: state
      entity_id: input_boolean.mode_holiday
      state: 'off'
  action:
  - service: switch.turn_on
    entity_id: group.living_room
  - service: switch.turn_on
    entity_id: switch.front_door
  - service: switch.turn_on
    entity_id: switch.hallway

And this is my hassio log file:

2020-01-09 08:46:38 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.shenzhen_neo_electronics_co_ltd_battery_powered_pir_sensor_v2_sourcenodeid is incorrectly being triggered for updates while it is disabled. This is a bug in the zwave integration.
2020-01-09 09:01:27 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 275, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 523, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

And my zwave log:

2020-01-09 09:16:37.074 Info, Node005, Received Alarm report: type=0, level=0, sensorSrcID=0, type:Burglar event:0, status=255
2020-01-09 09:16:37.074 Detail, Node005, Refreshed Value: old value=0, new value=0, type=byte
2020-01-09 09:16:37.074 Detail, Node005, Changes to this value are not verified
2020-01-09 09:16:37.074 Detail, Node005, Refreshed Value: old value=0, new value=0, type=byte
2020-01-09 09:16:37.074 Detail, Node005, Changes to this value are not verified
2020-01-09 09:16:37.074 Detail, Node005, Refreshed Value: old value=0, new value=0, type=byte
2020-01-09 09:16:37.074 Detail, Node005, Changes to this value are not verified
2020-01-09 09:16:37.074 Detail, Node005, Refreshed Value: old value=8, new value=0, type=byte
2020-01-09 09:16:37.074 Detail, Node005, Changes to this value are not verified
2020-01-09 09:16:37.074 Detail, Node005, Notification: ValueChanged
2020-01-09 09:16:37.089 Detail, Node005, Notification: ValueChanged
2020-01-09 09:16:37.100 Detail, Node005, Notification: ValueChanged
2020-01-09 09:16:37.107 Detail, Node005, Notification: ValueChanged
2020-01-09 09:16:37.114 Detail, Node005,   Received: 0x01, 0x0a, 0x00, 0x04, 0x00, 0x05, 0x04, 0x30, 0x03, 0x00, 0x0c, 0xcf
2020-01-09 09:16:37.114 Detail,
2020-01-09 09:16:37.115 Info, Node005, Received SensorBinary report: Sensor:12 State=Off
2020-01-09 09:16:37.115 Detail, Node005, Refreshed Value: old value=true, new value=false, type=bool
2020-01-09 09:16:37.115 Detail, Node005, Changes to this value are not verified
2020-01-09 09:16:37.115 Detail, Node005, Notification: ValueChanged

Please help me out. Did i miss something in the release notes?

I don’t think that error has anything to do with the automation not working.

there are a couple of issues in your automation that makes me question how and if it really ever worked at all.

  1. your trigger states are not right. All binary_sensor states are either ‘on’ or ‘off’. They are not upper case.

  2. I’m pretty sure that the first service call in your action is incorrect. you can’t use “switch.turn_on” to turn on a “group.”. You need to use homeassistant.turn_on.

as far as I know those things haven’t changed recently.

Thanks for the reply. If I trigger the automation it works. The lights go on, weird that switch.turn_on shouldn’t work. The on en off thing is something I have changed after it didn’t work. Going to change it back to lowercase.

I guess it’s possible that if the group objects are all of the same domain (switch) then it might work. My understanding has always been that it wouldn’t work but I don’t think I’ve ever tried it since it shouldn’t have worked. :slightly_smiling_face:

something else to check (after you fix your trigger states) is to try removing the time condition. I’m not sure but it might be that you have the before & after times that cross midnight so it can’t be both between 18:00 and midnight and also between midnight and 09:00 at the same time. I think that’s supposed to work but in practice it might not.

if the automation works after removing it the you will need to change the time to “or”:

- condtion: or
  conditions:
    - after: '18:00:00'
      condition: time
    - before: 09:00:00
      condition: time

Shouldn’t it be an “and” condition. i want to have the lights on between 18:00 and 09:00:
I’ve fixed my trigger states and switch turn on to homeassistant turn on. Not at home right now so i have to check later if it works.

no. see this section of the post again:

Thanks! going to change it and see if it works.
For now the automation works again, the only thing i changed was the homeassistant turn on function. That was probably it. There was also a setting in my motion sensor that changed during the update, motion sensor was disabled but it needed to be enabled. Don’t know why. Thanks for all your help