Tutorial - How i use Flic Smart Button with HA
1) I install Hassbian 1.23 - HA v.0.48 - Raspberry Pi 3
2) Install the Flic SDK Service Source
- git clone https://github.com/50ButtonsEach/fliclib-linux-hci.git
- cd fliclib-linux-hci/bin/armv6l
- sudo setcap cap_net_admin=ep ./flicd
- ./flicd -f flic.sqlite3
3) Pairing
If you have only 1 binary_sensor (only the Flic Button) so the code for the configuration.yaml is:
binary_sensor:
platform: flic
so now restart the HA - Service. After this; hold the Flic-Button for 7 Sec.
Now you can see him
4) Flic Service as a System Service:
Create a file under:
/etc/systemd/system
–> flicd.service
the code for the Service (it’s running!)
[Unit]
Description=flicd Service
After=bluetooth.service
Requires=bluetooth.service
[email protected]
[Service]
TimeoutStartSec=0
ExecStart=/usr/local/bin/flicd -f flic.sqlite3 -s 0.0.0.0 -h hci0 -w
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
Save the file!
copy the flicd from the source folder to /usr/local/bin/ (my is:)
cd fliclib-linux-hci/bin/armv6l/
sudo cp flicd /usr/local/bin/
sudo systemctl daemon-reload
Reboot the Client
sudo systemctl enable flicd.service
sudo service flicd start
Troubleshooting with "simpleclient "
- start the service and another terminal
- in the new terminal: cd /home/pi/fliclib-linux-hci/simpleclient/
- make
- sudo ./simpleclient localhost
startScanWizard
so, i can see, that the button ar running “correctly”