Poll State On-Demand During Automation

Is there an event or service I can fire/call during an automation to force an integrated device that uses polling to get the most recent data?

For context, I’m trying to set up a zigbee remote to skip forward or backward 30 seconds on my Apple TV. I’m using the media_player.media_seek command along with a template that takes the current timestamp (expressed in seconds from the start for ATV) and adds or subtracts 30. This does work, but I’ve found the current state to be pretty unreliable in situ. With that in mind, I’m hoping I can force a poll as an action so the seek function will work correctly. I suppose I could play/pause quickly to accomplish this, but that seem inelegant and in my experience not all apps respond to this the same way.

Yes there is. It is the home assistant update entity service. https://www.home-assistant.io/docs/scripts/service-calls/#homeassistant-services

e.g.

- service: homeassistant.update_entity
  target: 
    entity_id: sensor.your_polling_sensor
2 Likes

Thanks Tom. I’ll try it out.