Hi all,
Really hope the skilled and smart guys (like you all are) can assist me here;
1 - Installed HA on Docker (on an Intel NUC running Ubuntu 18.04)
2 - Installed MQTT Mosquitto Addon
3 - Installed Monitor on separate RPi 3 (http://www.github.com/andrewjfreyer/monitor)
1:
Configured MQTT in configuration with Broker address 127.0.0.1, port 1883
IP of Intel NUC is 192.168.11.129, Docker is at 172.x.x.x
Can start SSH at HA and run ‘mosquitto_sub…’ and see entries from ‘Monitor’
2:
Mosquitto Addon config (user & pass masked):
{
"logins": [
{
"username": "XXXX",
"password": "XXXX"
}
],
"anonymous": false,
"quiet_logs": true,
"customize": {
"active": true,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem"
}
3:
Monitor is configured with this (user & pass masked):
mqtt_address=192.168.11.129
mqtt_user=XXXX
mqtt_password=XXXX
mqtt_topicpath=monitor
mqtt_publisher_identity='rpi3'
mqtt_port='1883'
mqtt_certificate_path=''
mqtt_version=''
Now, here is where I get lost;
As I said, opening SSH to HA (192.168.11.129) and running:
mosquitto_sub -h 127.0.0.1 -u <USER> -P <PASSW> -v -t "monitor/#"
… I can see entries from Monitor, example:
monitor/rpi3/status online
monitor/rpi3/apple_ipad {"id":.....
Then, created a sensor like this:
- platform: mqtt
state_topic: 'monitor/rpi3/d0:d7:83:c6:ba:44'
value_template: '{{ value_json.confidence }}'
unit_of_measurement: '%'
name: 'Office'
The sensor return “unknown”.
Trying to go to dev-mqtt and type:
topic: monitor/rpi3/d0:d7:83:c6:ba:44
payload: {{ value_json.confidence }}
When hitting Publish, it returns:
'Failed to call mqtt/publish. UndefinedError: 'value_json' is undefined.
I’m sooo lost, don’t know if this is related to the setup of HA and Mosquitto MQTT or Monitor - or some other missing config.
Anybody, help?
UPDATE:
If I SSH to HA and change the mosquitto to:
mosquitto_sub -h 127.0.0.1 -u <USER> -P <PASSW> -v -t "monitor/rpi3"
…and not /#, I stop receiving updates on HA from Monitor!
Could it be that I am not allowing to /rpi3/ ?
Damn, this is difficult for a noob playing with MQTT for a few days only…
UPDATE 2:
Followed the configuration instructions from: https://www.home-assistant.io/addons/mosquitto/#access-control-lists-acls
My ‘/share/mosquitto/accesscontrollist’ :
user <USER>
topic #