So, I finally got the add-on installed, and read the doc, but some questions remain.
-
Re: the top “Configuration” section, it was not obvious to me where those properties are supposed to be stored. Is it in configuration.yaml in the global section ? Or through GUI ?
I finally found it in the GUI in Configurations / Add-ons / X10 MQTT / Configuration tab. -
The doc above mentions the Mosquitto add-on. It was not obvious at all how to set it up.
I tried to add it from the add-on store, but it did not get show up at all in the screen at Configurations / Add-ons .
However, when I go to Configurations / Add-ons / Add-on store / Mosquitto broker, the uninstall button appears, so it seems it got installed after all. I can see the start/stop/restart / uninstall buttons . And there is a configuration tab. I was able to start it manually. I think there is some major bug with the add-on installation in the GUI right now.
What’s very odd is that the Hostname - core-mosquitto appears to be hardcoded. It’s not part of the configuration. The hostname resolves to 172.30.33.3 in the terminal. Looks like it’s setup in the local DNS server. The address can be pinged, even though it’s clearly not part of my LAN. This must be a docker thing.
- I created a new user/password per the doc at addons/DOCS.md at 4cd2e8846a9e3373a6de87f6f194a6c5492fece5 · home-assistant/addons · GitHub , and set those up in the X10 to MQTT add-on configuration tab. I was able to start the X10 to MQTT add-on . It seems to be fine.
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:16:40] INFO: Configuring Heyu...
[21:16:43] INFO: CM11 is enabled
starting heyu_relay
Establishing MQTT to core-mosquitto port 1883...
(Using MQTT username mqtt-user)
Waiting for MQTT messages and monitoring for remote changes
Connected to MQTT broker, result code 0
-
I gathered that I also needed the MQTT integration to be installed, in order for HAOS to find X10 devices. The integration asks for a “broker” rather than “host” or “hostname” as named in the X10 to MQTT add-on and Mosquitto broker respectively. And there is no default value. I setup “core-mosquitto” as in the broker field, and used the previously added mqtt-user and configured password.
-
I still didn’t see any X10 devices being discovered, unfortunately. I have the following configured in configuration.yaml :
switch:
- platform: mqtt
name: "Office ceiling light"
state_topic: "x10/stat/b1"
command_topic: "x10/cmd/b1"
payload_on: "ON"
payload_off: "OFF"
retain: false
Does this look correct ? I wonder about the - sign in the platform line. I tried with and without it, but there was no change.
Perhaps the add-on hasn’t taken into account the changes from configuration.yaml yet. If so, what do I need to do to make it do that ? Is “restart server” the only option ? Or should Server controls / YAML configuration load / Manually configured MQTT entities also work ?
- I restart HAOS with a power-down / power-up . The log from the Mosquitto add-on shows this :
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] mosquitto.sh: executing...
[21:54:56] INFO: SSL is not enabled
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[21:54:58] INFO: Starting NGINX for authentication handling...
[21:54:58] INFO: Starting mosquitto MQTT broker...
1648529699: mosquitto version 1.6.12 starting
1648529699: |-- *** auth-plug: startup
[21:55:02] INFO: Successfully send discovery information to Home Assistant.
[21:55:03] INFO: Successfully send service information to the Supervisor.
1648529699: Config loaded from /etc/mosquitto/mosquitto.conf.
1648529699: Loading plugin: /usr/share/mosquitto/auth-plug.so
1648529699: ├── Username/password checking enabled.
1648529699: ├── TLS-PSK checking enabled.
1648529699: └── Extended authentication not enabled.
1648529699: Opening ipv4 listen socket on port 1883.
1648529699: Opening ipv6 listen socket on port 1883.
1648529699: Opening websockets listen socket on port 1884.
1648529700: Warning: Mosquitto should not be run as root/administrator.
1648529700: mosquitto version 1.6.12 running
1648529700: New connection from 127.0.0.1 on port 1883.
1648529700: Socket error on client <unknown>, disconnecting.
1648529740: New connection from 172.30.32.1 on port 1883.
{"result": "ok", "data": {}}1648529740: New client connected from 172.30.32.1 as 1NAgxre6li50NIxp50EX4T (p2, c1, k60, u'mqtt-user').
1648529781: New connection from 172.30.33.2 on port 1883.
The log from the X10 to MQTT add-on is the same as already posted above.
It seems like I shouldn’t be far from getting it to work, but unfortunately, no dice yet after a couple hours of playing with it. Any help from those who succeeded would be greatly appreciated !