User Tools

Site Tools


mqtt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mqtt [2020-03-08 21:13] cazagenmqtt [2025-06-06 15:44] (current) – [Sensors] simon
Line 18: Line 18:
 mosquitto_pub -h mqtt.hacklab -t 'dali/g1/preset/harmony' -n # send an empty message mosquitto_pub -h mqtt.hacklab -t 'dali/g1/preset/harmony' -n # send an empty message
 </code> </code>
 +
 +===== Devices =====
 +[[private:mqtt_devices|MQTT Smart devices login/Documentation]]
  
 ===== Sensors ===== ===== Sensors =====
Line 46: Line 49:
 | sensor/g1/window | open/secure | | | sensor/g1/window | open/secure | |
 | sensor/g11/current/1 | float, amps | | | sensor/g11/current/1 | float, amps | |
 +| sensor/g1/fridge | seconds | Number of seconds that the [[fridge_door_sensor|fridge door]] has been open, 0 means "closed" |
  
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
Line 88: Line 92:
  
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
-| environment/g1/extractor | 0=off, 1=on | Note that the radio link for this is patchy so may not work immediatelyDo not send multiple events to compensate as this should be done by the driver script instead. | +| environment/g1/extractor | 0=off, 1=on | [[https://github.com/edinburghhacklab/circuitpython_remote_relay|Controlled]] by {{:23-10-24_21-50-40_2656.jpg?linkonly|ESP32-S2 relay board}}. Debugging feedback availble on //debug/esp-487f307d5dad// 
-| environment/g1/heating | 0-30, off | Send a numeric value to set a target temperature for G1, off to turn the heating off | +| environment/g1/heating | 0-30, off | Send a numeric value to set a target temperature for G1, off to turn the heating off. Mark the message as retained in case the thermostat script is restarted. 
-| environment/g8/extractor/relay/| 0=off, 1=on | Wall extractor in workshop | +| environment/g2/heating | 0-30, off | Send a numeric value to set a target temperature for G2off to turn the heating off. Mark the message as retained in case the thermostat script is restarted. | 
-| environment/g14/heating | 0-30, off | Send a numeric value to set a target temperature for G14, off to turn the heating off |+| environment/g8/extraction | off/on | Wall extractor in workshop | 
 +| environment/g14/heating | 0-30, off | Send a numeric value to set a target temperature for G14, off to turn the heating off. Mark the message as retained in case the thermostat script is restarted. | 
 +| espurna/g1-ceiling-air-purifier/relay/0/set | 0=off, 1=on | G1 Ceiling Air purifier (Smart Air Sqair) |
  
 ===== Lighting ===== ===== Lighting =====
Line 103: Line 109:
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
 | dali/g1/preset/<preset> | (none) | preset=off/dim/bright/corners/movie/comfort/presentation/harmony/random or preset=<number> | | dali/g1/preset/<preset> | (none) | preset=off/dim/bright/corners/movie/comfort/presentation/harmony/random or preset=<number> |
-| dali/g1/set/<light-id> | 0-254 | light-id=0-17, light-id=all, or light-id=social (just the end of the room with the kitchen) |+| dali/g1/set/<light-id> | [[g1_lighting#dali_light_level_presets|0-254]] | light-id=[[g1_lighting#dali_addresses|0-17]], light-id=all, or light-id=social (just the end of the room with the kitchen) |
 | dali/g1/script | json-formatted script | <code>[["set", 5,0], ["delay",2000], ["set_all",254]]</code> will set light number 5 to zero, wait for 2 seconds, then set everything to 254| | dali/g1/script | json-formatted script | <code>[["set", 5,0], ["delay",2000], ["set_all",254]]</code> will set light number 5 to zero, wait for 2 seconds, then set everything to 254|
  
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
 | display/g1/blacklights/relay/0/set | 0=off 1=on | Switch the G1 blacklight on/off | | display/g1/blacklights/relay/0/set | 0=off 1=on | Switch the G1 blacklight on/off |
 +| display/g1/big_fricking_bulb | 0=off 1=on 2=toggle | Switch the giant 5W LED bulb on/off |
  
 ===== Displays ===== ===== Displays =====
Line 140: Line 147:
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
 | display/g1/leds | <colour> | css3 web colours or hex values (e.g. ff0000) | | display/g1/leds | <colour> | css3 web colours or hex values (e.g. ff0000) |
-| display/g1/leds | <preset>presets include: rainbow, zap, chase, test, pixelpicker |+| display/g1/leds | <preset>choose name from list below  |
 | display/g1/leds/brightness | [0-100] | changes the brightness of the leds to //n// percent | | display/g1/leds/brightness | [0-100] | changes the brightness of the leds to //n// percent |
 | display/g1/leds/picker/json | <json> | When in the pixelpicker preset send the following example payload, '{"1":[255, 255, 0], "2":[0, 0, 255]}' , this will set LED 1 to yellow, and LED 2 to blue | | display/g1/leds/picker/json | <json> | When in the pixelpicker preset send the following example payload, '{"1":[255, 255, 0], "2":[0, 0, 255]}' , this will set LED 1 to yellow, and LED 2 to blue |
 +
 +=== Presets ===
 +
 +  * rainbow
 +  * zap
 +  * chase
 +  * test
 +  * pixelpicker
 +  * redalert
 +  * emergency
 +  * xmas
 +  * cyber
 +  * lmanberg
 +
 +== Pride flags ==
 +
 +  * lessbeans / lesbinyan
 +  * nyanbinary
 +  * pan
 +  * trains / trams
  
 The LEDs can also be addressed in real time via a UDP network protocol. See [[https://gist.github.com/timhawes/910ee6b5bf9c36833235b0e075f01cbf|this example]]. The LEDs can also be addressed in real time via a UDP network protocol. See [[https://gist.github.com/timhawes/910ee6b5bf9c36833235b0e075f01cbf|this example]].
 +
 +The strip is controlled by ledpi.hacklab, a pi 2 in the corner of the ceiling of G1. All code is in /opt/leds/. See README there for more info.
  
 ==== G1 LED String ==== ==== G1 LED String ====
Line 150: Line 179:
 The one that goes across the ceiling in the middle of the room. The one that goes across the ceiling in the middle of the room.
  
-These are running the WLED firmware, which is ridiculously comprehensive and can talk to basically everything.+These are running the WLED firmware, which is ridiculously comprehensive and can talk to basically everything. However, MQTT seems to have been disabled
  
-There is a web interface at http://ceilingleds.hacklab.+There is a web interface at http://wled-ceiling-string-a.hacklab.
  
-Full MQTT docs at https://github.com/Aircoookie/WLED/wiki/MQTT+<del>Full MQTT docs at https://github.com/Aircoookie/WLED/wiki/MQTT
  
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
 | display/g1/wled/$STRIP_NAME | 0-255, "ON", "OFF", or "T" |  "T" means toggle | | display/g1/wled/$STRIP_NAME | 0-255, "ON", "OFF", or "T" |  "T" means toggle |
 | display/g1/wled/$STRIP_NAME/col | #RRGGBB | | | display/g1/wled/$STRIP_NAME/col | #RRGGBB | |
-|||STRIP_NAME can be replaced with "dangle" for the strip dangling in G1 or "all" for every strip running this firmware in G1|+|||STRIP_NAME can be replaced with "dangle" for the strip dangling in G1 or "all" for every strip running this firmware in G1|</del>
  
-==== G1 Warning Turret ====+==== G1 Light Turret ==== 
 + 
 +See also: [[turret|Light Turret]]
  
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
Line 192: Line 223:
 | display/g1/projector/off | empty | Turns off projector |  | display/g1/projector/off | empty | Turns off projector | 
 | display/g1/projector/channel | text | Changes channel of radio to one of hdmi, vga, or svideo |  | display/g1/projector/channel | text | Changes channel of radio to one of hdmi, vga, or svideo | 
 +
 +==== Chart ====
 +
 +The blinky chart of the West of Scotland in G1.
 +
 +Note: Lighting mode may be overriden by hardware nya nya switch.
 +
 +^ Topic ^ Payload ^ Notes ^
 +| display/chart/mode | rainbow, normal | Engage nya nya rainbow mode, or normal light colours / patterns. |
 +
  
 ===== Access Control ===== ===== Access Control =====
 +
 +Code for this can be found on ehl-vm-things:/srv/docker/py3scripts/entrance-handler
 +
 +The door is opened by a small ESP8266 and a relay connected to the intercom phone under the IRC terminal in G1
  
 | access/entrance/request | | Button has been pressed at the entrance //read only// | | access/entrance/request | | Button has been pressed at the entrance //read only// |
Line 281: Line 326:
 | timesignal/86400 | (none) | ... | | timesignal/86400 | (none) | ... |
  
-===== Christmas Tree =====+===== G1 Amp =====
  
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
-xmas/tree | <n> | 0=off 1=red 2=dim-red 3=green 4=yellow 5=blue 6=magenta 7=cyan 8=white 9=colour-scroll 10=colour-fade 11=christmas 12=twinkle 13=nightlight | +sound/g1/amp/channel channel_name channel name, all caps e.g. HDMI1/AUDIO1Some macros are stored such as pi/table |  
-| xmas/tree <colour> black/red/green/... (from the [[http://webcolors.readthedocs.io|webcolors]] library) and hex RGB values (e.g. ff0000) | +sound/g1/amp/power on/off | | 
-| xmas/tree | <name> | Execute a saved script (e.g. chase, trail) +sound/g1/amp/volume up/down currently this fades up/down the volume by 5dBmthis could be made to set the volume to specific numberbut that could go wrong... |
-xmas/tree JSON Execute a script +
-xmas/tree/preset/<name> JSON Store a script for later use | +
- +
-In JSON mode, the payload is sequence of frames and delay times. The following example would flash red/green/blue in 1000ms intervals. +
- +
-<code> +
-+
-  [[[255, 0, 0], [255, 0, 0], ...], 1000], +
-  [[[0, 255, 0], [0, 255, 0], ...], 1000], +
-  [[[0, 0, 255], [0, 0, 255], ...], 1000] +
-+
-</code> +
- +
-There are 50 pixels on our tree, so 50 RGB values should be sent in each frame. +
 ===== Misc ===== ===== Misc =====
  
 ^ Topic ^ Payload ^ Notes ^ ^ Topic ^ Payload ^ Notes ^
 | stats/member_count | n | Number of members | | stats/member_count | n | Number of members |
 +| time-since-last/reset | <name> | Reset "time since last" timer <name> |
 +| stock/<item-name>/in/<location>/add | <quantity> | Add <quantity> of <item-name> to <location> |
 +| stock/<item-name>/in/<location>/remove | <quantity> | Remove <quantity> of <item-name> from <location> |
 +| stock/<item-name>/in/<location>/current | <quantity> | //Read Only//: There is <quantity> of <item-name> in <location> |
 +| stock/<item-name>/in/<location>/important | 0-1 (retain) | Report when we run out of <item-name> in <location>, or are running low (see minimum below) |
 +| stock/<item-name>/in/<location>/minimum | 2-n (retain) | Report when we have fewer than <n> of <item-name> in <location> |
 +
  
 ===== TODO ===== ===== TODO =====
mqtt.1583701985.txt.gz · Last modified: by cazagen

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki