Entity management: set sensor state via service #454
-
based on this thread and python script https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/ My use case: I have a sensor that reads the input from my solar meter but if the solar power drops to 0 the sensor keeps the last value until the other day when the solar production is above 0 so it never becomes 0. Normally I would make a template with condition and set the state to 0 if the last update is more then 20 minutes or past a specific time (night). But then I have 2 entities which are more or less the same and I have to find and alter every automation/flow (nodered)/script/dashboard and use the template. With a set sensor/entity) state service I could make an automation which updates the sensor after a specific time/last changed to 0. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That will not work. Each poll or push it will be overwritten. Above all, the only way to do this, is by injecting it directly in the state machine (which will lead to multiple issues). Like, I am happy to add a lot, but this will cause more problem than it will solve. ../Frenck |
Beta Was this translation helpful? Give feedback.
That will not work. Each poll or push it will be overwritten. Above all, the only way to do this, is by injecting it directly in the state machine (which will lead to multiple issues).
Like, I am happy to add a lot, but this will cause more problem than it will solve.
../Frenck