When pressing doorbell lights turn on

I built the below automation. When the doorbell button is pressed it doesn’t turn on the lights, but when I manually trigger the automation the lights turn on. Therefore I’m assuming something with my trigger is wrong. Any ideas? I’m not sure the “to:” is correct, I just pulled that from other articles I read and that’s what they had.

  alias: Doorbell lights on
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.skybell_front_door_button
    to: 'on'
  condition: []
  action:
  - service: switch.turn_on
    data: {}
    entity_id: switch.led_lights
  mode: single

which kind of device is changing the doorbell binary state?

That looks correct to me, does the sensor show that it was pressed when expected?

On the face of it it should work - but when I set up all my momentary switch (i.e. button) automations I used the from / to trigger for some reason. See below. I don’t know why, these were done well over a year ago but maybe worth a try.

  trigger:
    platform: state
    entity_id: binary_sensor.button
    from: 'off'
    to: 'on'

I have seen this happen with my own stuff. Your automation is probably defaulting to Disabled. Try including initial_state: true and I bet it will work!

alias: Doorbell lights on
  description: ''
  initial_state: true
  trigger:
  ...

Verify doorbell state changes to ON when pressed and not another value

@_Mike looks like your suggestion in adding “initial_state: true” did the job, thanks!
However, there appears to be a significant delay from when the button is pressed to when the light turns on.
Any ideas on that one by chance?

Glad you got it to work! The delay is probably due to the polling frequency. Probably not much you can do about that.

Dang, there isn’t a way to change the polling interval or something? Its like a minute delay haha, pretty much makes the automation useless.

That depends on the integration. Some are configurable.

1 Like

A minute is a lot. May be you need to share your hardware and config?

I wonder if its because I’m going through Smarthings. There could be a delay there, but i’m not sure how to tweak that.
Skybell doorbell
Light switch: GE Zwave (not sure model as it came with the house) This is connected through my smartthings hub.

Configuration.yaml

# Skybell
skybell:
  username: !secret skybell_username
  password: !secret skybell_password
binary_sensor:
  - platform: skybell
    monitored_conditions:
      - button
      - motion

automations.yaml

  alias: Doorbell lights on
  description: ''
  trigger:
  - platform: state
    entity_id: binary_sensor.skybell_front_door_button
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: switch.turn_on
    data: {}
    entity_id: switch.led_lights
  initial_state: true
  mode: single

To confuse me more, I see this error now.
Log Details (WARNING)
Logger: homeassistant.components.binary_sensor
Source: helpers/entity_platform.py:603
Integration: Binary sensor (documentation, issues)
First occurred: 10:48:48 AM (3 occurrences)
Last logged: 10:49:08 AM

Updating skybell binary_sensor took longer than the scheduled update interval 0:00:05

I’m trying to do the same automation but binary_sensor.skybell_front_door_button always stay to “off” when I press the door bell button. What’s going on?