IoT button for Home Assistant - IKEA Tradfri

The project: "I need a button for the bedroom, so I can get your attention when you're downstairs."

I looked for a button that was inexpensive and could link up to my existing home assistant setup. Sadly, it took awhile to get a Tradfri - they were frequently low or out of stock at the IKEA 60 minutes away. I eventually just mail-ordered two when they got in stock.

Nice size. Good weight. Uses Zigbee. Did not come with real instructions (probably supposed to install the app).

Zigbee pairing modes for Home assistant and IKEA Tradfri

Configuration > Integrations > HubZ Smart Home Controller (add it if you don't) > Configure. To have Home Assistant go into pairing mode, click on "ADD DEVICE" in the lower-right corner. 

Eventually I figured out you needed to click the button next to the battery 5 times in succession to be in discovery mode. A small red LED will blink through the front case when it starts trying to pair.

First Roadblock

I use a Nortek HUSBZB-1...it can do Zigbee and Z-Wave, which saves purchasing separate USB dongles. Sadly, Zigbee is more of a wild-west approach, with looser standards. All that Home Assistant could see after pairing was "Battery level" of the Tradfri. If you have a Conbee II Zigbee USB - the Tradfri might just work.

I mostly used the directions found here: https://www.reddit.com/r/homeassistant/comments/kq2c4n/how_can_i_upgrade_my_husbzb1_firmware/ I flashed my Nortek running the commands from my Ubuntu laptop, and then inserting the dongle back into the HA's RPi.

git clone https://github.com/walthowd/husbzb-firmware

pip install xmodem

cd husbzb-1-firmware

./ncp.py scan

./ncp.py flash -p /dev/ttyUSB1 -f ncp-uart-sw-6.6.5.ebl

Delete and Re-pair

I deleted the original Tradfri by going to Configuration > Integrations > HubZ Smart Home Controller (choose devices). Select the IKEA button, and then "REMOVE DEVICE". Repeat the pairing process, and hopefully you end up like me with a properly-paired Tradfri-HA.

Blueprints!

If you read my previous post, I expressed a fondness for blueprints. I used this one, and it worked on the first try (after I got past the roadblock and re-paired): https://community.home-assistant.io/t/zha-ikea-tradfri-shortcut-button/261936

It created a quick automation that allows my fiancee to send my cellphone "JIMMER: Save me from puppy"...assuming she can reach the button.

You can also add double clicks and long clicks

Good luck!

Comments

Popular posts from this blog

Home Assistant Controlling Octoprint through MQTT - Chapter 1

Setting up MQTT on HA and Octoprint

Home Assistant Controlling Octoprint through MQTT - Chapter 2