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

Setting availability to off when not updating #332

Open
nodiaque opened this issue Nov 17, 2023 · 13 comments
Open

Setting availability to off when not updating #332

nodiaque opened this issue Nov 17, 2023 · 13 comments

Comments

@nodiaque
Copy link

Hello,

As we know, onstar tend to be a big hit and miss. After a while, you request diagnostic and get nothing. It would be nice if the availability topic would change to false when it didn't update. Also having the last successful update time in a topic would be good.

Thank you

@BigThunderSR
Copy link
Contributor

@nodiaque, I just updated my fork where the polling status is now published to a MQTT topic (which you specify) along with command response status where the topic is determined by the command name (README updated with schema). Please try the "latest" docker image and let me know what you think. I will publish the changes in a versioned release after I get some feedback. Thanks.

@nodiaque
Copy link
Author

nodiaque commented Dec 9, 2023

Oh nice, I'll be happy to try that. How do I switch to your fork?

@BigThunderSR
Copy link
Contributor

BigThunderSR commented Dec 9, 2023

The instructions are in my README. I will submit a PR here as well once I get feedback from any folks and I finalize the functionality.

@nodiaque
Copy link
Author

just found out I was already on your fork. Starting the testing, I'll report soon

@nodiaque
Copy link
Author

nodiaque commented Dec 10, 2023

Ok, I just saw that I need to add a variable for the polling status. My idea was to use the current availability status channel that is under homeassistant/vin/available. Just change this one to false and HomeAssistant (or anything other home automation using this like OpenHab) will automaticly report as offline. Could also add a message channel at the sameplace to provide more information on why it'S online/offline. Aside of that, I do see a json answer at the path provided saying
{
"ok" :
{
"message" : "Data polled successfully"
}
}

I'll check once it fail to poll.

@BigThunderSR
Copy link
Contributor

Someone can correct me if I'm wrong here. From my understanding of the code, setting "homeassistant/vin/available" to false would cause the Lovelace dashboard elements to go to "Unavailable", so I didn't want to do that which is why I elected to use a new topic altogether.

@nodiaque
Copy link
Author

I'm not on HA so I cannot say on that. For me this put the things (in openhab we call them things) to offline. I can still read the last value they add but since it's offline, it tell me it failed last polling. Even having it "unavailable" in HA for me would say "well, onstar doesn't work right now".

@BigThunderSR
Copy link
Contributor

BigThunderSR commented Dec 10, 2023

Here's what I mean.

Part of my Lovelace dashboard even while I have 504 errors:

image

Here's what happens when I set the availability topic to "false":

image

I don't want my entire dashboard to look like this just because of the 504 errors.

You can parse the JSON per your above post to do exactly what you are needing to do with regards to determining if things are working or not.

@BigThunderSR
Copy link
Contributor

@nodiaque. the latest update I made should give you what you were looking for without breaking existing functionality as I noted above:

  • MQTT_ONSTAR_POLLING_STATUS_TOPIC/lastpollsuccessful - "true" or "false" depending on status of last poll
  • MQTT_ONSTAR_POLLING_STATUS_TOPIC/state - Polling Status and Detailed Error Messages in JSON

Please re-pull my "latest" image which was just published and try again. Thanks.

@nodiaque
Copy link
Author

yeah I just saw the lastpoolsuccessful one, I'll incorporate this somewhere.

Is it normal this container doesn't properly stop? At least in unraid, when I request a stop, it wait the full 60s timeout and then kill it

@BigThunderSR
Copy link
Contributor

yeah I just saw the lastpoolsuccessful one, I'll incorporate this somewhere.

Is it normal this container doesn't properly stop? At least in unraid, when I request a stop, it wait the full 60s timeout and then kill it

I don't have any issues with this container running in a HAOS VM on VMware.

@tylerpieper
Copy link
Contributor

@BigThunderSR You could wrap your car info in a conditional card and hide/replace it when the entities go unavailable.

@BigThunderSR
Copy link
Contributor

This might all be moot depending on all the changes that @garyd9 is making, so let's see where all that lands. 🙂

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

No branches or pull requests

3 participants