jasonmadigan / ha-hkc

HKC Alarm integration for Home Assistant
10 stars 4 forks source link

All sensors marked as "Open" #34

Open SgtHobNob opened 1 week ago

SgtHobNob commented 1 week ago

All my sensors are displaying as "Open" when the app shows them all as "Closed".

I did change some settings on the system itself a while ago, not sure if it's related, a setting I need to restore? Odd how it's reporting differently to what the app shows. I've tried to change user etc, re setup the add on but nothing has worked.

Thanks in advance

SgtHobNob commented 1 week ago

Im getting the following errors repeated for each sensor that I have, for some reason it always references Garage and then refers to a different sensor, it cycles through them all as below;

2024-11-03 02:19:10.243 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Failed to parse panel time: Garage for sensor Living PIR. Falling back to previously known panel offset. 2024-11-03 02:19:10.243 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Living PIR state determined as 'Open' due to timestamp within 30 seconds of panel time.

once it's been through all of the errors it then records;

2024-11-03 02:19:11.495 DEBUG (MainThread) [custom_components.hkc_alarm.alarm_control_panel] Finished fetching hkc_alarm_data data in 0.244 seconds (success: True)

SgtHobNob commented 1 week ago

I renamed the Garage sensor now I get a mix of the following;

2024-11-03 02:52:10.223 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Living PIR state determined as 'Closed'.

A minute later;

2024-11-03 02:53:10.266 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Living PIR state determined as 'Open' due to timestamp within 30 seconds of panel time.

The time on the alarm panel is showing correctly

SgtHobNob commented 1 week ago

Just had a look at the history of the sensors, they seem to have been messing up since the clock changed.

jasonmadigan commented 6 days ago

thanks for reporting, sounds like a DST bug. Will look at later this week.

jasonmadigan commented 15 hours ago

@SgtHobNob I don't have a panel with this issue personally to test (mine auto-updated with DST changes), but I've published a pre-release version with a potential fix as 1.0.20-beta1

SgtHobNob commented 14 hours ago

@jasonmadigan thanks for taking a look, the alarm panel did auto update the time and is showing correctly on the panel

I'm now getting the following;

2024-11-12 16:32:29.520 DEBUG (MainThread) [custom_components.hkc_alarm.alarm_control_panel] Finished fetching hkc_alarm_data data in 0.220 seconds (success: True) 2024-11-12 16:32:29.606 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Finished fetching hkc_sensor_data data in 0.274 seconds (success: True) 2024-11-12 16:32:29.607 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Landing PIR state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.607 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Kitchen PIR state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.607 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Garage DC state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.608 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Front Door state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.608 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Back Door SC state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.608 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Back Door C state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.608 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Living WC 2 state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.608 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Living WC state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.609 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Kitchen WC state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.609 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Garage IDC state determined as 'Open' due to timestamp within 30 seconds of panel time. 2024-11-12 16:32:29.609 DEBUG (MainThread) [custom_components.hkc_alarm.sensor] Sensor Living PIR state determined as 'Open' due to timestamp within 30 seconds of panel time.

jasonmadigan commented 14 hours ago

Hmm, confused about the bug so. Likely not actually an issue with DST if your panel has the right time. Perhaps the timezone of whatever us running the integration/HA is out of sync with NTP?

SgtHobNob commented 14 hours ago

I'm running HA OS as a VM on unraid server, the date/time is correct on both unraid and HA OS, just synced them to see if it made a difference, but no luck.