Help with MQTT querying state_topic with 2022.11.6

Hi, I have this mqtt integration that was working well with 2021.8.6 but since I upgraded to 2022.11.5, it gives ‘Unknown’ for a topic.

According to MQTT Browser, the data is there…

edit: outTemp_C is there, just below the screenshot. All of them returns ‘Unknown’ anyway.

But even after modifying my configuration.yaml to accommodate the new mqtt format, it still doesn’t work

mqtt:
  sensor:
     - name: "acurite_outside_temperature"
       state_topic: "acurite/loop/outTemp_C"
       unit_of_measurement: '°C'
       value_template: "{{ (value | round(1)) | float }}"
       unique_id: "acurite_outtemp"

My previous working state_topic in the configuration file only had “acurite/outTemp_C” (without the ‘loop’ part) and that doesn’t work either.

I have three lights in this configuration that can pull their state_topic from the same MQTT (Mosquitto integration) so I know it’s talking to it.

What am I missing here?

Thanks,

mqtt:
  sensor:
     - name: "acurite_outside_temperature"
       state_topic: "acurite/loop"
       unit_of_measurement: '°C'
       value_template: "{{ value_json.outTemp_C | round(1, default=none) }}"
       unique_id: "acurite_outtemp"

Thanks for the quick reply. Same result unfortunately. As I was waiting for a reply, I tried to its minimalist setting

mqtt:
  sensor:
    - name: "Test_mqtt"
      state_topic: "acurite/loop/outTemp_C"
      unique_id: "acurite_test"

And that still just gives me ‘Unknown’ :frowning:

You keep changing the state topic to an incorrect state topic. Your state topic is

acurite/loop

nothing more.

The topic is acurite/loop and the payload is a JSON dictionary. The temperature value you want is in one of the dictionary’s keys. You access the key’s value with value_json.outTemp_C.

mqtt:
  sensor:
    - name: acurite_outside_temperature
      state_topic: acurite/loop
      unit_of_measurement: '°C'
      value_template: '{{ value_json.outTemp_C }}'
      unique_id: acurite_outtemp

Oops. Well, in my defense, that’s the way it was set before I upgraded to 2022.11.6 and it was working fine then. So I changed my test_mqtt to

mqtt:
  sensor:
    - name: "Test_mqtt"
      state_topic: "acurite/loop"
      unique_id: "acurite_test"

And it finally gives something other than “Unknown”, the whole response string. At least now, using the template you gave me, I should be able to figure out the rest. Thanks.

That’s what I get for copying his template, didn’t swap it to value_json

@SylvainGa edited the post above, copy/paste should just work from my first response.

I think you’re falsely linking the update to this ‘change’. Home assistant only reads the topics (unless you’re publishing from HA). Your topic changed, therefore what ever is creating this topic is what changed.

Perhaps you meant 2022.11.5 because that’s currently the latest release (2022.11.6 was never released and 2022.12.0 should be available today).

What is responsible for publishing to acurite/loop? Like petro said, it’s not likely that the issue you experienced is due to a Home Assistant upgrade but rather to a change in whatever is publishing to acurite/loop.

Yeah, sorry. I went from 2021.8.6.to 2022.11.5. Mixed up the last digit. But now that I remember it, I did update my Weewx installation a few months ago and I basically only use the outside temperature in an automation that sets the time in the morning the thermostats raise their set points based on how cold it is outside. Now that it’s getting cold, I noticed it wasn’t working as expected and saw all my weather station data was unknown. With all my Tasmota lights going unresponsive after the upgrade, I made he wrong 1+1. But now, it’s back :slight_smile: Thanks.

PS. The automation uses the ‘Environment Canada’ temperature sensor for my city if my weather station data can’t be read but that one was broken with the update. It used to be configured in the configuration.yaml file but now it’s an integration. Looks like I’ll need a fallback for my fallback lol