Is it possible to use MQTT only over WIFI?

Using 4G via hologram sim, I am trying to use as little data as possible. I have automations on my mobile phone to turn on wifi hotspot when car bluetooth connects, for ovms to be able to use Wifi all the time.

I need to get my vehicle data to a MQTT broker that is connected when at home wifi. Is it possible to limit running server v3(MQTT) when car is connected to home Wifi? (or mobile wifi, why not - it is not connecting to MQTT there anyways)

There’s no reason MQTT can’t be sent over 4G, it’s just data. It seems more of a question of where the MQTT broker is that you are using or plan to use and where the reporting server is relative to that. If the MQTT server is in your home network, then you’d have to expose it to the internet, or have a VPN on the mobile device linked to your home network. You could also use a public MQTT server, but that opens other issues.

I’d need to have a clearer view of what you’re trying to do, OVMS isn’t something I’ve used.

I used poor choices for words. I used my MQTT server’s lan ip to configure OVMS to use mqtt over lan. I don’t want to expose mqtt, or anything else preferably to internet.

Biggest considerations for not using mqtt over 4G are the costs. Now I’ve seen 1.4-2.7euros/month costs for our leaf’s OVMS unit. Keeping those costs in line was my problem.

There is a possibility to use JS scripting for different things in OVMS. maybe there would be possible solution to this ‘issue’?