benleb / sureha

SureHA 🐾 monitor & control your Sure Petcare devices via Home Assistant
Apache License 2.0
21 stars 12 forks source link

Pet data is out of sync #18

Closed xbmcnut closed 3 years ago

xbmcnut commented 3 years ago

Hey Ben,

With all my recent playing around with the various versions, one of my three pets has had the HA database or connection go skew-whiff. My cat came in this evening at 2000hrs and the Sure Flap app reports this correctly but surha shows the time as 1725 and the 'where' attribute is out of sync with the sensor state. When a pet sensor is 'on', the where attribute should be 1 but you'll see below the sensor state and where are out of sync.

image

So while a card displaying binary_sensor.pet_kobe shows him as 'Home', the code below shows him as "Outside since 1725"

"{{ state_attr('binary_sensor.pet_kobe', 'where') }} since {{as_timestamp(state_attr('binary_sensor.pet_kobe', 'since')) | timestamp_custom('%H:%M')}}" 

Is there an easy way to fix that? My other two pets are reporting correctly.

benleb commented 3 years ago

hm interesting... I will check this!

Thank you btw! Your issues are really helpful for all the others 👍

benleb commented 3 years ago

hey could you please test if its fixed with the current dev version available via HACS? :) image

xbmcnut commented 3 years ago

Glad to help. Driving the wife a bit nuts but all in the name of science! And yes, that dev version has aligned the sureha data with the cloud. Thank you!

benleb commented 3 years ago

Perfect 👍