Update sensor when another sensor is updated

Hello!

I have a sensor, my electrical meter, that is updated via MQTT every 10 seconds. I have another sensor, my solar panels, that is read from REST at any scan interval I configure.

I would like to configure my REST scan to be triggered only when my electrical meter is updated. I.e., instead of using scan_interval I want another sensor update to control the scans. Is this possible to do?

Yes.
You set the rest scan interval to a ridiculous long interval, like months or years.
Then you create an automation that triggers on state change of the electricity sensor.
The action is a service called something like home assistant update entity and the entity is the solar panel sensor.

1 Like

Worked like a charm! Thank you

1 Like

As a question to this as I have never tested it … does the automation “reset” the scan_interval? If it doesn;t (in theory, it could get out of whack at some point).