7 posts / 0 new
Last post
ntompson
Force module to update to OVMS server

Hi,

New user of OVMS - very impressed so far. I'm wondering if there is some way I could write a script to force the OVMS module to push an update towards the OVMS server when an event occurs. I'm finding that the OVMS module only pushes out updates at the "idle" rate (default 10 minutes) most of the time, which is generally completely OK. However, there are certain events (like plugging / unplugging the charger, or starting the car), where it would be helpful for my home automation system to immediately get refreshed data. So it would be nice to be able to force the OVMS server data to be updated by the module as soon as the event occurs.

I haven't been able to find anything in the docs that can force the OVMS module to do an immediate server update.

Can anyone help me with this please?

Thanks,

Nick

markwj
markwj's picture
The system should immediately

The system should immediately send data updates out v2 protocol should significant events occur (like car on/off, charge start/stop, etc). The 1min / 10min timer is just for the less critical data.

dexter
dexter's picture
Force module to update to OVMS server

Nick,

Mark is right, but I nevertheless think having the option to request an immediate update for metrics/events not classified as important by the servers makes sense as well.

So I've implemented commands for this:

https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/commit/8ad36635dd4506ff49b746fc6ca26f13b6830f37

The update is on my server in "edge" and will be available on the main server within 24 hours.

Regards,
Michael

ntompson
Thanks

Thank you both, that's very helpful. And apologies for the late note - I missed your updates. I'll absolutely make use of the new manual server update commands - could be very helpful.

Since my original post, I've realised that, by using the OVMS v2 server API connect call, I can control the 1 vs 10 minute updating behaviour. So now in my home automation system (Home Assistant), I've set up automations to fire the connect / disconnect API calls when charging starts / finishes so that I get 1 minute resolution during charging. A few extra manual updates at key events (or a bit after them) will likely fill out the picture nicely.

Thanks again.

hjoergen
How to connect/disconnect?

How did you implement the connect/disconnect in Home Assistant? I did my implementation with a command-line integration (https://ovms.dexters-web.de:6869/api/status/$VEHICLEID. But the update takes 10 minutes. Can you post your configuration?

hjoergen
How to connect/disconnect?

How did you implement the connect/disconnect in Home Assistant? I did my implementation with a command-line integration (https://ovms.dexters-web.de:6869/api/status/$VEHICLEID. But the update takes 10 minutes. Can you post your configuration?

dexter
dexter's picture
connect/disconnect in Home Assistant

I'm no Home Assistant user, but you can easily put multiple API calls in a sensor, as is shown here:

https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/issues/650#issuecomment-1286771059

So you would simply add another curl to that.

I've just extended that issue thread about how I'd expect this to work.

 

Log in or register to post comments
randomness