Home Assistant 2022.12.5 upgrade problem with sensor integration

Hi …

I am using an external weather station reading sensor with mqtt. Everything its working perfect before the upgrade to HA 12.5.
But after the upgrade to 12.5 i need to change the sensor.yaml in the next format:

Here is my old config …

#estacion exterior meteo

  • platform: mqtt
    state_topic: “weather/outTemp_C”
    name: “Temperatura exterior”
    unit_of_measurement: ‘°C’

After changing the code to use the new format …

mqtt:
sensor:
- name: “Temperatura exterior”
- state_topic: “weather/outTemp_C”
- unit_of_measurement: ‘°C’

Now i have got the next error when trying to reboot :

The system cannot restart because the configuration is not valid: Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 33).

How can i resolv the problem? Mayabe something missing?

Thanks!

It should look more like this.
Only 1 - (dash) is needed,

mqtt:
  sensor:
    - name: “Temperatura exterior”
      state_topic: “weather/outTemp_C”
      unit_of_measurement: ‘°C’

    - name: "next sensor" 
      state_topic: etc etc

Hi …

I have change it and i have got the same error when trying to reboot:
The system cannot restart because the configuration is not valid: Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /config/configuration.yaml, line 33).

Here you have the lines … of configuration.yaml

31 # zigbee mqtt etiquetas
32 input_boolean: !include input_boolean.yaml
33 timer: !include timer.yaml
34 sensor: !include sensor.yaml
35 input_text: !include input_text.yaml

Why an error on line 33? it should be 34 ?

Ahh didn’t notice the include bit.
Yeah line 34

Something like this should work.

You need to move or remove the mqtt and sensor from the earlier example I posted.

mqtt:
  sensor:

sensor: !include mqtt_sensor.yaml
- name: “Temperatura exterior”
   state_topic: “weather/outTemp_C”
   unit_of_measurement: ‘°C’

- name: "next sensor" 
   state_topic: etc etc

Thanks … Now no error … But …

Mosquitto Broker does not receive data from my weather station. …
If i recover the backup of the 12.4 version it’s working perfectly…

Maybe something regarding the new 12.5 version and mosquitto problem … ?

Best regards and thanks for your quick support …

12.5 mqtt is working for me.

Is the new sensor format working on 12.4 or is it using the old format when you roll back?

Have a look with mqtt-Explorer and the mqtt addon logs to confirm the weather station is getting messages to the broker. Perhaps it’s a user/pw problem.

Have a look in the supervisor log(assuming you are using supervisor) to check its not giving a mqtt addon error. Might need a host reboot.

Hi …
Sorry for disturbing you … ;).

I am using weewx (weather soft ) to get data from my weather station and send it to HA.
When i am using 12.4 version with mosquitto broker 6.1.3 i can see this message in the log …

2022-12-14 11:50:31: New connection from 192.168.0.6:56181 on port 1883.
2022-12-14 11:50:31: New client connected from 192.168.0.6:56181 as weewx_92914b9b (p2, c1, k60, u’mqtt’). …

But when using the 12.5 version there is no message of connections … it only starts the mosquitto service and waits …

Best regards …

Try a reboot(not a restart) , might have a duplicate of mqtt running, reboot should clear it out.

Hi …

Sorry, the system i am using it’s a RPi3. And these are what i get from mqtt log :

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/mosquitto.sh
[13:17:23] INFO: Certificates found: SSL is available
cont-init: info: /etc/cont-init.d/mosquitto.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun mosquitto (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
s6-rc: info: service legacy-services successfully started
[13:17:27] INFO: Starting NGINX for authentication handling…
[13:17:27] INFO: Starting mosquitto MQTT broker…
2022-12-14 13:17:27: Warning: Mosquitto should not be run as root/administrator.
[13:17:31] INFO: Successfully send discovery information to Home Assistant.
[13:17:32] INFO: Successfully send service information to the Supervisor.

There is no more connecting lines … it was stuck there … Also i have tried to restart the whole system … but the problem persists… i don’t understand what’s wrong …

Thanks for your support.

That is abit odd. The weather station is your only mqtt device?

I didn’t see any changes listed for mqtt in the 12.5 release notes, though I didn’t look overly hard.

Can you log onto the broker with mqtt-Explorer? Does the weewx have a remote Web console that might show an error message?

It sounds like you need to revert back to a backup of 12.4 when everything worked and start at the beginning of updating your mqtt sensors to the new format.

Once you revert back again reply here with the errors you are getting and the properly formatted code blocks for your MQTT sensors. The way you have your code above it’s impossible to see where any issues are.

Hi…
Yes now i am back in version 12.4 …

New mqtt format in 12.5 version? where can i get more info about it?

Maybe i am thinking that the problem could be the weewx mqtt extension … I will check …

Best regards.

Hi …
Problem solved …
There was a problem with my configuration.yaml file.

Thanks so much for your help !!

1 Like