Bruh Multisensor with Esphomeyaml

I used esphomyaml to create a bruh multisensor on a nodemcu, it seems to be working, but I can’t get the temperature and humidity to show up in Home assistant. Checking mqtt I see the following messages:

ms1/sensor/ms1_temperature/state 21.4
ms1/sensor/ms1_humidity/state 29

this is how I’ve got the sensors setup:

  - platform: mqtt
    name: "Hallway Temp"
    state_topic: "ms1/sensor/ms1_temperature/state"
    unit_of_measurement: "C"
    qos: 1
    value_template: '{{value_json.temperature | round(1) }}'

  - platform: mqtt
    name: "Hallway Humidity"
    state_topic: "ms1/sensor/ms1_humidity/state"
    unit_of_measurement: "%"
    qos: 1

What am I doing wrong? This is the configuration I used:

esphomeyaml:
  name: ms1
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: wifi access
  password: password
  
mqtt:
  broker: 192.168.0.5
  port: 1883
  username: 
  password: 
  
web_server:
  port: 80
  
api:

# Enable logging
logger:
  level: WARN

sensor:
  - platform: dht
    pin: D7
    temperature:
      name: "ms1_temperature"
    humidity:
      name: "ms1_humidity"

binary_sensor:
  - platform: gpio
    pin: D5
    name: "ms1_motion"
    device_class: motion

output:
  - platform: esp8266_pwm
    pin: D1
    id: redgpio
  - platform: esp8266_pwm
    pin: D2
    id: greengpio
  - platform: esp8266_pwm
    pin: D3
    id: bluegpio

light:
  - platform: rgb
    name: "ms1_light"
    red: redgpio
    green: greengpio
    blue: bluegpio

My ESPHome Yaml is the same as yours, and you know it works as you can see it in the MQTT logs, this is my MQTT sensor setup in HA.

- platform: mqtt
  name: Garage Temperature
  state_topic: outsidelight/sensor/garage_temperature/state
  availability_topic: outsidelight/status
- platform: mqtt
  name: Garage Humidity
  state_topic: outsidelight/sensor/garage_humidity/state
  availability_topic: outsidelight/status

I then have this is my customize.yaml

sensor.garage_temperature:
  device_class: temperature
  unit_of_measurement: "°C"

sensor.garage_humidity:
  device_class: humidity
  unit_of_measurement: "%"

And that seems to work for me.

1 Like

Thank you that’s all it took to get the temp and humidity to show.

1 Like