-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT remote control of UI3 #117
Comments
I thought a lot about this and did a little research. Based on my limited MQTT knowledge I can come up with this: I would add a "MQTT" section to UI3's settings panel. Inside this, you could configure:
Then when it is all configured and enabled, I would have UI3 publish and subscribe to the topic One thing seems fairly clear, MQTT is not meant to operate like a traditional TCP socket or a message queue. Like, imagine you wanted to export a clip. MQTT doesn't seem like a good way to communicate this intent to UI3, especially if persistence is enabled on an MQTT broker, because the command could be received multiple times and the message could end up still existing after it was handled. Thankfully plenty of more common tasks are perfectly suited for MQTT. Imagine instructing UI3 what the state of the UI should be by publishing a string to Example: When you want to change the state, you publish a new value here and it replaces the old state. That seems simple enough. But it doesn't take long for questions to arise. Imagine the remotely-controlled UI3 instance has a local user who clicks on a camera. What is supposed to happen? Does UI3 change its state without notifying via MQTT? Does UI3 prevent local changes while MQTT remote control is enabled? Does UI3 allow the state change, but publish the new state to the MQTT topic? I think that last option is clearly the best. But then, is the 3rd-party MQTT client expected to understand and consume JSON markup? So we could split the state into multiple topics, not using JSON encoding. e.g. This multiple-topic method may be easier for most MQTT clients to work with. Especially if UI3 is going to be publishing its own changes to the state as a user interacts directly with UI3, I bet this would make the information a lot easier for 3rd-party MQTT clients to consume. I could have each UI3 instance announce its online/offline status by publishing I also don't know what other information might be useful for UI3 to publish or subscribe to. It could publish all kinds of things related to the current state of the UI. Current frame rate. Current streaming bit rates (for audio and video separately or together). The active streaming profile. Play/pause state. There could be a way to remotely set a timeline position or open a clip and seek to a position. Any suggestions are welcome. |
Doesnt the console version of BI use mqtt already, can we just copy most of the functionality? I like what you came up with already as well. |
I thought I had replied to this yesterday but I don't see it. Shame. It was a very detailed reply. Blue Iris does have MQTT support baked in already but most of what it does is very different from UI3's needs. BI also did things pretty weird, making clients poll for status instead of doing the MQTT standard thing of just publishing the data and letting clients subscribe if they want. For actual remote control, BI just allows you to send the same admin commands that would normally be sent via HTTP, but using MQTT instead. Its not ideal by any means, but it was their easiest way to implement a lot of functionality. I would do it differently with UI3 in a way that better-embraces MQTT's strengths. |
Yes, I think your idea to make it better would be wise. They are two different use cases, from my point of view. The UI3 is just the display side whereas the console is more configuration and management.
Let me know if you have any builds you would like me to test with mqtt.
Thanks again
Jason
On Friday, June 17, 2022, 09:19:37 AM PDT, bp2008 ***@***.***> wrote:
I thought I had replied to this yesterday but I don't see it.
Blue Iris does have MQTT support baked in already but most of what it does is very different from UI3's needs. BI also did things pretty weird, making clients poll for status instead of doing the MQTT standard thing of just publishing the data and letting clients subscribe if they want. For actual remote control, BI just allows you to send the same admin commands that would normally be sent via HTTP, but using MQTT instead. Its not ideal by any means, but it was their easiest way to implement a lot of functionality. I would do it differently with UI3 in a way that better-embraces MQTT's strengths.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Implemented in UI3-216. Feedback would be welcome. |
The implementation differs slightly from what I described above ( There's a full Help file section for the MQTT functionality, linked from the top of the MQTT configuration area in UI Settings. |
UI3 does not currently have any MQTT capabilities, but I recently learned that MQTT brokers commonly support web socket connections. So it should be technically possible for UI3 to connect to a broker and subscribe to, or push messages to, any MQTT topic.
This could enable remote control of specific UI3 instances. Trouble is, I have no idea how a potential user would expect this to work, so I don't really know where to begin in designing such a remote control system.
Anyone with any suggestions, or interest in this feature, please comment here.
The text was updated successfully, but these errors were encountered: