Fitbit End/time API error

Within the fitbit API it’s possible to get your wake-up time by sleep : endTime Fitbit sleep API page
I want to get this working within Home Assisant

When defining end/sleep in configuration.yaml
- "sleep/endTime"

I get the following error
Invalid config for [sensor.fitbit]: value must be one of ['activities/activityCalories', 'activities/calories', 'activities/caloriesBMR', 'activities/distance', 'activities/elevation', 'activities/floors', 'activities/heart', 'activities/minutesFairlyActive', 'activities/minutesLightlyActive', 'activities/minutesSedentary', 'activities/minutesVeryActive', 'activities/steps', 'activities/tracker/activityCalories', 'activities/tracker/calories', 'activities/tracker/distance', 'activities/tracker/elevation', 'activities/tracker/floors', 'activities/tracker/minutesFairlyActive', 'activities/tracker/minutesLightlyActive', 'activities/tracker/minutesSedentary', 'activities/tracker/minutesVeryActive', 'activities/tracker/steps', 'body/bmi', 'body/fat', 'body/weight', 'devices/battery', 'sleep/awakeningsCount', 'sleep/efficiency', 'sleep/minutesAfterWakeup', 'sleep/minutesAsleep', 'sleep/minutesAwake', 'sleep/minutesToFallAsleep', 'sleep/startTime', 'sleep/timeInBed'] @ data['monitored_resources'][34]. Got 'sleep/endTime'. (See ?, line ?).

How can this be fixed?

Home Assistant 2023.2.2
Supervisor 2023.01.1
Operating System 9.5
Frontend-versie: 20230202.0 - latest

Take a look at the official Fitbit integraton Docs, here. The Integration does not expose all the endpoints that the Fitbit API exposes. As you can see in the error message, your are asking for sleep/endTime, but that’s not a valid resource - at least not with the integration.
You can either go to the integration’s GitHub page and open an issue there (and hope that they will add your requested resource), or use the rest platform to poll the FitBit API yourself.

Cheers!

Alternatively you can make a template sensor to calculate it from these two attributes:

sleep/startTime
sleep/timeInBed
2 Likes