I started by adding these lines to my emonHub config at the end of the MQTT interfacer section.
node_JSON_enable = 1
node_JSON_basetopic = emon/JSON/
Once I restarted emonHub, I now had all my inputs appearing under a “JSON” topic.
For example, in addition to
emonTx1
power1
power2
…
emonTx2
power1
power2
…
…
I now had a JSON topic with all the other topics under it
JSON
emontx1_power1
emontx1_power2
…
emontx2_power1
emontx2_power2
…
Since this isn’t what I would want, if I were to transition to this format for live production use, I tried changing the JSON base topic to emon/ and disabling the nodular format.
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 127.0.0.1
mqtt_port = 1883
mqtt_user = emonpi
mqtt_passwd = emonpimqtt2016
[[[runtimesettings]]]
#pause = out
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
# emonhub/rx/10/values format
# Use with emoncms Nodes module
node_format_enable = 1
node_format_basetopic = emonhub/
# emon/emontx/power1 format - use with Emoncms MQTT input
# http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
nodevar_format_enable = 0
nodevar_format_basetopic = emon/
node_JSON_enable = 1
node_JSON_basetopic = emon/
This worked. Now all my inputs were working and logging to feeds as expected, but using the JSON format.
The thing that I could not get working was the “pause = out” function.
I tried saving it right under the runtime settings in the MQTT interfacer
[[[runtimesettings]]]
pause = out
But this didn’t seemed to pause the inputs from updating. Any suggestions? It looks like the pause setting is still looked for by the MQTT interfacer code.
Brandon