Closed hockey6611 closed 1 year ago
Do you mean in the BB database? I don't think the timer is supposed to be deleted after being consumed.
I guess you could call something like this after the first service call, but not sure how that would behave in BB itself:
service: babybuddy.delete_last_entry
data: {}
target:
entity_id: sensor.***_last_timer
Thank you for the quick response! And thank you for this great integration!
Do you mean in the BB database? I don't think the timer is supposed to be deleted after being consumed.
Yes, I am referring to the BB database. turning the switch on adds and starts a timer, turning the switch off deletes the timer in BB. This follows the documentation here, "Turning off the switch deletes the timer."
Consuming a timer in BB doesn't delete the timer either. However, interestingly, stopping a timer in BB doesn't delete it, like it does using the HA switch entity.
service: babybuddy.add_tummy_time
stops the timer in BB, however, it is not removed (like when switch.turn_off
is run).
So continued use of service: switch.turn_on
followed by service: babybuddy.add_tummy_time
(as I believe is the intended use case?) leads to a build up of stopped timers in BB:
Yea, that's completely normal behavior AFAIK. I think that's why @cdubz included the Delete Inactive Timers button.
Under stood - Thank you!
Do you know of a way to interact with this other than the BB interface? Not a huge deal but it would be nice to run an HA automation to clean these up. I didn't see this as part of the REST API docs either so I'd imagine not?
Could probably just repeatedly call babybuddy.delete_last_entry
. But I did think about maybe doing a PR to add API endpoint for that Delete Inactive Timers action.
When the timer switch is turned off, the timer is deleted.
However, when an 'add' service is used, the timer is stopped but not deleted. This leads to a build up of stopped timers. The below is the button I used for adding the current timer to tummy time.
Am I misunderstanding the use case for
service: babybuddy.add_tummy_time
? Or is there a way delete the time using these add services as well?