Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI System Status is showing disconnected every time after rebooting Home Assistant #423

Closed
reesion opened this issue Feb 16, 2021 · 10 comments · Fixed by #424
Closed

AI System Status is showing disconnected every time after rebooting Home Assistant #423

reesion opened this issue Feb 16, 2021 · 10 comments · Fixed by #424
Assignees
Labels

Comments

@reesion
Copy link

reesion commented Feb 16, 2021

What trouble are you having?
AI System Status (binary_sensor.ai_system_status) is showing disconnected every time after rebooting Home Assistant. I will need to restart the ai-trigger container to bring the status back to "connected"

Have you tried with the sample files?
No
Have you tried the steps in the troubleshooting guide?

https://github.com/danecreekphotography/node-deepstackai-trigger/wiki/Troubleshooting
Ye

Log entries

Please copy and paste all the log messages from the Docker output

Installation details

  • OS: [e.g. Mac, Windows 10]
    Debian
  • Docker setup [e.g. sample docker-compose.yaml, Portainer, UnRAID, etc]
    Portainer with docker-compose.yaml

Additional context

Add any other context about the problem here.

@neilenns
Copy link
Owner

Do you have retain set to true in the MQTT section of your settings file?

@reesion
Copy link
Author

reesion commented Feb 16, 2021

No. I didn't have that set but I have now set it and that seems to fix the issue.
Thank you very much.

@reesion reesion closed this as completed Feb 16, 2021
@neilenns neilenns reopened this Feb 16, 2021
@neilenns
Copy link
Owner

neilenns commented Feb 16, 2021

Thinking about this a bit more I don't think this is a real fix. The system should be sending "online" MQTT messages periodically. I'll think about this a bit more.

@neilenns neilenns self-assigned this Feb 16, 2021
@linuxkidd
Copy link

Agreed, the 'retain' is not a good fix. I've had lingering trigger events in MQTT ( BlueIris/admin ) with 'retain' that cause BI to crash during start-up. Took me a good long while to find that issue.

@neilenns
Copy link
Owner

Notes to myself:

Currently online is published here:

https://github.com/danecreekphotography/node-deepstackai-trigger/blob/d1a11baa957f1956279d1afe154b78132fd34307/src/main.ts#L122

This should probably move inside MqttManager and just be done inside a timer that keeps firing every whatever seconds. If I wanted to get fancy the interval could get specified in the settings file.

neilenns added a commit that referenced this issue Feb 16, 2021
@neilenns
Copy link
Owner

Ok I have a build for you to try @reesion. Change your Docker config so instead of pulling latest it pulls issue423. Then use some sort of MQTT tool (if you are on Windows the MQTT Explorer app from Windows Store is amazing) to clear out the retained status message.

Then fire up everything. You should see a new "online" message pop in every 60 seconds. If you kill HA and restart it will pick up the proper online status at the next health message arrival (within 60 seconds).

@reesion
Copy link
Author

reesion commented Feb 16, 2021

Have just tested this and it works.

image

@neilenns
Copy link
Owner

Noice!!! Thanks. I'll get this released as v5.8.0 later today and let you know when it's out so you can flip back to latest.

neilenns added a commit that referenced this issue Feb 16, 2021
* Add repeating MQTT health message
Fixes #423

* Update changelog

* Add missing await statement
@neilenns
Copy link
Owner

This is now deployed. You can switch your docker tag back to latest @reesion .

@reesion
Copy link
Author

reesion commented Feb 17, 2021

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants