jcgoette / baby_buddy_homeassistant

This custom integration provides sensors for Baby Buddy API endpoints.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to call services from HA

jampez77 opened this issue · comments

Adding tummy / sleep time always fails but i'm not sure why.

Here is my service data:

service: babybuddy.services_tummy_times_add
data: 
  child: sensor.baby_nandhra_pezone
  start: 2021-07-13 09:15
  end: 2021-07-13 09:20

Here is what the logs say
Cannot create tummy-times, check service fields

Here is the baby sensor details as seen in HA.

id: 1
first_name: Baby
last_name: Nandhra-Pezone
birth_date: 2021-08-09
slug: baby-nandhra-pezone
picture: null
child_name: Baby_Nandhra-Pezone
endpoint: children
friendly_name: Baby Nandhra-Pezone
icon: mdi:baby-face-outline

From what i can see the service fields are right so I think something else might be going on here. Oddly though it did work the once but not since. The only thing i've changed since at all is the start and end times.

Can you post some of the data from your Baby Buddy instance https://...api/tummy-times/ ?

Can you post some of the data from your Baby Buddy instance https://...api/tummy-times/ ?

Sure, FYI id 1 was added within babybuddy. id 2 was the only time adding from HA worked.

{
    "count":2,
    "next":null,
    "previous":null,
    "results":[
        {
              "id":2,
              "child":1,
              "start":"2021-07-13T08:00:00Z",
              "end":"2021-07-13T08:05:00Z",
              "duration":"00:05:00",
              "milestone":""
        },
        {
              "id":1,
              "child":1,
              "start":"2021-07-07T12:10:19Z",
              "end":"2021-07-07T12:15:19Z",
              "duration":"00:05:00",
              "milestone":"nah"
         }
    ]
}

To be sure, it worked once 7/13, then no longer worked?

False alarm! sorry. This was entirely my fault.

BB and HA were on different timezones. Everything is grand now.

I don't think BB exposes TZ (currently), so I might add that ✔️✔️ to the error message.

I'm reopening this as I've just had the same issue for a different reason. Essentially one feed ended at 17:05 and the next feed started at 17:05.

This kept failing and when i decided to enter it manually I got the error message about the times overlapping. Could it take into account seconds as well as minutes in the timestamp?

Should be resolved when PR #33 is merged.