Github Devices Community Docs Blog

MQTT Sensor in HA

Hi!

I have set up OMG on a ESP8266 with a HM10 for BLE and it all seems to work fine with auto discovery. HA find’s my Mijia temp sensors and in MQTT I get messages like this:

The problem is I want to integrate my sensors manualy to have more controll over each device with the MAC adress. But when I add them in sensor.yaml I get unknown state.

- platform: mqtt
  name: "mijia_temp_bedroom"
  expire_after: 21600 # 6 hours
  state_topic: "home/OpenMQTTGateway_ESP8266_BLE/BTtoMQTT/AAAAAAAAAAAA/tem"

- platform: mqtt
  name: "mijia_hum_bedroom"
  force_update: true
  expire_after: 21600 # 6 hours
  state_topic: "home/OpenMQTTGateway_ESP8266_BLE/BTtoMQTT/AAAAAAAAAAAA/hum"

Can anyonne point out what I’m missing? :slight_smile:

This did the trick: :sunglasses:

  • platform: mqtt
    state_topic: ‘home/OpenMQTTGateway/BTtoMQTT/AAAAAAAAAAAA’
    name: “mijia_thermometer_temperature”
    unit_of_measurement: ‘°C’
    value_template: ‘{{ value_json.tem }}’
    expire_after: 21600 # 6 hours

I did update the github wiki for Mijia thermometer :cowboy_hat_face:

1 Like