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…
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.
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.
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?
Install mosquitto server on your Pi with sudo apt install mosquitto && sudo service mosquitto start
Add a MQTT Publish (Value) Output, with the host 127.0.0.1 and topic test_send, save.
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.
Activate the Input, then go to the Output page, expand the options menu of the Output and send a value of 100.
Go to the Live page and observe if the 100 value was received by the Input and is displayed as the last received measurement.
Replying after two years because my notification settings must have been wrong so I didn’t know there was a reply. What @KyleGabriel recommended was great for me. I am now publishing my readings to an MQTT server running in Google Cloud, with authentication!