Trigger MQTT/HA Events via GET URL/QR Code

I generally wanted to be able to trigger events in my house via QR code. Have a very specific use case in my implementation but this flow could easily be modified to trigger lighting events, launch media, or do whatever all without having to log into home assistant. Great way to make automations available to friends and family because all they need is to be on your wifi and have a QR code reader app on their phone.

Watch the YouTube Tutorial/Demo here and hope this is useful!

[{"id":"a78cd2a1.54db2","type":"tab","label":"MQTT Alarm Dismiss","disabled":false,"info":""},{"id":"c2bb8364.2303","type":"http in","z":"a78cd2a1.54db2","name":"GET alarm-dismiss","url":"e12d96db-7d4b-4efa-9e7f-c43053c22aa3","method":"get","upload":false,"swaggerDoc":"","x":110,"y":40,"wires":[["5b8838e3.226d08","e11ae66e.88b8c8","b4d0a0c9.99a19"]]},{"id":"5b8838e3.226d08","type":"http response","z":"a78cd2a1.54db2","name":"","statusCode":"200","headers":{},"x":130,"y":80,"wires":[]},{"id":"e11ae66e.88b8c8","type":"api-call-service","z":"a78cd2a1.54db2","name":"Turn On Office Lights","server":"86a30dfd.fc7c1","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.office_lights_zha_group_0x0002","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":350,"y":80,"wires":[[]]},{"id":"d31da642.3229f8","type":"mqtt out","z":"a78cd2a1.54db2","name":"MQTT rpi/alarm topic","topic":"rpi/alarm","qos":"0","retain":"","broker":"e92d1794.a4b0d8","x":550,"y":40,"wires":[]},{"id":"b4d0a0c9.99a19","type":"change","z":"a78cd2a1.54db2","name":"MQTT OFF","rules":[{"t":"set","p":"payload","pt":"msg","to":"OFF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":40,"wires":[["d31da642.3229f8"]]},{"id":"86a30dfd.fc7c1","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"e92d1794.a4b0d8","type":"mqtt-broker","name":"MQTT Localhost","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Flow Info

Created 3 years, 3 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • http in (x1)
  • http response (x1)
  • mqtt out (x1)
  • mqtt-broker (x1)
Other

Tags

  • homeassistant
  • mqtt
  • qr
  • qrcode
  • get
  • url
  • endpoint
  • http
  • trigger
  • event
  • integration
  • service
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option