Best practices for off-Pi inputs/measurements

I’m developing a system now that only accepts Remote inputs via API. What input should I choose in my code of to correspond to this? Do people choose the same sensor that is at the other side of the API transaction? Is there a generic “remote inputs” input that I haven’t seen yet?

Basically, I have a few ESP32’s around the house doing local gas/env measurements and I’m not sure how best to add them to my Mycodo install…

Thanks!

AKA

ESP32s are commonly used to publish measurements to an MQTT server. Pis run the mosquito MQTT server well and Mycodo has two MQTT Subscribe Inputs that can record those published measurements.

2 Likes

Brand new user - excited to be starting.

I am having trouble getting an MQTT input configured. Are there any good examples of subscribing (authenticated) to an MQTT topic where the payload is a set of NV pairs? My use case is to extract some of the NV pairs as input values.

I have had some limited success, but have yet to receive an input. Before I start bugging you all with questions, I hope there is an example I can use for starters.

Thanks in advance.

Welcome. You can use the MQTT Input with the MQTT output and Mycodo can essentially talk to itself, as a demo of the MQTT publish and subscribe features of each module.

We’ve currently been updating the MQTT JSON input. The issue has some information about the new behavior of this MQTT Input variant.

Can you provide more information about your setup? Can you disable authentication to make testing more simple before adding the extra complexity?

Try this:

  1. Install mosquitto server on your Pi with sudo apt install mosquitto && sudo service mosquitto start
  2. Add a MQTT Publish (Value) Output, with the host 127.0.0.1 and topic test_send, save.
  3. Add a MQTT Subscribe (Value Payload) Input, with the host 127.0.0.1, change the Client ID to something different from the Output, and the Subscription Topic to test_send, save.
  4. Activate the Input, then go to the Output page, expand the options menu of the Output and send a value of 100.
  5. Go to the Live page and observe if the 100 value was received by the Input and is displayed as the last received measurement.