dan-r / HomeAssistant-NissanConnect

Unofficial Home Assistant integration for interacting with Nissan Connect vehicles đźš—
MIT License
45 stars 12 forks source link

Manual polling through automation? #42

Closed JPStahre closed 2 months ago

JPStahre commented 2 months ago

Is there any way to perform a manual polling through an automation? Manual update I could find, but for some reason the car info in my NissanConnect won't update unless I enter the NissanConnect iPhone app and enter/exit a submenu, even though it should be polling every 30min when charging (my setting in the HACS integration). When I do open the iPhone app and perform an update (which I guess performs a polling of the car) then I can do a simple "update data button push" in the HACS integration.

My use case is polling the car once in the evening to plan my charging for the night and once in the morning to confirm my charge before I plan my morning routine.

Best regards, Jonatan

dan-r commented 2 months ago

I'm not sure what the ask here is. The integration automatically updates on schedule and the update data button both polls the car and pulls the latest data. One of these should cover your use case, and you can always programmatically "push" the update data button.

JPStahre commented 2 months ago

Ah, didn’t know the update data button polled as well. That definitely solves my ask. Cheers!

The reason for my confusion was that since the setup clearly differentiates between “polling” waking the car up for new data and “update” just fetching the latest info, I figured that would apply to the update button as well.

Thanks for a very swift reply and a much wanted integration!

dan-r commented 2 months ago

Point taken - it's a tricky one. The update button does both, but updates immediately after polling because there's no set time for how long it'll take.

Because of this it often won't get the new state unless you press update again after a few seconds/minutes, depending on a variety of factors.

In an automation I'd press the button, leave it a few minutes and then press it again.

JPStahre commented 2 months ago

Cheers!