This is the bridge that I configured in CloudMQTT. I tried Out and Both, but nothing worked.
This is my /etc/mosquitto/mosquitto.conf file. I temporary started logging, everything is default:
pid_file /var/run/mosquitto.pid
user mosquitto
port 1883
listener 9001
protocol websockets
persistence true
connection_messages true
allow_anonymous false
password_file /etc/mosquitto/pwfile
include_dir /etc/mosquitto/conf.d
log_dest file /var/lib/mosquitto/mosquitto.log
log_facility 5
log_type all
This is my /etc/mosquitto/conf.d/cloudmqtt.conf file:
connection cloudmqtt
address mXX.cloudmqtt.com:12345
remote_username hass #user name one of the users I created in CloudMQTT
remote_password hass #password one of the users I created in CloudMQTT
clientid ha
try_private false
start_type automatic
topic # in
I found something strange last night. I have logging enabled, so I run this command:
sudo systemctl restart mosquitto
This is the output that I have in log file:
1498411340: mosquitto version 1.4.12 (build date Thu, 25 May 2017 22:38:16 +0100) starting
1498411340: Config loaded from /etc/mosquitto/mosquitto.conf.
1498411340: Opening websockets listen socket on port 9001.
1498411340: Opening ipv4 listen socket on port 1883.
1498411340: Error: Address already in use
1498411341: mosquitto version 1.4.12 (build date Thu, 25 May 2017 22:38:16 +0100) starting
1498411341: Config loaded from /etc/mosquitto/mosquitto.conf.
1498411341: Opening websockets listen socket on port 9001.
1498411341: Opening ipv4 listen socket on port 1883.
1498411341: Error: Address already in use
I guess the port 1883 is in use. When I change this port in /etc/mosquitto/mosquitto.conf to, for example, port 8883, the mosquitto service starts. When this service starts (I also change port in the bridge of the CloudMQTT and firewall rule), if I run tests, I see that whatever comes to CloudMQQT arrives. I can see it in log file.
How to “create users in Mosquitto for your iPhones, and then point them directly at Mosquitto?” Can you please point me to component that does it? Is there a difference between presence or what you suggested?
I worry that I add more components to HA, they will use MQTT and does it mean that I will have problem with every new switch, sensor, etc…?
Thank you.