Help with MQTT/Mosquitto/HA and Windows

I have downloaded mosquitto exe and it’s running on the server
I can use pub/sub to publish/subscribe the messages from another computer successfully
I’ve added this in the config:

mqtt:  
  broker: 192.168.1.63  
  port: 1883  
  client_id: home-assistant-1

And this as sensor…

- platform: mqtt  
    state_topic: "bruh/sensornode1"  
    name: "SN1 Temperature"  
    unit_of_measurement: "°F"  
    value_template: '{{ value_json.temperature | round(1) }}'

But… if I publish a message like this

mosquitto_pub.exe -h 192.168.1.63 -t "bruh/sensordone1" -m "{ "temperature" : "14" , "motion" : "ON" }"

I cannot read the value in the sensor.

Any idea?

I just found out about mqtt explorer yesterday. Start it on client machine (e.g. windows) and then point to your broker and you can see “everything”.

Did you allow the windows firewall access to 1883 ?

Could you elaborate this a bit more?

Did you try it with HA on Windows?

As I said, I can communicate with MQTT broker from another PC :slight_smile:

Then the next step is to see if HA connects to your broker.

Go to developer tools -> Mqtt

enter # under ‘topics to subscribe to’, hit ‘start listening’

then, under ‘publish a packet’, enter test under topic ‘topic’, and ‘on’ next to payload, and hit ‘publish’

See if you get any response under ‘listen to a topic’

@francisp I can listen to MQTT messages if I start listening from MQTT page under developer.

So I send mosquitto_pub and I read the payload in the HA page.

But sensors doesn’t seems to be updated

@francisp any idea?

If you listen to bruh/sensornode1 , do you see results ?

No… the problem seems to be the “/”… If I send message to bruh and listen to bruh I can get it…

but not with bruh/sensornode1

Fixed it!

Thanks @francisp

A stupid typo in the mosquito_pub message!!!

Do I need username and password?

If it works, no