Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feeds/Sleeps/TummyTime that start before midnight and end after midnight are not saved. #145

Open
brylee123 opened this issue Jan 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@brylee123
Copy link

brylee123 commented Jan 2, 2024

service: babybuddy.add_feeding
data:
  method: Bottle
  type: Fortified breast milk
  amount: >-
    {{ (states.input_number.bottle_pre_feed.state | int) - (states.input_number.bottle_post_feed.state | int) }}
  notes: Auto-Log from Smart Scale.
  start: >-
    {{ as_timestamp(states.input_datetime.baby_feed_start.state) | timestamp_custom('%H:%M:%S') }}
  end: "{{ now().strftime('%H:%M:%S') }}"
target:
  entity_id: switch.baby_timer

If a feed starts and ends on the same day, this is not an issue. It will populate the correct times for both fields. I am assuming since this service call only takes a time format instead of datetime, it assumes the times are all on the same date, which causes these issues.

My proposed solution is to use a datetime object across all the service calls. Pumping, tummy time, sleep, and feedings.

Edit: I want to point out that I am not using the timer feature as I am storing start and end times automatically in a sensor/input_datetime object. I am unsure on how to use the timer feature (via home assistant service calls) when I would need multiple timers to be simultaneously running. (sleep, feedings, etc)

@brylee123 brylee123 changed the title Feeds that start before midnight and end after midnight are not saved. Feeds/Sleeps/TummyTime that start before midnight and end after midnight are not saved. Jan 2, 2024
@jcgoette jcgoette added the bug Something isn't working label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants