Hi,
I’m in a really annoying situation where I can’t add my new Switch to HomeAssistant because LIFX doesn’t have switch support for it for some reason, and I can’t add the Switch to HomeAssistant via HomeKit because I dont own an iPhone so I can’t obtain the HomeKit Pairing Code to add it to HomeAssistant via HomeKit.
Please just add switch support to HomeAssistant to fall in line with other products. Failing that, please let Android devices view the HomeKit Pairing Code. Neither of these things could be hard to do given other products already have HomeAssistant support, and the pairing code exists in the app already, just let me view it.
Switches were installed by a licenced electrician (as is required in Australia), and they promptly threw away all the packaging. But as far as I understand the home kit pairing codes are no longer in there anyway.
Not concerned with reading buttons at this stage, just need a way to read and control relays. Polling every few seconds seems a good enough solution.
Yep, codes arent printed on newer switches. I pulled mine off the wall (it says it’s printed on the device on the back side) and it was not there. I also checked all the documentation in the box, was not there.
If you run examples/mqtt.py it’ll detect all the switches on your local network, check which buttons control relays, and then create a set of mqtt topics for each relay before doing an mqtt loop_forever(). The topic names are printed so you can easily copy/paste them into your home assistant config, described next. By default, it polls relay states every 5 seconds.
In your home assistant configuration.yaml, add mqtt entries for what is attached to your relays. For example, I have a chandelier on one of them and it is configured as a light as follows:
Pushed a new update that allows you to configure what is attached to each relay and then offer discovery so you don’t need to manually configure anything in home assistant. I’m running this as a systemd service now and works great