Alright, I have made some changes with MQTT. Also to make it easier for everyone.
If you're using MQTT now, your config file probably looks something like this:
Code: Select all
"platform": "eDomoticz",
"name": "eDomoticz",
"mqttenable": 1,
"mqttserver": "ls99.ionline.nl",
"mqttport": "1883",
"mqttauth": 1,
"mqttuser": "",
"mqttpass": ""
In the latest version (npm & git) the configuration file needs a little change. For most of you, the
new file will look as follows:
Code: Select all
"platform": "eDomoticz",
"name": "eDomoticz",
"mqtt": true
And that's it. No need for any server/port, username/password combination anymore.
The plugin now asks Domoticz for the MQTT server and credentials.
------------
If you're wondering how to override values, keep reading.
In the config file, 'mqtt: true' can be changed to a dictionary, as follows:
Code: Select all
"mqtt": {
"host": "alternate.mqtt.com",
"port": 1234,
"topic": "domoticz/out",
"username": "username",
"password": "password"
}
Which will result in the following output:
Code: Select all
[11/28/2016, 10:45:08 AM] [eDomoticz] Retrying connection to MQTT broker... (5/5)
[11/28/2016, 10:45:09 AM] [eDomoticz] Could not connect to MQTT broker! (alternate.mqtt.com:1234)
Note: You're using a username and password to connect. Please verify your username and password too.
Values can be omitted from this dictionary, and the values that need overriding can be kept, e.g.
Resulting in:
Code: Select all
[11/28/2016, 10:46:42 AM] [eDomoticz] Retrying connection to MQTT broker... (5/5)
[11/28/2016, 10:46:51 AM] [eDomoticz] Could not connect to MQTT broker! (127.0.0.1:1234)
The 127.0.0.1 host is fetched from Domoticz here. The port was overridden by the config.
Most users will be fine though using just:
Since you'd always want those servers to be the same.
------------
PS. As for now, the old configuration,
"mqttenable": 1 still works. There will be no support for it anymore in the near future, though.