Expressions in MQTT Payload?
-
I'm trying to send a video overlay to BlueIris. BI is receving my MQTT Message and it is writing it to a Macro but it doesnt appear that I can use expressions in MQTT Payloads with Reactor?
Output from BlueIris (no expression data):
I figured a workaround by using HTTP GET but I just wondered if I am doing something wrong with getting expression variables to work with MQTT.
-
OK I dont know what happened. I tried it again and it worked??? SMH...
-
@therealdb I want to caution on the words "the correct way"... the payload of an MQTT message is just a byte stream... it's a string. It is not required to be JSON, as you show here, and in fact in this topic's case, it is whatever BlueIris defines it to be. I don't know what works for BlueIris, be it JSON or the string OP builds here or something else entirely. But I wouldn't say that your response is the "correct way" because that depends entirely on what BlueIris defines the payload to be.
Edit: documentation is a bit hard to find for this part of BlueIris, at least for my "just woke up completely uncaffeinated" brain, but I tested OP's payload string with my own BlueIris and it works, so it's definitely not JSON, they're just using the URL parameter form as the payload (lazy coding, but it works).
-
@therealdb I want to caution on the words "the correct way"... the payload of an MQTT message is just a byte stream... it's a string. It is not required to be JSON, as you show here, and in fact in this topic's case, it is whatever BlueIris defines it to be. I don't know what works for BlueIris, be it JSON or the string OP builds here or something else entirely. But I wouldn't say that your response is the "correct way" because that depends entirely on what BlueIris defines the payload to be.
Edit: documentation is a bit hard to find for this part of BlueIris, at least for my "just woke up completely uncaffeinated" brain, but I tested OP's payload string with my own BlueIris and it works, so it's definitely not JSON, they're just using the URL parameter form as the payload (lazy coding, but it works).
@toggled-bits yes, you’re right regarding JSON. I was referring to the syntax to concatenate variables and constant text.
I’m not a blue iris expert and I’ll prefer mqtt anytime, since the retry logic is attached to the qos, whereas you’ll need to write a while block to retry in case of error when using http requests. -
T toggledbits locked this topic on