Unable to show MQTT Data

Hi,

My apologies if this maybe already been covered, however couldn’t find anything in the forums.
I have a MQTT topic “/feeds/temperature” (private MQTT broker) where some sensor temperature data is being published. Having setup a standard MQTT sensor in HASS, it doesn’t show anything though.

The HASS log shows the feed to be received successfully:

INFO:homeassistant.core:Bus:Handling <Event mqtt_message_received[L]: qos=0, topic=/feeds/temperature, payload=2280>

(Don’t mind the big value for temperature: it’s a test :slight_smile:)

Any idea what I am missing? My guess is that I have something not setup properly…

Cheers! Sacha

Hard to tell. Anyway, let’s give it a try with a local mosquitto instance:

sensor:
  - platform: mqtt
    state_topic: "home/kitchen/temperature"
    name: "Kitchen Temperature"
    unit_of_measurement: "°C"

Publishing a new temperature

$ mosquitto_pub -V mqttv311 -h localhost -d -t "home/kitchen/temperature" -m "21"

Leads to the following log entry:

16-05-08 11:11:39 INFO (Thread-2) [homeassistant.core] Bus:Handling <Event mqtt_message_received[L]: qos=0, topic=home/kitchen/temperature, payload=21>
16-05-08 11:11:39 INFO (ThreadPool Worker 2) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.kitchen_temperature=21; unit_of_measurement=°C, friendly_name=Kitchen Temperature @ 2016-05-08T11:11:39.183455+02:00>, entity_id=sensor.kitchen_temperature, old_state=<state sensor.kitchen_temperature=22; unit_of_measurement=°C, friendly_name=Kitchen Temperature @ 2016-05-08T11:08:52.596267+02:00>>

Thanks for the feedback! I figured it out eventually… My own mistake

In the configuration my value template was set as “{{ value.x }}”. Changing this to “{{ float(value) / 100 }}” solved the issue. (I had to cast to float because the sent value is an int value multiplied by 100).

It works perfectly! Appreciate all the work put in this great piece of software :slight_smile: