I apologize in advance if this isn’t the right Category for this.
I’d like to build a mobile gps-enabled router for a vehicle. Why not just use the HomeAssistant App? Well, for mostly for the “gee whiz, why not” factor, but also in case the vehicle is stolen or borrowed by a friend/teenager, and I want to track it.
So, I have an LTE and GPS capabled router in one of my vehicles that can beacon its GPS coordinates at whatever frequency I want it to.
In essence, I’d have the router “put” the vehicle’s latitutude/longitude somewhere, either in the entity data itself, or wherever else I come up with (maybe a simple database somewhere that HomeAssistant can access?).
What I am clueless on is how to 1) create the entity from scratch, and 2) update that entity with the GPS data.
Can somebody point me in the right direction?
How will you communicate to HA? And keep track of previous entries?
I mean you could run mqtt via the internet. But you’d need something to record values. Though home assistants recorder will do that is you continually update a single sensor. There other other programs that home assistant can talk to that are designed for this - traccar for example.
But you router and a script or something that pokes a lat/long via mqtt that home assistant can then pick up would give you the current position. You just wont necessarily be able to generate a map with your driving on it.
I’m not really sure I need to keep track of previous entries. All I’m really interested in is the vehicle’s (router’s) current location. Unless you think there’s something I’m leaving out.
What I have now is a php template file with a sqllite database that gets updated with the routers coordinates.
As for getting the data into HA, that’s what I need help with… I was really hoping there was a REST API or something I could use to update the entity…
Having the router update the entity itself (or a sqllite database inside HA that the entity could reference) would be ideal for this, so I can not worry about having a php server involved at all.
Maybe I’ll use the Mobile App tracker entity as a template. Does anybody know where the actual entity data for each entity is stored?