Hi All, just wondering if anyone can assist me, basically I have the below flow setup that tracks my phones location until I hit certain zones on the way to someones house and sends them a message in discord saying basically im round the corner.
I’ve recently discovered the Waze Travel time integration and setup an entity that will give an ETA to said persons house, I’d like to put this in the message that gets sent at the first step when my phone goes from home to not_home.
I haven’t used the Waze Travel Time integration, but assuming it creates an entity, you would use a current state node to load the state into whatever msg property you want (overriding it from the default of payload and data). Then you would use a change node to combine the distance with the message you want to send.
I ended up spending some time and using chatgpt to try and figure it out. The way I got it to work is to remove the msg.payload from the wait until node and add a new current state node to get the eta and put that into a function.
var entityState = msg.payloadeta; // Accessing state directly from msg.payloadeta
var user = msg.user; // Assuming user information is stored in msg.user
// Format the message
var message = "Just leaving mine now, I will be at yours in roughly " + entityState + " minutes";
// Set the formatted message and user as payload
msg.payload = message;
msg.user = user;
// Return the modified message
return msg;
I’m sure this is probably not an efficient way to do it but its how I ended up getting it working
Yea I saw that on your response and I was already down a bit of rabbit hole haha, I was struggling with how to format the message that feeds into the discordmessagemanager to show the text I wanted and the entity state.
I’m sure it was something really simple that I was just missing and I’ve probably gone really around the houses with my solution but I’m new to Node-red so very much still learning