Automation Timing

First off this is absolutely NOT a criticism of HA, but figured I’d ask to see if I can improve the situation. I have an automation to turn on an LED when my TV turns on:

- alias: MB Auto Backlight on
  description: ''
  trigger:
  - platform: state
    entity_id: media_player.roku_x00000d055af
    to: 'on'
  condition: []
  action:
  - service: light.turn_on
    entity_id: light.mb_tv_backlight

It takes almost 10 seconds to actually turn on the lights but when I execute the service directly its almost instantly turned on. Is there a polling interval that causes this? Can it be changed?

It’s most likely the roku state change takes forever.

If you look on the right side, you can see the IoT Class. This one is “Polling”

IoT class: Local Polling

Meaning, it queries the device periodically to know what the state is.

You might be able to set “scan_interval” in the YAML to configure this. Higher rates can cause instability or other problems. The default scan_interval is 30 seconds for most things, including media_player devices.

1 Like