kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.96k stars 494 forks source link

Please add MQTT Publish Action to Vapor Pressure Deficit Function, or a Function that can publish mult-values in JSON packet format. #1386

Open LucidEye opened 3 months ago

LucidEye commented 3 months ago

I would like to be able to publish the value from the VPD Function over MQTT. I am working on building a remote WiFi display that would show temp, humidity, VPD, and Outputs on or off. I can publish measurement data via MQTT directly from the Inputs settings, but there is no option to publish the measurement data from the VPD Function. image

Another, better option, would be the ability to publish multiple measurements at once in a single MQTT topic, directly from the Inputs setup, or have a Function that allowed us to publish several measurements at once in an MQTT JSON packet format for exporting data to IoT devices such as remote displays or for integration with other automation systems like Home Assistant.

I understand it might seem redundant since the Inputs already have the MQTT publish Action, but those are single measurements for each topic, and many sensors take multiple different measurements at once, so it would be useful to be able to publish those multiple measurements in a single MQTT JSON format topic. Thank you. IMG_20240701_012854

kizniche commented 1 week ago

I'll see if I can create an analogous Action for Functions, but Functions operate differently from Inputs, so it's not as straightforward as copying it.

LucidEye commented 1 week ago

I'd been thinking about this and realized there's also the fact that not all of the measurements one may select to be packaged for transport will be acquired at the same time. So I'm guessing the function would need to pull the most recent set of whatever measurements are selected from the database, at a timed interval, which means that the remote receiving device may have some values that are a few seconds behind the actual most recent measurements? That would be fine, in my case the remote device just a display to keep an eye on the "critical" measurements without having to have a computer turned on and a browser open.