Hi everyone, I'm having some questions about NodeRed. So basically I'm sending over the Spotify song name to a broker called HiveMQ. The goal is to then get it sent over to an ESP32 and get it printed on an LCD screen. The problem is that it is getting sent over to the broker every 4 seconds. However I only want it to inject when the song changes to a new one. Otherwise it keeps getting sent over and it gets printed like 20 times or so on my LCD screen which does not look good.
I was thinking of using an if statement that if soon as the song changes to a new one, it would get injected (and not every 4 seconds). I will attach an image of a part of my code aswell. You can see at the very start I have an inject node. So there I would add a function but I'm not sure how to code this or make it work. Any help would be greatly appreciated. Thanks in advance!