Open alvinchen1 opened 2 years ago
Anyone had already found a solution for this? I have exact the same issue.
This is a longer known issue, got an aha moment, and suspect we need to use UTC datetime to calculate date, will test it.
This issue still comes up for me. Weight /scale data is lost after midnight. Any additional info I can give? I'm in timezone CET+1.
I've got the same issue
HI, I have the same issue. Is there a temporary work around or a version to test any fix ?
Hi guys, this issue of no data around midnight has been there from the beginning, I thoughted it maybe had something to do with timezone differences.. But didn't get it fixed yet. Will ask if author of Garth has same experience, I will keep you updated?
Anyone looking for a temporary mitigation could use the template sensor below.
template:
- trigger:
- platform: state
entity_id: sensor.weight
not_to:
- unknown
- unavailable
sensor:
- name: "Garmin - weight"
icon: "mdi:weight-kilogram"
device_class: weight
unit_of_measurement: "kg"
state_class: measurement
state: >-
{{ trigger.to_state.state | float(0) }}
Aside from my previous comment, for other sensors it could be nice to have a total_increasing sensor which you can than plot in a graph like is done in e.g. the HA energy dashboard. Still a bit annoying if you miss a day or not update before midnight as it will reset back to unknown/unavailable again until the next update, but it's better than nothing 😅
- trigger:
- platform: state
entity_id: sensor.total_kilocalories
not_to:
- unknown
- unavailable
sensor:
- name: "Garmin - total calories"
icon: "mdi:dumbbell"
unit_of_measurement: "kcal"
state_class: total_increasing
state: >-
{{ trigger.to_state.state | float(0) }}
@cyberjunky are these kind of total_increasing values available from the Garmin interface instead of a daily value that resets?
Hello, great integration. I have noticed that with my Garmin Fit Scale, that my weights come through, but at about midnight my local time, the values revert to "unknown".
Here's an example of weight, that shows the value in the history log, but seems the state changes from the value to 'unknown' at shortly before midnight local. (It is currently almost 11:00 local, and the screen shot shows 11 hours ago last change).
This appears to affect the following sensors:
sensor.body_fat sensor.bmi sensor.body_water sensor.bone_mass sensor.muscle_mass sensor.visceral_fat sensor.weight
All of which have values, but then change to 'unknown'. I looked over your code, and it looks like you are just taking stuff from Garmin and putting it into the sensor, but perhaps, it is possible to do a check on these weight values and if they come through as 'unknown' from Garmin, maybe drop it and don't pass it on to the sensor?
I'd be happy to provide additional debug or logs information if it would help to resolve this issue. Thanks!