I might have misunderstood the OP:s initial question, I thought he just wanted to publish an mqtt message from HA with lat, lon and a time stamp on state change of his tracker.
I don’t really know what he’s looking for, which is why I stated he was being vague.
Lay out what you have, what you want, and how you think you want to get there. It’s simple.
Mixing terminology and automation logic is confusing everyone. He kept saying that he wanted that data, I kept stating this was completely possible in node-red as alluded to in the first post, but then kept saying he didn’t know how to access the attributes.
It’s a circle of neverending confusion in this thread. If he had stated he was trying to use the HA automation and templating there, I would have known he wasn’t using node-red, but to state you have node-red and want to process data there…is just slightly confusing.
As @flamingm0e mentions, it’s not 100% clear what you want, but if understood you correct, the below will push the device tracker’s lat, lon and a time stamp through MQTT from a Home Assistant automation.
I mention node red on a HA forum, so my problem must be node red? Wouldn’t I then put the question on a node red forum? Why would I be talking about a state trigger and the device tracker?
Anyway, I assumed we were both talking about constructing a message on the HA side, and we weren’t. I’ll try to be more explicit next time.
Because people (like me) use node red for their automations??
There is a home assistant palette…it has ways to call services against your home assistant instance. When you mentioned node red, I thought you were trying to construct the message from a STATE TRIGGER in node red from your HA instance.
The device tracker can be used in node red, because node red can see everything your HA is doing…
I literally do ALL of my automations through node red and use home assistant for the state machine only.