cyberjunky / home-assistant-fireservicerota

:fire_engine: This component tracks incidents from brandweerrooster.nl and fireservicerota.co.uk
MIT License
9 stars 2 forks source link

Sensor not updating with new incidents #22

Open jtbmedia opened 3 years ago

jtbmedia commented 3 years ago

Hi, I have the problem that the incidents sensor isn't updating upon a new incident. It only updated the incidents sensor once. When new incidents are coming they are not updated. I can see them in my brandweerrooster app.

AbeltjeNL commented 3 years ago

Same issue here since yesterday. 3 incidents and the sensor didn't update. Tried removing and reinstalling the integration and rebooting HA but no dice.

Don't know if this is Brandweerrooster or integration related. No changes in my HA setup, no output in logs pointing to this problem.

cyberjunky commented 3 years ago

I have seen it too, it seems the websocket connection doesn't reconnect correctly when disconnect, this started after a forced update of the websocket client (homeassistant updated it, and refused me to keep the old version) I will have a look...

AbeltjeNL commented 3 years ago

I have seen it too, it seems the websocket connection doesn't reconnect correctly when disconnect, this started after a forced update of the websocket client (homeassistant updated it, and refused me to keep the old version) I will have a look...

Allright. Thank you! 👍🏻

AbeltjeNL commented 3 years ago

Latest incident did trigger the sensor to get the latest incident. Maybe it's because I reinstalled the integration, don't know. Will check the upcoming incidents and keep you informed.

AbeltjeNL commented 3 years ago

Latest update:

Will have a watching eye on incidents this upcoming week.

AbeltjeNL commented 3 years ago

The latest trigger was last night. All incidents that occurred yesterday did trigger the sensor. The last incident of this morning didn't trigger the sensor anymore. @cyberjunky, i think you're right and you might have to tinker a bit.

jtbmedia commented 3 years ago

It is working again. We don't have a lot of incidents, but the incidents from last friday are updated. image

AbeltjeNL commented 3 years ago

The latest trigger was last night. All incidents that occurred yesterday did trigger the sensor. The last incident of this morning didn't trigger the sensor anymore. @cyberjunky, i think you're right and you might have to tinker a bit.

Reloading the integration fixes the issue temporarily 👍🏻

cyberjunky commented 3 years ago

It should work stable and reliable, not with restart, I have it running for days now, without issues (test account so a lot of events) image

Can you enable logging see bottom of README, and provide the log if this happens again? Any network issues you know off?

AbeltjeNL commented 3 years ago

I have seen it too, it seems the websocket connection doesn't reconnect correctly when disconnect, this started after a forced update of the websocket client (homeassistant updated it, and refused me to keep the old version) I will have a look...

@cyberjunky, what did you ment by this then?

AbeltjeNL commented 3 years ago

It should work stable and reliable, not with restart, I have it running for days now, without issues (test account so a lot of events)

image

Can you enable logging see bottom of README, and provide the log if this happens again?

Any network issues you know off?

When it happens again, I will provide logs 👍🏻

cyberjunky commented 3 years ago

I have seen it too, it seems the websocket connection doesn't reconnect correctly when disconnect, this started after a forced update of the websocket client (homeassistant updated it, and refused me to keep the old version) I will have a look...

@cyberjunky, what did you ment by this then?

This was months ago, maybe even 6 months, so alot has changed, maybe the websocket client code also upgraded (by Home Assistant updates), I cannot reproduce it, at least nog within 4-5 days I have been running it on my test server

AbeltjeNL commented 3 years ago

I have seen it too, it seems the websocket connection doesn't reconnect correctly when disconnect, this started after a forced update of the websocket client (homeassistant updated it, and refused me to keep the old version) I will have a look...

@cyberjunky, what did you ment by this then?

This was months ago, maybe even 6 months, so alot has changed, maybe the websocket client code also upgraded (by Home Assistant updates), I cannot reproduce it, at least nog within 4-5 days I have been running it on my test server

Allright. Then you can close this ticket and if I have any troubles in the feature I will open a new one.

Esv256 commented 3 years ago

Maybe you can repoduce the issue using my Brandweerrooster account. Brandweerrooster gave me the option to send alarm messages to a testgroup.

I have a sepperate VM with a old version of Home Assistant running for my automations during a alarm. Would be nice to have the automations running on my main HA instance again.

denperss commented 3 years ago

ive got the same issue :(

denperss commented 3 years ago

Any fix @cyberjunky

jtbmedia commented 3 years ago

Still issues at my side. Everything is working as it should

sijmenvos commented 2 years ago
2022-07-27 00:24:16 DEBUG (Thread-167) [pyfireservicerota] Websocket data:{"type":"ping","message":1658874256}
2022-07-27 00:24:17 DEBUG (Thread-167) [pyfireservicerota] Websocket error: Connection to remote host was lost.

Looks like the websocket is not reconnecting. After the disconnect log entry there are no ping messages anymore.

Home Assistant Core 2022.6.7

cyberjunky commented 2 years ago

Is this still an issue? I'm not a firefighter myself, so not using it daily... Will startup with test account again.

sijmenvos commented 2 years ago

I've set up a sensor to detect ping messages in the logs (debugging enabled):

sensor:
  - platform: command_line
    command: >-
      tac home-assistant.log | grep -Poi -m 1 '\[pyfireservicerota\] Websocket data:\K{"type":"ping".*' | tac
    name: last_frs_ping
    value_template: '{{ as_timestamp(now()) - (value_json.message | int) }}'

When it's more than 5 minutes ago I restart my HomeAssistant with an automation.

Last time this happend with me was 9 days ago (sept 21), not sure which version I was running back then but I update frequently.

AbeltjeNL commented 2 years ago

Is this still an issue? I'm not a firefighter myself, so not using it daily... Will startup with test account again.

Yes. It seems to become more frequent.

jtsvba commented 1 year ago

I am still experiencing this issue. Not all incidents are forwarded to Home Assistant correctly. I've enabled logging to check the next time this issue appears for me. At this moment, the last incident I see in HA is not in sync with the actual last incident.

SanneStee commented 1 year ago

I was experiencing the same issue. Had to reset/reinstall every time after an incident occured. What i did a week ago was disableing switch.incident_response. After this the issue looks to be solved for me.

SanneStee commented 1 year ago

I was experiencing the same issue. Had to reset/reinstall every time after an incident occured. What i did a week ago was disableing switch.incident_response. After this the issue looks to be solved for me.

It worked for month or so, same problem now..