Install Flic

Good evening, :slight_smile:

i bought a Flic Button and now i want integrat it in my HA.
But i doesn’t unterstand, how can i activate it.

I know that i have to install the Flic SDK for Linux.

but how? :frowning: i dont’ understand this introduction.

the action: sudo setcap cap_net_admin=ep ./flicd

said: “Failed to set capabilities on file `./flicd’ (Invalid argument)”

Basic system: Raspberry Pi with Hassbian

Thanks for your Help!

Hi! I’m also looking for a description or a tutorial to install the flic sdk on a raspberry pi 2 with a asus bluetooth dongle. Can someone help?

This helped my :slight_smile:

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”

4 Likes

I’ve got some notes on how to get it up and running here

Download both files into the same location, then run the fliclib_setup.sh as root

how nice :slight_smile: thx!

Great write-up!
One question: will the fliclib still grab the bluetooth chip exclusively and making it unable to function with other bluetooth devices? More precisely, do I need to get a seperate bluetooth dongle just for the flic buttons?

Hi
I also have a flic button I want to include in HA. Should I still follow the steps 1-4 as above or has anything changed since then with new versions of HA?

are all 4 steps necessary for installing flic or either 1-3 or 4?

if you want the Flic Server as a Service, so you need to install as a System Service (4). So you didn’t musst the service start manuel after every boot.

But i have HA now as Hass.io and there doesn’t exist Sudo…

Is it just to repeat step 3 to add more buttons?`

Edit: Just realized that it is just to press down the next button 7 seconds and it will show up! Awesome!

Hmmm. I’m having some major issues with my buttons. Really hope someone can help out!

I’m running a Pi3 with Hassbian and Home Assistant 0.52.1 and I currently have 3 Flic buttons. After a reboot/startup of the Pi the buttons seems to be working just fine. But after a while the buttons does not work anymore and I need to reboot the Pi. I can’t find any buttons using the startScanWizard either…

Anyone that can help me troubleshoot?

The Addon from @pschmitt works fine!

grafik

Install first the Bluethooth Addon!

grafik

Link:
Communication
Addon

Thanks!

I will try the addon later this week if I get the time.

I did do a complete re-installation of my system and and the buttons seemed to work just fine. It actually worked for a couple of days without issues. Then I decided to install a USB webcam (using this guide: https://home-assistant.io/blog/2016/06/23/usb-webcams-and-home-assistant/ ) as the last part of restoring my old setup. After this I got the same problems as before (buttons working for a short time after boot, then not responding)! Could motion in someway cause issues with Flic-service? It seems a bit far-fetched, but I can’t remember doing any other changes to my working setup…

I have just installed newest version of Hassbian with HA 0.57.3 and want to integrate flic again but I am still not quite sure how this can be done the best way.
It seems that there is more than one way according to the previous posts.

In what folder on the pi should the files be placed. I have put them in the home folder but it does not Work.

weird enough, on my RPI 2 with a USB bluetooth and venv install I needed to disable the /etc/systemd/system/bluetooth.target.wants/bluetooth.service by commenting the [Service]

[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)
ConditionPathIsDirectory=/sys/class/bluetooth

[Service]
#Type=dbus
#BusName=org.bluez
#ExecStart=/usr/lib/bluetooth/bluetoothd
#NotifyAccess=main
##WatchdogSec=10
##Restart=on-failure
#CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
#LimitNPROC=1
#ProtectHome=true
#ProtectSystem=full

[Install]
WantedBy=bluetooth.target
Alias=dbus-org.bluez.service

I got too many WizardBluetoothUnavailable which conducted me to say that the bluetoothd daemon was interfering with Flic as stated in the Flic readme.
Everything work now yeah!

… Now I’m trying to install the flics and the link cant be found… NOOO

@Underknowledge I also tried to reinstall HA and flicd and came across this link:
It installs flicd in a docker container. Works flawless

1 Like

Atm on it :slight_smile:
always missing the flic Linux SDK install instructions for now- but I’ll dig me thru i guess.


AAAH! I have to install the docker first!!11
curl -sSL https://get.docker.com | sh


btw! Found the “hidden” guide for the other ones who want it more complicated xD

sudo wget https://github.com/50ButtonsEach/fliclib-linux-dist/archive/1-beta3.tar.gz
sudo tar -zxvf 1-beta3.tar.gz
uname -m (should get you armv7l)
cd armv7l
./daemon -l -f flic.sqlite3

but this docker is stupidly easy!
but i have to use “sudo docker xxxyyyyyyyyy” first. Did i do something wrong there?