Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Can't integrate NodeMcu sensors manually in configuration.yaml

$
0
0

@shehroz96 wrote:

Hi,

I’m trying to connect sensors from NodeMCU to Home Assistant using MQTT broker. Through serial communication, I sent the values to CloudMQTT and then tried to integrate with Home Assistant. I wasn’t able to automatically have my devices discovered by Home Assistant so I manually described the sensors in configuration.yaml file. Both temperature and humidity sensors are created in Home Assistant but they aren’t able to connect to the values from NodeMCU through MQTT.

However, in ‘developer tools/MQTT’, I’m able to listen to the state_topic of both sensors. I’m not understanding where I’m making the mistake.
I’m using these details:

mqtt: 
    broker: 'URL'
    port: 'Port'
    username: 'Username'
    password: 'Password'
    discovery: 'true'
    discovery_prefix: homeassistant

sensor:
  - platform: mqtt
    state_topic: 'sensor/temp'
    name: 'Temperature Sensor'
    unit_of_measurement: '°C' 
    value_template: '{{ value_json.temperature }}'
    force_update: 'true'
    availability_topic: 'sensor/temp'
    payload_available: 'online'
    payload_not_available: 'offline'
    unique_id: ID
    device_class: 'temperature'

  - platform: mqtt
    state_topic: 'sensor/humidity'
    name: 'Humidity Sensor'
    unit_of_measurement: '%' 
    value_template: '{{ value_json.humidity }}'
    force_update: 'true'
    availability_topic: 'sensor/humidity'
    payload_available: 'online'
    payload_not_available: 'offline'
    unique_id: ID
    device_class: 'humidity' 

Please comment.

image1

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>