Invalid config for [sensor]: required key not provided @ data['platform']. Got None

Hi
I’ve just started with HA and I just not get yet the trick to integrate Shelly sensors with mqtt an didn’t find any solution :frowning:

Perhaps anyone can give me a hint.


HA ist running on a RasPi 4 with 4GB, Version 0.115.0
I’ve installed Mosquitto Broker V 5.1 with following config

logins:
  - username: ****
    password: ****
anonymous: false
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

On shelly-sensor (newest firmware), mqtt is activated


user and pass equal as in mqtt config
ip-adress equal RasPi’s ip-adress with HA installation.


Integration Mosquitto Broker is installed


for this code (as written in https://shelly-api-docs.shelly.cloud/#shelly-h-amp-t-mqtt) in the configuration.yaml, i get always the error as written in the topic, where F4466F is the identity of the shellyht-sensor.

sensor:
  - plattform: mqtt
    name: "shelly-ht-naturkeller-temp"
    state-topic: "shellies/shellyht-F4466F/sensor/temperature"
    unit_of_measurement: "°C"    
  - plattform: mqtt
    name: "shelly-ht-naturkeller-hum"
    state-topic: "shellies/shellyht-F4466F/sensor/humidtiy"
    unit_of_measurement: "%"
  - plattform: mqtt
    name: "shelly-ht-naturkeller-batt"
    state-topic: "shellies/shellyht-F4466F/sensor/battery"
    unit_of_measurement: "%"

Sorry about these beginners questions, I hope i get it as fast as possible :blush:

You have misspelled platform

1 Like

Hi Matthew

Thanks for your fast answer!
Ups, thats quite embarassing, sorry about that. Tranlsation “error” from german to english :expressionless:

Unfortunately I get now another error:
Invalid config for [sensor.mqtt]: [state-topic] is an invalid option for [sensor.mqtt]. Check: sensor.mqtt->state-topic. (See ?, line ?)

I think something important is missing (device, entitiy) but how do I get them into HA?

It is state_topic

1 Like

:sleepy:
it’s too late (02:35 in Europe), I dont’ see anything…
I red the linked page several times…
Thanks a lot and sorry about that!

There is nothing to be sorry about. You are asking as a beginner. As a more experienced user, I know how to read the error messages as a clue to what might be wrong.

Get some sleep!

5 Likes