Here’s how I have mosquitto configured:
{
"logins": [
{
"username": "mozzie",
"password": "(password)"
}
],
"anonymous": true,
"customize": {
"active": false,
"folder": "mosquitto"
},
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"require_certificate": false,
"plain": true,
"ssl": false
}
and here’s how I have my devices setup (the x10 ones are commented out because I can’t figure out how to enter their house and unit codes):
logging:
level: 10
insteon:
port: 'socket://192.168.1.64:9761'
address: 25.e8.e4
storage: 'data'
devices:
switch:
# - g2.00.00: 'traffic'
- 35.40.18: 'floor'
# - g5.00.00: 'bedroom'
dimmer:
- 26.9d.19: 'table'
- 41.0e.c9: 'bathroom'
- 41.14.0a: 'hallway'
- 24.e4.85: 'dining'
- 40.63.c9: 'kitchen'
- 43.c7.bb: 'office'
motion:
- 4f.88.a7: 'garagemotion'
keypad_linc_sw:
- 39.45.a1: 'keypad'
outlet:
- 4e.6d.ef: 'garage'
mqtt:
broker: core-mosquitto
port: 1883
username: mozzie
password: (password)
keep_alive: 30
qos: 1
retain: 1
cmd_topic: 'insteon/command'
Everything after that is unchanged from the default yaml configuration.
The IM log shows it’s connecting to mosquitto:
2020-01-16 12:23:39 DEBUG poll: Link connection attempt MQTT core-mosquitto:1883
2020-01-16 12:23:39 INFO Mqtt: MQTT device opened core-mosquitto 1883 with keepalive=30
2020-01-16 12:23:39 DEBUG poll: Link connection success MQTT core-mosquitto:1883
2020-01-16 12:23:39 DEBUG poll: Link added: MQTT core-mosquitto:1883
2020-01-16 12:23:39 DEBUG Mqtt: MQTT subscribe insteon/command/+ qos=1
2020-01-16 12:23:39 DEBUG Mqtt: MQTT subscribe insteon/modem/scene qos=1
(many subscribe messages not shown)
And likewise, mosquitto shows it was connected to from both HA itself and IM:
1579199324: New connection from 172.30.32.1 on port 1883.
[INFO] found homeassistant on local database
1579199325: New client connected from 172.30.32.1 as auto-632408A8-6010-CD04-EC18-317156CF4E0E (p2, c1, k60, u'homeassistant').
1579199327: New connection from 172.30.33.1 on port 1883.
[INFO] found mozzie on local database
1579199327: New client connected from 172.30.33.1 as insteon-mqtt (p2, c0, k30, u'mozzie').
Edit: Woo, progress! I was apparently missing a bit of stuff in the master config.yaml for home assistant. I added this:
mqtt:
broker: hassio.local
port: 1883
username: mozzie
password: (password)
And now messages are passing between mosquitto and IM succesfully! I sent a refresh all command, and lots and lots of stuff happened.
I’m going to poke around and see if I can actually get lights to work, but it appears my only open question is how do I configure my two X10 devices. Thanks a lot for all the help so far!
Note to Randall (I am limited to the number of replies, I had to edit instead, that’s annoying!:
I can help with this one!
If you’re using hassio, there’s no place for a command line utility. Instead, you need to open up the developer tools, click on “services”, and under service name on the page that opens, put “mqtt.publish”. Inside the message box, you would put your topic and payload. For example, if I want to turn on my hallway light, I would do this:
topic: insteon/41.14.0a/set
payload: on
qos: 1
retain: true
If you want to do that refresh-all command, it looks like this:
topic: insteon/command/modem
payload: '{ "cmd" : "refresh", "force": true}'
qos: 1
retain: true
Alternatively, you can set up an MQTT client utility (such as mqtt-cli, or MQTTBox) and send the messages that way. mqtt-cli is handy if you need to send a bunch of messages multiple times and don’t want to keep cutting and pasting.
Read this message for some more clues (like what you need to do in config.yaml) on the config process.
Edit: If you install the ssh server, you can also do this right from the hassio shell:
[Iris]pv: ssh [email protected]
Enter passphrase for key '/Users/pv/.ssh/id_rsa':
_ _ _
| | | | (_)
| |__| | __ _ ___ ___ _ ___
| __ |/ _` / __/ __| | |/ _ \
| | | | (_| \__ \__ \_| | (_) |
|_| |_|\__,_|___/___(_)_|\___/
Our Cli:
$ hassio help
~ $ mosquitto_pub -h 'core-mosquitto' -t 'insteon/43.c7.bb/set' -m 'on'
~ $