Thanks for the replies! It was late and I forgot to mention, after MQTT quit working, the Docker container that was running this CumulusMX weather software was migrated to an LXC container for simplicity and troubleshooting. In the process, the CumulusMX software was updated, and the MQTT files (Data and Interval files) syntax also changed slightly with the update. The way I got this halfway working yesterday was to play around with the quotes in the string until it showed up again in MQTT Explorer. The way it’s currently formatted was what I settled on, as it was at least halfway working. I was also thinking something was still slightly off with the string, I’m just not sure what is incorrect.
I’m not sure what you mean by:
“…Also, any time I see a bunch of ‘quoted’ double quotes around JSON, flags go up.”
-and-
“It likely shows something like “value_json” is null, because, indeed, “DataUpdate” is (no more?) a valid JSON object.”
Here is the original “Interval Template” file:
{"topics":[
{
"topic": "CumulusMX/Interval",
"data": "{\"time\":\"<#timehhmmss>\",\"temp\":<#temp rc=y>,\"humidity\":<#hum>,\"wgust\":<#wgust rc=y>}",
"retain": false
}
]}
And the original “Data Update” file:
{"topics": [
{
"topic": "CumulusMX/DataUpdate",
"data": "\"time\":\"<#timehhmmss>\",\"windspeed\":<#wlatest rc=y>,\"winddir\":<#bearing>",
"retain": false
}
]}
Here are the corresponding log entries:
2023-07-22 22:29:55.985 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.temp }}'
2023-07-22 22:29:55.999 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.apptemp }}'
2023-07-22 22:29:56.003 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.intemp }}'
2023-07-22 22:29:56.008 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.cloudbasevalue }}'
2023-07-22 22:29:56.011 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.humidity }}'
2023-07-22 22:29:56.013 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.inhum }}'
2023-07-22 22:29:56.017 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.pressure }}'
2023-07-22 22:29:56.021 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.dewpoint }}'
2023-07-22 22:29:56.024 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.wchill }}'
2023-07-22 22:29:56.028 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.heatindex }}'
2023-07-22 22:29:56.035 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.humidex }}'
2023-07-22 22:29:56.039 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.avgbearing }}'
2023-07-22 22:29:56.043 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.domwinddir }}'
2023-07-22 22:29:56.046 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.Tbeaufort }}'
2023-07-22 22:29:56.050 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.windrun }}'
2023-07-22 22:29:56.054 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.cloudbasevalue }}'
2023-07-22 22:29:56.059 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.SensorContactLost }}'
2023-07-22 22:29:56.065 ERROR (MainThread) [homeassistant.components.mqtt.models] Exception raised when updating state of sensor.cumulusmx_interval, topic: 'CumulusMX/Interval' with payload: b'{"time":"20:58:43",\r\n\t\t"battery":ok,\r\n\t\t"press":29.26,\r\n\t\t"pressure":Rising,\r\n\t\t"inside-temp":69.3,\r\n\t\t"temp":74.1,\r\n\t\t"tempTL":74.1,\r\n\t\t"tempTH":83.3,\r\n\t\t"humidity":62,"inside-humidity":55,\r\n\t\t"wgust":4.0,\r\n\t\t"dew":60.2,\r\n\t\t"dewpointTL":58.4,\r\n\t\t"dewpointTH":63.5,\t\r\n\t\t"apptemp":76.9,\r\n\t\t"apptempTL":0.0,\r\n\t\t"apptempTH":87.3,\r\n\t\t"wchill":74.1,\r\n\t\t"wchillTL":0.0,\r\n\t\t"wchillTH":,\r\n\t\t"heatindex":74.1,\r\n\t\t"heatindexTL":,\r\n\t\t"heatindexTH":84.4,\r\n\t\t"humidex":27.7,\r\n\t\t"wlatest":'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt/models.py", line 270, in process_write_state_requests
entity.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 742, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 867, in _async_write_ha_state
hass.states.async_set(entity_id, state, attr, self.force_update, self._context)
File "/usr/src/homeassistant/homeassistant/core.py", line 1651, in async_set
state = State(
^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1269, in __init__
raise InvalidStateError(
homeassistant.exceptions.InvalidStateError: Invalid state encountered for entity ID: sensor.cumulusmx_interval. State max length is 255 characters.