Skip to content
Resinchem edited this page Mar 14, 2021 · 2 revisions

Controlling the Window with MQTT

MQTT can be used to select a particular camera or video. In addition, MQTT can be used to change modes and put the window into loop or single mode. Obviously, you must have a defined MQTT broker and this broker must be reachable by the Raspberry Pi/Python application on your network.

Topic

By default, the Python application subscribes to the MQTT topic winpi/window/cmnd. You may modify this topic by editing the Python application and changing the mqtt_topic = "winpi/window/cmnd" to your desired topic.

Note for Home Assistant users: If you change the topic in the Python application, you must also modify the topic in any automations, scripts, etc. that previously called the old topic.

Payload

The payload must consist of a JSON string, in following format: {"mode":"play_mode","title":"cam_vid_name"}

Valid "play mode" values are:

play mode Action
play_cam Displays the camera named in "title"
play_vid Displays the video named in "title"
next_cam Displays the next camera from the defined list. Pass empty string for the "title"
next_vid Displays the next video from the defined list. Pass empty string for the "title"
cam_loop Start camera loop through all defined cameras. Pass empty string for the "title"
vid_loop Start video loop through all defined videos. Pass empty string for the "title"

Titles: Titles are the defined "friendly" names from the cam_names[] or vid_names[] array as defined in the Python application. See the Installation and Setup wiki page for more details on defining your cameras and videos.

Currently, the application does not publish to any MQTT topics. However, this should be easy to add and may be implemented in a future release.

Clone this wiki locally