Skip to content

Running heatmon

Tristan Keen edited this page Feb 14, 2021 · 1 revision

Now we try to get the heatmon Python program running, to let the radio start listening for reports from our reprogrammed Radbots.

Configuring heatmon

Open a terminal window connected (e.g. via SSH) to the RPi, and cd to where you cloned the heatmon repo. I assuming you did this during Completing the Raspberry Pi Setup.

Copy the heatmon.yaml.example file at the root of the repo to a new file named heatmon.yaml, and edit it, e.g. with the below commands:

cp heatmon.yaml.example heatmon.yaml
nano heatmon.yaml

Firstly delete the 00 11 22 33 ... text after the secure_key field label, and replace it with the 16-byte random key you created during Reprogramming Radbot TRVs. Spaces between bytes and capitalisation shouldn't matter.


NOTE

DO NOT use any 0x prefix on the hex strings (the id or secure_key fields) - the Python program is expecting text, not a number, and YAML file syntax can be tricky.


Next you need to provide all the ID numbers of the reprogrammed Radbots, and a more user friendly name for them, as the trvs list.

Overwrite/repeat the pattern shown in the example entries, but beware that indentation should be done with SPACES not TABS and is critical. Use the same number of spaces indentation before the "hyphens" denoting the beginning of each list item (Radbot), and the id and name fields for each item should also be vertically aligned with spaces.

Running heatmon interactively

Now, try running heatmon with:

make run

If you get some part of the YAML formatting incorrect, hopefully heatmon will give you a useful hint in the error message, or you can cut & paste the text to an on-line validator - though considering secrets of course!

Hopefully it will work correctly, and give you some output like the below (you'll get a lot more first if you somehow avoided running make venv before - that takes several minutes to install Python dependencies):

$ make run
heatmon
2021-02-14 16:06:20.111 INFO     [main.py:38] Heatmon starting...
2021-02-14 16:06:20.231 INFO     [frame.py:33] Known TRVs: aba2c2ba21a12bca = upstairs
2021-02-14 16:06:20.233 INFO     [frame.py:33] Known TRVs: 12323aba2c2ba21a = downstairs
2021-02-14 16:06:20.236 INFO     [frame.py:33] Known TRVs: aba2c432432432ba = kitchen
2021-02-14 16:06:20.240 INFO     [frame.py:33] Known TRVs: 5465122c42c48bca = bedroom
2021-02-14 16:06:20.817 INFO     [radio.py:47] RFM69 Initialised OK!
2021-02-14 16:06:21.092 INFO     [system.py:74] Heatmon system starting to gather_stats
2021-02-14 16:06:54.259 INFO     [system.py:81] Packet: upstairs #397308 1% Occ0 {"tT|C":20,"tS|C":1,"L":39}
2021-02-14 16:06:54.276 INFO     [system.py:86] RSSI -48.5 dBm
2021-02-14 16:06:56.898 INFO     [system.py:81] Packet: kitchen #623574 0% Occ0 {"L":147,"tT|C":19,"tS|C":2}
2021-02-14 16:06:56.910 INFO     [system.py:86] RSSI -51.0 dBm
...

Press Ctrl+C to stop, e.g. if you want to edit the YAML file to rename/add Radbots.

If you check the RPi's Radio Bonnet the OLED display should now have some writing on it. Initially it will say "Heatmon starting..." but this should advance to log the number of TRVs connected, time of last communication, the range of their temperatures, the minimum battery volts and maximum valve opening percentage. It can take several minutes for all TRVs to report in all the stats, but eventually it should look like the picture below.

Clone this wiki locally