When I reload the command line platform via the developer tools, HA executes the command and populates the sensor correctly. But then it will not update the sensor in regular intervals.
In the HA container’s shell I’m executing ps -ef just to check the PID and each time I do it, the PID of ps increases by one, meaning that HA is not executing any commands in the meantime.
I’ve also tried setting scan_interval explicitly and that changes nothing.
Just noticed that the sensor did refresh after 1 hour since reloading the configuration. Which made me thinking…
I already had two command line sensors previously and they had scan_interval set to 3600. So I have removed scan_interval from both of them and reloaded the configuration again - no change. Then I have restarted HA and voilà!
So it appears that:
scan_interval is shared among all command line sensors
It takes a HA restart for the new scan_interval value to take effect
Is that an expected behaviour? I’d say at least (1) is a bug.
I can confirm the same issue, reloading the command line sensor updates the sensor, but does not affect the “scan_interval”, a restart (to reload the config as a whole) does the trick.