StefanoGiu
(Stefano Giugliano)
May 5, 2020, 7:35am
1
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”.
francisp
(Francis)
May 5, 2020, 7:41am
3
Did you allow the windows firewall access to 1883 ?
StefanoGiu
(Stefano Giugliano)
May 5, 2020, 7:41am
4
Could you elaborate this a bit more?
Did you try it with HA on Windows?
StefanoGiu
(Stefano Giugliano)
May 5, 2020, 7:42am
5
As I said, I can communicate with MQTT broker from another PC
francisp
(Francis)
May 5, 2020, 7:49am
6
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’
StefanoGiu
(Stefano Giugliano)
May 5, 2020, 7:54am
7
@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
(Francis)
May 5, 2020, 9:50am
9
If you listen to bruh/sensornode1 , do you see results ?
StefanoGiu
(Stefano Giugliano)
May 5, 2020, 9:55am
10
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
StefanoGiu
(Stefano Giugliano)
May 5, 2020, 10:05am
12
A stupid typo in the mosquito_pub message!!!
Do I need username and password?