Send notification if any light is on and nobody home

I trying to set up automation for sending telegram notification, if any light is on (group with all lights) and nobody is home (group with persons). But automation was never triggered. Have anyone idea what I doing wrong? Using automation editor create this config:

- id: '1581545836103'
  alias: Away mode - light check
  description: Send notification if any light is on and nobody home
  trigger:
  - entity_id: group.all_lights
    platform: state
    to: 'On'
  condition:
  - condition: state
    entity_id: group.all_persons
    state: away
  action:
  - data:
      message: Nobody is home and some lights are on
    service: notify.telegram_martin

your action is incorrect.

try this:

  action:
    - service: notify.telegram_martin
      data:
        message: Nobody is home and some lights are on
    

On should be lowercase.

Away should be not_home.

Your condition and trigger are the wrong way round.

Unless you’ve created group.all_lights then you won’t have it anymore as it is deprecated.

The one thing that is correct is your action, so ignore the guy above.

1 Like

If I trigger automation manually, notification was sent and arrived. I try your suggestion, but it’s same - on manual trigger notification arrived, but automation is not triggered based on group state change

Perfect, with On > on and away > not_home automation working. Thanks

1 Like

can I say exactly which one is left on?