ScottS
43
What ended up working for me…
Message via CMD/BAT:
"C:\Program Files\mosquitto\mosquitto_pub.exe" -h localhost -t iotlink/home/haf922/windows-monitor/status -m SessionUnlock -u user -P pass -q 2 -r
Sensor:
- platform: mqtt
unique_id: session_status
name: "My Computer - Session Status"
state_topic: "iotlink/home/haf922/windows-monitor/status"
icon: mdi:account
value_template: "{{ value }}"
ScottS
45
Regarding retained messages… As I was working on another project, in mqtt explorer, I noticed…
-
There’s no ‘retained messages’ section under IoT Link nor ‘homeassistant’, only under the SSYS section
-
‘retained messages’ under SSYS only shows ‘count’.
I suspect, at least 1 of these needs to be added/configured in order for HA to actually see any retained messages?
If you’re sending the message via command line with mosquitto_pub.exe, then you should be able to set both the QOS and Retained status.
ScottS
47
Ah, okay, I’ll try that… Thanks.