Как исправить автоматизацию

эта автоматизация у меня не работает. Помогите исправить ее.

  • alias: turning on the light in the bathroom
    trigger:
    • platform: state
      entity_id: binary_sensor.0x00158d0006d46661_occupancy
      from: ‘off’
      to: ‘on’
      action:
      service: switch.turn_on
      data:
      transition: 120
      target:
      entity_id: switch.0xa4c1387be3e08ead_left

switch - on or off
/

alias: turning on the light in the bathroom
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.0x00158d0006d46661_occupancy
    from: 'off'
    to: 'on'
condition: []
action:
  - service: switch.turn_on
    target:
      entity_id: switch.0xa4c1387be3e08ead_left
mode: single

THANKS! How to make this automation so that if there is no movement for 2 minutes, the switch turns off?

alias: turning off the light in the bathroom
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.0x00158d0006d46661_occupancy
    from: 'on'
    to: 'off'
    for:
      hours: 0
      minutes: 2
      seconds: 0
condition: []
action:
  - service: switch.turn_off
    target:
      entity_id: switch.0xa4c1387be3e08ead_left
mode: single

2 minutes when the sensor changes to off

Logger: homeassistant.config
Source: config.py:464
First occurred: 16:36:40 (3 occurrences)
Last logged: 16:48:33
How to fix? I get this error when checking automation:

  • Invalid config for [automation]: Unexpected value for condition: ‘’. Expected and, device, not, numeric_state, or, state, sun, template, time, trigger, zone @ data[‘action’][3]. Got None. (See ?, line ?).
  • Invalid config for [automation]: expected a dictionary for dictionary value @ data[‘action’][0][‘target’]. Got None. (See ?, line ?).


/

Thanks! Very interesting. I will continue to study. Thank you for your help!

1 Like