-
I have a sensor with state class "Total Increasing" that is based on data that resets daily. To make home assistant understand this and work properly I need to update the "Last Reset" field when this happens. I have tried using the "Update Config" node passing in lastReset and last_reset with a manual string matching the format in the entity config editor. I've also tried passing it a Date object, and a Date.toLocaleString() formatted string, and an epoch number. None of them has updated the last reset date in the config. I've tried glancing at the code to see how to do this, but have not yet seen that there is a way to do this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It appears the update config node was never designed to handle the Additionally, when using a sensor with
This suggests that "total increasing" might not be the appropriate value for your use case. For reference, here’s more information on the available state classes and their constraints: |
Beta Was this translation helpful? Give feedback.
-
Ah crap, yes you know I bet that state class "Total Increasing" automatically takes care of the reset since it's not expected that the value would decrease without being reset. So HA can detect the reset without a separate signal. I had originally set these up with state class measurement (not understanding the diff between them) and when I tried to use them on the Energy dashboard it gave me an error about the last reset value. I researched the state classes and found I was indeed using the wrong one and switched to total increasing, but I wrongly assumed I still needed to have last reset set. I do have some sensors I setup using the "Total" state class and would need to set the "last reset" date. But I'm not using them for anything yet, so I don't think it's a problem yet. However, I do think a way to trigger a reset or set the "last reset" field is needed. Thanks for your help. |
Beta Was this translation helpful? Give feedback.
It appears the update config node was never designed to handle the
last_reset
attribute of the sensor node, and there’s no workaround to manually update this via the API node until the custom component releases a fix.Additionally, when using a sensor with
device_class
set to "total increasing," I encounter the following error:This suggests that "total increasing" might not be the ap…