MQTT Topics

From Heatweb Wiki
Jump to navigationJump to search

Topic Sructure

With MQTT as the standard means of wiring nodes on a network together, the way signals are routed comes down to the MQTT topic structure. Access to topics can be protected with different rights to different users, and wildcard filtering.

No data is stored locally, or remotely by default. MQTT is simply a form of wiring, where wires are registered in a web based system, rather than hard-wired with cable.

The topic is in effect the name of the wire. The content of the message is the value sent over that wire to anyone (or other devices) registered to receive the other end.

The use of multiple levels within the topic allows security to be grouped according to a signal's function, or user status.

Topics work like a directory structure.

  • Topic: mynetwork/abcd1234/aa11bb22cc33dd44/values/kPa
  • Value: 67.5

We have standardised on 5 levels of topic for the Node-HIU system.

  1. network_id
  2. 8_character_id_for_node
  3. 16_chacter_id_for_device
  4. topic_group
  5. topic


Examples

network_id/node_id/device_id/# read only access to all data.

  ihiu/abcd1234/aa11bb22cc33dd44/values/tH = 67.5 (primary flow temperature)

network_id/node_id/device_id/# read & write for commands

  ihiu/abcd1234/aa11bb22cc33dd44/user/setCHON = on/off (central heating)
  ihiu/abcd1234/aa11bb22cc33dd44/user/setDHWON = on/off (keep warm or secondary return)

network_id/node_id/device_id/data provides access to raw data (must first be activated).

network_id/node_id/device_id/engineer/data = 1 activates feed of raw data.


If someone wants control over prepay then we add in

network_id/node_id/+/prepay/# read & write for commands to any node connected HIU.

  ihiu/abcd1234/aa11bb22cc33dd44/prepay/SetRUN = on/off

Filtering

Traffic is cut down by using 0.5°C filtering on temperatures. Only changes in values are sent, with a command (user topic) to resend all stored values:

network/node/device/user/refresh = 1

Registration for Data Access on HIUs

Access to data is controlled by users with passwords, and access to specific levels of topics.

The process is controlled from any hot water tap connected to an HIU on the network.

Qrpairsample.jpeg
  1. QR Code is scanned from the label on the HIU, taking user to registration page on the internet.
  2. User is asked for email.
  3. User is asked to turn a hot tap on and off five times in a row.
  4. The Node the HIU is connected to detects the trigger, and informs the registration site.
  5. The registration page links the internet request with the tap confirmation, and
    1. emails user with access details, and links to free MQTT apps,
    2. saves user into MQTT database,
    3. sets up read access to the data from the HIU,
    4. sets up write access for user commands.

Access to data and services can only be obtained by both providing a valid email address and having access to the property, taps, and the HIU.

2017-10-12 13.49.30.png2017-10-12 13.50.14.png2017-10-12 13.51.08.png

Who uses MQTT?

we (IBM) have been using MQTT in solutions for the last 10 years with great success.

A couple that I can reference:
- St Jude Medical, who use MQTT to remotely monitor patient implants
- http://www-03.ibm.com/press/us/en/pressrelease/19747.wss
- Consert, who are an energy utility company, use MQTT as a part of their real-time home energy monitoring and management solution - http://www-304.ibm.com/partnerworld/gsd/solutiondetails.do?solution=40405&lc=en&stateCd=P&page=1

There are obviously many that I am not able to share, but they cross all industries.

Independently of IBM, Facebook Messenger uses MQTT - http://mqtt.org/2011/08/mqtt-used-by-facebook-messenger

I'm sure there will be other's on this mailing list, outside of IBM, who have stories to share.