Flow Units

Hi dev community,

Looking to find a solution to getting alternative units to GPM for measuring flow. GPM does not provide anywhere near the necessary resolution to measure the flow rate of my particular application.

Code I had consulted on that I am working with:

void zwaveEvent(hubitat.zwave.commands.meterv5.MeterReport cmd) {

  if (cmd.meterValue.size() > 0) {
        Map evt = [:]
      //Map evt = [name: "watermeter", unit: "GPM"]
        if (cmd.meterType == 3) {
              switch (cmd.scale) {
                    case 0:
                          evt.name = "rate"
                          evt.value = cmd.scaledMeterValue
                          evt.unit = "GPM"
                          evt.descriptionText = "${device.displayName} rate is: ${evt.value}${evt.unit}"
                       //   eventProcess(evt)
                          sendEvent(evt)
                          break
        }
    }
}

}

I'm not sure what hardware you're using but the Flume meter exposes a flow rate in hundredths of GPM in one minute intervals.

The hardware is an engineering sample thus why it required a custom handler. Is there a way to change the GPM units to LPH or something more readable.

It sort of looks like that function is taking the exact value reported by the device and dumping it right into the "watermeter" attribute. If that's the case you cannot make it any more accurate unless there is a setting you can change on the device.

I can look at the raw message from the device to know a little more. Add this as the first thing in your function and report back with some of the logs created.

log.trace "${cmd} (meterValue: ${cmd.scaledMeterValue})"