Use integration update as trigger?


I have LibreHardwareMonitor sending information about my PC to Home Assistant.

I have found out that the integration actually accepts a scan_interval value, and the lowest value I can set it to is 15.

  - platform: openhardwaremonitor
    host: x.x.x.x
    scan_interval: 15

I would like to trigger an automation every time the integration fetches new data.

Is that possible?

Doesn’t the integration create sensors in your entities that would have a status change? Or numbers going up/down etc.? If so, you could create an automation that would react to any of those triggers.

Yes, it does indeed create a bunch of sensors, and I know about the state.last_updated object.

I also thought about using that on just one of the sensors, but state.last_updated doesn’t update unless the value changes.

Now… some of the sensors are fans, and I know that it is unlikely that none of them will have changed its speed 15 seconds from now, but still it would be nice to be able to use the platform update as the trigger.

Maybe I should just look at all the sensors as a whole. That would potentially never miss an update.

Is there an elegant/easy way of doing that?

You could create a binary sensor group for all your sensors in the helper section and then check for a state change. Just make sure you don’t select the “all entities” option. Now if any of your sensors gets an update, your automation will be triggered.

Question is why you would want an automation if nothing has changed and all the stats on your PC are still the same but maybe I’m not getting the point.

I am toying with the idea of having a counter that shows the remaining time until the next update.

But wouldn’t that create the same problem for you (of not having a trigger for the actual update)? I thought the updates from your integration come in a defined time intervall, not at fixed times?

I don’t need a trigger for the update.

I need the update to trigger an automation that starts a 15 second timer.