├── LICENSE
├── README.md
├── index.html
├── js
└── index.js
├── screenshot-mobile.png
├── screenshot.png
└── test-messages.py
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013-2025 Fabian Affolter
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://api.gitsponsors.com/api/badge/link?p=M6YTOZpYXP5QfsPAcN1WtjxBeUMoAYG1hSbALWg+0ACRLfuU00JzAshil3XKiVKDCWmq8GYaEA1Y0KMUMbow+NBX0Y9Pi41tgCFXM9FerKn/dyzHyrXl5KFh0xDcLA5R)
2 |
3 | # mqtt-panel
4 |
5 | A simple web interface which is able to subscribe to a MQTT topic and display
6 | the information.
7 |
8 | The screenshot shows an example how to keep track on what's going in your
9 | apartment or your house. It's not about controlling, this setup is about
10 | observing various states.
11 |
12 | 
13 |
14 | 
15 |
16 | What to see `mqtt-panel` in action -> http://youtu.be/Qb0UJa9kf2g
17 |
18 | The web page is using [bootstrap](http://getbootstrap.com/) with
19 | [jQuery](http://jquery.com/).
20 |
21 | ## Prerequisites/Installation
22 |
23 | ### Get the files
24 |
25 | Clone the `mqtt-panel` [repository](https://github.com/fabaff/mqtt-panel)
26 |
27 | ```bash
28 | $ git clone git@github.com:fabaff/mqtt-panel.git
29 | ```
30 |
31 | ### Dependencies
32 |
33 | `mqtt-panel` is using the listed projects to provide its functionality:
34 |
35 | - [paho-mqtt](https://www.eclipse.org/paho/clients/python/)
36 | - [mqtt](https://github.com/adamvr/MQTT.js/)
37 |
38 | If you are using Fedora and want to generate MQTT messages, install the
39 | `paho-mqtt` Python bindings for `test-messages.py`.
40 |
41 | ```bash
42 | $ sudo dnf -y install python-paho-mqtt
43 | ```
44 |
45 | ### MQTT broker/server
46 |
47 | A MQTT broker/server with Websocket support is needed.
48 |
49 | - [mosquitto](http://mosquitto.org/) - An Open Source MQTT v3.1/3.11 broker
50 | - [mosca](http://mcollina.github.io/mosca/) - A multi-transport MQTT broker
51 | for node.js (Project seems abandoned)
52 |
53 | ## Running mqtt-panel
54 |
55 | 1. Make sure that your MQTT broker/server is running and listening.
56 | 2. Adjust `var host = '127.0.0.1';` and `var port = 3000;` in the file
57 | `js/index.js` to match your setup. Also, `var topic = '#';`.
58 | 3. Open `index.html` in a modern web browser.
59 |
60 | ## Generate MQTT messages
61 |
62 | Start the `./test-messages.py` script to publish test messages if you have
63 | no other source for messages. Depending on your broker you may need to set
64 | the supported version, on line 33: `protocol=mqtt.MQTTv311` and adjust
65 | the broker and its port.
66 |
67 | For manually sending messages to your MQTT broker/server you can use
68 | `mosquitto_pub` from `mosquitto`.
69 |
70 | ```bash
71 | $ mosquitto_pub -V mqttv311 -h localhost -d -t home/front/door -m "false"
72 | ```
73 |
74 | To check if the messages are are ok, subscribe to the topic **home/#** with
75 | `mosquitto_sub`.
76 |
77 | ```bash
78 | $ mosquitto_sub -V mqttv311 -h localhost -d -t home/#
79 | ```
80 |
81 | ## Credits
82 |
83 | `mqtt-panel` was inspired by the ideas of:
84 |
85 | - [mqtt-svg-dash](https://github.com/jpmens/mqtt-svg-dash) by [Jan-Piet Mens](http://jpmens.net/)
86 | - [Robert Hekkers](http://blog.hekkers.net/2012/10/13/realtime-data-with-mqtt-node-js-mqtt-js-and-socket-io/)
87 |
88 | ## License
89 |
90 | `mqtt-panel` licensed under MIT, for more details check LICENSE.
91 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Home conditions
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |