At first I couldn't think of a use case, but then I realized that being able to pull up a specific camera feed based on a specific MQTT event would be really helpful. I know you can currently set the GUI to automatically pull up a camera that has been "triggered" in BI, but this feature would take that and expand it to events outside of the BI triggering system. Doorbell rings, a door being opened, an alarm system's motion detector, a light being turned on/off, weather conditions, time of day, dawn/dusk, etc, etc, could all be used to trigger a specific GUI/camera view(s).
I'm not sure I'm understanding your intent exactly, but I do not think it should be UI3's job to accept programming from the user to make UI3 subscribe to arbitrary MQTT topics and look for specific values to do specific things. Say I create a system where you can program simple event handlers, e.g. IF
MQTT topic Doorbell/Ringing
IS
1
THEN
Open Live Camera frontporch
AND
Set Volume to 100
. Then it needs an optional delayed reset mechanism like you also mentioned, but there are a lot of related situations that need to be handled. E.g. what happens if, before the reset, the same condition gets met again, or another MQTT condition gets triggered, or a user interacts with the UI directly, etc. Now the simple event handler is not simple anymore. I really don't want to deal with all of that. Better that those decisions are made in a home automation controller like Home Assistant I think, since it should have way more powerful automation capabilities than I would ever be willing to code into UI3. Admittedly Home Assistant's complexity is very high because of it.
I suspect it would be necessary for someone to create a UI3 integration/addon for Home Assistant. I am not really interested in taking it that far myself. No need for a UI3 integration/addon in Home Assistant since it can already do an action of type
Call service
with Service
MQTT: Publish
and it could therefore control UI3 that way.
See, my original plan was to have UI3 publish certain values from its current UI state to a number of MQTT topics, and also subscribe to those same topics so that other MQTT clients can publish values to them to change the state of the UI3 instance.
Example: All cameras, video player maximized, volume muted:
UI3/instance_id/state/cam
->
index
UI3/instance_id/state/maximize
->
1
UI3/instance_id/state/volume
->
0
I'd probably add a couple of other settings (streaming quality perhaps?) but those 3 MQTT topics above would be the most useful I think.
The
instance_id
would be randomly generated and saved in settings so it would be persistent, but also manually settable so you wouldn't be forced to use the randomly-generated instance ID and you could even have multiple devices share the same instance ID so they would both mirror each other. And consequently they would both remotely control each other right out of the box if you connected them to the same MQTT broker and gave them the same instance ID.
I also assume each instance of UI3 would be able to be controlled separately via its IP address?
Yes and no. The control would not be based on IP (that would be poorly suited for many reasons actually). Instead it would be based on an
instance_id
as I described above.
So if you wanted one device to change to a specific camera feed when triggered by a MQTT event, but not other devices, that is a trivial thing to accomplish? Would there be a way to change all instances of UI3 at the same time?
Yes to both.