So I have a counter entity that counts up every day, and resets every time my cats litterbox is being cleaned for longer than 2 minutes (so not a daily clean, but being emptied completely) to track when it is time to do a full clean again (after x days).
The issue is that sometimes (very rarely) I will do the daily clean for slightly longer than 2 minutes, causing the counter to reset when it shouldn’t. This disrupts the proper cleaning cycle.
The automation also sends a notification to the user telling them “litterbox counter reset”
So I figured i should add a button to the notification that the user can press to restore the “previous” counter state, should the previously mentioned accidental reset happen.
I was trying to achieve this with scene.create and scene.turn_on.
There’s not much documentation on scene creating with other entities than light entities, but nowhere did I find a finite list of entities that can be recorded in scenes.
scene.create and scene.apply are not working for my counter entity in home assistant. As soon as i try to restore the counter to a different value than the current value, i get “extra keys not allowed @ data[‘step’]. Got None”
Am I missing something, or is this a bug?
Please let me know if you have a better idea to restore counters to their previous state.
service: scene.create
metadata: {}
data:
scene_id: previous_litterbox_state
snapshot_entities:
- counter.litterbox_opened
service: scene.turn_on
data: {}
target:
entity_id: scene.previous_litterbox_state