eavanvalkenburg / pysiaalarm

A python package to connect to a SIA DC-09 based alarm system.
MIT License
39 stars 29 forks source link

Event timestamp is no longer valid #14

Closed BaQs closed 3 years ago

BaQs commented 3 years ago

Hi there, since few days I noticed the SIA home-assistant HACS integration is failing.

In my logs, lots of:

2021-05-24 16:57:19 WARNING (MainThread) [pysiaalarm.base_server] Event timestamp is no longer valid: 2021-05-24 14:58:20+00:00

I triple-checked all my timezones configurations in home-assistant, all is fine. I see in the logs that you modified the way the integration behaves according to timestamps, maybe it's related ? I tried to downgrade but I'm facing further errors (like key error timestamp).

any clue ? any further intel needed maybe ?

eavanvalkenburg commented 3 years ago

I've had the same with my system, seems ajax related, you can indeed change the timestamps that area allowed, and if you make those numbers bigger it will work again. The official integration was just merged and it had a options flow for this but that isn't in this version.

shinyone commented 3 years ago

Thanks for the update

eavanvalkenburg commented 3 years ago

if you have a Ajax system as well, make sure to also notify them!

phil2fer commented 3 years ago

Hello @eavanvalkenburg . Could you reopen this issue, there are a problem with NAK message refer to the protocol, the NAK message must contain a timestamp, (with this timestamp, the client adjust his clock and resend the message).

but in your code there is no timestamp in the NAK reply message (and the NAK message must never be encrypted).

I try rapidly to add timestamp line 319 in event.py and it's working, but i think the code must be (a lite) rewrited

eavanvalkenburg commented 3 years ago

Thanks for this @phil2fer, I didn't know that, but it is indeed in the docs! thanks I will add something and create a new version!

eavanvalkenburg commented 3 years ago

Just released a new beta version (3.0.1b1), if you put that into the manifest of the custom component, you should be able to see if it works!

phil2fer commented 3 years ago

Hello, for me it's ok. Thanks