Difference between revisions of "MQTT"

From Hackerspace ACKspace
Jump to: navigation, search
m (Xopr moved page Sonoff to Mqtt: make project more generic (Sonoff->MQTT))
(update project)
Line 3: Line 3:
 
|State=Active
 
|State=Active
 
|Members=xopr
 
|Members=xopr
|Description=Space empty? Power off!
+
|Description=Space empty? Power off!
 
|GitHub=mqtt_spaceAPI
 
|GitHub=mqtt_spaceAPI
 
}}
 
}}
 
== synopsis ==
 
== synopsis ==
 +
Read sensors and do some space automation using the Message Queuing Telemetry Transport protocol.
 +
 +
Currently, you can see the solder table powerstrip connected in the [[power]] graph.
 +
 +
== current status ==
 
There is a sonoff Pow wifi switch in the space, connected to a powerstrip near the soldering table (in a brown plastic case with a toggle switch on top of it).
 
There is a sonoff Pow wifi switch in the space, connected to a powerstrip near the soldering table (in a brown plastic case with a toggle switch on top of it).
  
Line 18: Line 23:
 
Also ''don't connect both serial and mains''; things will break.
 
Also ''don't connect both serial and mains''; things will break.
  
You can toggle it via wifi on [http://h1r-2067.lan h1r-2067.lan] (subject to change), or by issuing a <code>mosquitto_pub -h &lt;mqtt_ip&gt; -t "cmnd/h1r/POWER" -m "TOGGLE"</code>
+
You can toggle it via wifi on [http://h1r-2067.lan h1r-2067.lan] (subject to change), or by issuing a <code>mosquitto_pub -h 192.168.1.100 -t "cmnd/h1r/POWER" -m "TOGGLE"</code>
 +
 
 +
Read it's status by subscribing to the sensor topics: <code>mosquitto_sub -h 192.168.1.100 -t "tele/+/SENSOR"</code>
  
 
== todo ==
 
== todo ==
* add MQTT [[server]] that the switches can connect to, together with the [[space state]]
+
* add MOAR sensors (upgrade the current temperature sensors)
* make MQTT connect to [[spaceAPI]] and [[Power]] page
+
* connect the [[space state]] to the MQTT [[server]]
* add MOAR sensors
 
 
* MOAR sonoffs
 
* MOAR sonoffs

Revision as of 12:18, 8 February 2019

Project: MQTT
Featured: No
State Active
Members xopr
GitHub mqtt spaceAPI
Description Space empty? Power off!
Picture
No project picture! Fill in form Picture or Upload a jpeg here

synopsis

Read sensors and do some space automation using the Message Queuing Telemetry Transport protocol.

Currently, you can see the solder table powerstrip connected in the power graph.

current status

There is a sonoff Pow wifi switch in the space, connected to a powerstrip near the soldering table (in a brown plastic case with a toggle switch on top of it).

The idea is to gradually add them to every power strip so we can:

  1. measure (over)current
  2. switch them off centrally if the space is closed (or notify the user that they are still on).

It currently runs a modified version of the famous Tasmota firmware (the modification allows dangerous GPIO whist using the energy measurement).

NOTE: the switch is built in a box with an external toggle switch. This switch has potentially 240v on its contacts so don't open it and touch the contacts when it is plugged in! Also don't connect both serial and mains; things will break.

You can toggle it via wifi on h1r-2067.lan (subject to change), or by issuing a mosquitto_pub -h 192.168.1.100 -t "cmnd/h1r/POWER" -m "TOGGLE"

Read it's status by subscribing to the sensor topics: mosquitto_sub -h 192.168.1.100 -t "tele/+/SENSOR"

todo

  • add MOAR sensors (upgrade the current temperature sensors)
  • connect the space state to the MQTT server
  • MOAR sonoffs