Mycodo not capuring some MQTT Sensor readings

Sensors sending data via MQTT. Was working until upgraded to 8.15.1

Sensors are publishing to MQTT broker:
{“Time”:“1970-01-01T00:28:16”,“EZO-1”:{“pH”:5.83},“EZO-2”:{“EC”:1736.000},“EZO-3”:{“Temperature”:19.9},“TempUnit”:“C”}

Put Input in debug mode.
Damon Log:
2023-01-15 23:18:45,336 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Found key: “EZO-1”.pH, value: 6.01
2023-01-15 23:18:45,344 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Adding measurement to influxdb: {0: {‘measurement’: ‘ion_concentration’, ‘unit’: ‘pH’, ‘value’: 6.01, ‘timestamp_utc’: datetime.datetime(2023, 1, 16, 4, 18, 45, 336097)}}
2023-01-15 23:18:45,362 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Searching JSON for “EZO-2”.EC
2023-01-15 23:18:45,368 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Found key: “EZO-2”.EC, value: 1741.0
2023-01-15 23:18:45,522 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Adding measurement to influxdb: {0: {‘measurement’: ‘ion_concentration’, ‘unit’: ‘pH’, ‘value’: 6.01, ‘timestamp_utc’: datetime.datetime(2023, 1, 16, 4, 18, 45, 336097)}, 1: {‘measurement’: None, ‘unit’: ‘ppm’, ‘value’: 940.14, ‘timestamp_utc’: datetime.datetime(2023, 1, 16, 4, 18, 45, 336097)}}
2023-01-15 23:18:45,530 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Searching JSON for “EZO-3”.Temperature
2023-01-15 23:18:45,532 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Found key: “EZO-3”.Temperature, value: 20.0
2023-01-15 23:18:45,616 - DEBUG - mycodo.inputs.mqtt_paho_json_530f5dbb - Adding measurement to influxdb: {0: {‘measurement’: ‘ion_concentration’, ‘unit’: ‘pH’, ‘value’: 6.01, ‘timestamp_utc’: datetime.datetime(2023, 1, 16, 4, 18, 45, 336097)}, 1: {‘measurement’: None, ‘unit’: ‘ppm’, ‘value’: 940.14, ‘timestamp_utc’: datetime.datetime(2023, 1, 16, 4, 18, 45, 336097)}, 2: {‘measurement’: None, ‘unit’: ‘F’, ‘value’: 68.0, ‘timestamp_utc’: datetime.datetime(2023, 1, 16, 4, 18, 45, 336097)}}

pH and Temperature are being logged, EC is not.

Ideas?

I see the EC measurement in the log.

It show in the daemon log, but live measurements shows 0 for EC and if graphed over time shows nothing:
Live Measurements:
5.8 pH (Ion Concentration) (pH) CH0 | 2023/1/15 23:44:45

0 ppm (Parts per million) (EC) CH1 | No Data Last 0 sec

66.2 °F (Fahrenheit) (H2O Temp) CH2 | 2023/1/15 23:44:45

I have 8.14.2 Running on another RPi subscribed to the same MQTT topic and it shows:
5.98 pH (Ion Concentration) (pH) CH0 | 2023/1/15 23:47:45

918.54 ppm (Parts per million) (EC) CH1 | 2023/1/15 23:47:45

66.02 °F (Fahrenheit) (RTD) CH2 | 2023/1/15 23:47:45

How are your coding skills? Could you test casting the EC measurement as an integer prior to passing it to be stored in influxdb?

I’m some what proficient with python. I’ve written several things, but nothing as complicated as Mycodo.

Issue is, it was doing this with an SCD30 earlier. CO2 and eCO2 measurements were being dropped/ignored. I rebuilt RPi from scratch and now SCD30 works and EC is showing same behavior as the SCD30 did before.

Found some interesting behavior. I created a custom measurement conversion to convert microsiemens/cm to ppm. Turning that off, the readings show up in the live measurements page …

Where should I look to convert the reading to a float before converting?

I’ll see if I can replicate this behavior and find an issue. In the meantime, just don’t use it if it’s preventing storage of measurements.

Are these measurements not being saved to the database or just not showing up in the Live page?

How would I check? Asynchronous Graphs?

Yeah, any of the places to view measurements, such as asynchronous graph, graph widget, measurement widget, etc.?

Measurements are being saved. Async graphs, angular widget, and measurement widgets are showing the data.
I thought that maybe it was an issue with the version I was running, so I did a fresh install of 8.15.6
Same issue.
I’ve tried x0.540, x.540, x*.54, and x*(54/100) for the formula to convert uS/cm to PPM all with the same result, PPM is showing 0 in Live measurements with the error No Data.
(After I save this post the astericks are missing from some of the above formulas)

It appears to simply be a bug of the Live Page rather than a more serious issue with recording measurements.

I haven’t been able to locate any code related to the Live page that would cause this issue. You can confirm the converted values are being properly stored (as PPM) and retrieved from the database on all other (non-Live page) UI elements that query the database?

If you inspect the HTML of the Live page, find the JS line that starts with const url = ‘/last/’ and build the proper URL from the parameters from your PPM data line further down that would look similar to this:

liveTextData(‘314abab5-eeaa-4d35-9372-b9bafb85c76f’, ‘input’, ‘15546361-6bba-404c-8d75-6300ce939da1’, 120.0, 60.0);

The proper URL will look like this:

https://PI_IP_ADDRESS/last/314abab5-eeaa-4d35-9372-b9bafb85c76f/input/15546361-6bba-404c-8d75-6300ce939da1/120

See if this URL returns the PPM value stored in the database. This is what the live page JS is using to query the database.

The URL doesn’t seem to be working.
I found the correct GUIDs
liveTextData(‘76dc947a-1da4-439b-8119-15dbe516a81e’, ‘input’, ‘fb19d1fa-8b4a-4a2c-8d54-1f21570b1d88’, 0, 30);

https://10.1.2.181/last/76dc947a-1da4-439b-8119-15dbe516a81e/input/fb19d1fa-8b4a-4a2c-8d54-1f21570b1d88/30 returns to the live measurements page and doesnt show any data.

When I use the GUIDs for other inputs I get a timestamp and measurement in brackets, for example:
https://10.1.2.181/last/91e8c84b-faa2-4513-88f0-c1928fd2b30e/input/8b49bc56-f144-4e25-8230-defdbdcd26d8/120
Returns: [1676053085.778014,325]

This isn’t possible for the /last endpoint. It can only return data or a 204 error code; it is unable to render HTML or redirect to another page.

In any case, I have not been able to replicate the behavior. Unless you can investigate, I would need details about every aspect of your configuration and detailed steps to replicate.

The MQTT Input has been fixed in the latest unreleased code on the master branch. You may need to delete your influxdb database from the Diagnostics page for the fix to take effect. let me know if you upgrade, recreate your database, and still have this issue.