Send MQTT value based on GPIO state

Hello,
I have just discovered mycodo (amazing!) and would like to use it as a I/O interface to connect sensors and peristatic pumps to home assitant via MQTT. Effectively make and MQTT version of the raspipool pool management system.

I have managed to make some headway but need to simulate a flow meter using a simple switch. ie when a GPIO pin is high, I want to send a flow value of 4500 over MQTT, and zero when its low. I can set the GPIO pin as an input and send the bolean value to MqTT, but how do I send any other value?

many thanks

1 Like

The MQTT Action for Inputs only sends the measurement value from the Input. If you want custom code to be executed, you’ll need to create a custom Input module.

Ok thank you.
Also, I have connected the various atlas sensors and can get readings via my tentacle T3 board (I can send them on MQTT), but I don’t see anything. On love readings - they are all 0?

When you ran the Mycodo installer, did you select to install Influxdb 1.x or 2.x? 2.x is experimental and there may be an issue with the latest release installer.