MQTT Topics

From Heatweb Wiki
Revision as of 12:01, 12 October 2017 by Rhg (talk | contribs)
Jump to navigationJump to search

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.

The topic is in effect the variable name. The content of the message is the value.

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

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.

  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, and prompted to move to a hot tap.
  3. User is asked to turn a hot tap on and off five times in a row.
  4. The registration page links then internet request with the tap confirmation, and
    1. emails user with access details
    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

Examples

ihiu/abcd1234/aa11bb22cc33dd44/# read only for data out

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

ihiu/abcd1234/aa11bb22cc33dd44/user/# 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)

If someone wants control over prepay then we add in

ihiu/abcd1234/+/prepay/# read & write for commands to any connected HIU

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


No data is stored anywhere.

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

If you want to store data its done on another device subscribing to the data via MQTT once access is granted using the above process, or manually into CloudMQTT.