Flic.io button

If you are running the Flic app on an android device, the “Internet Request” provider module has way more option than on iOS. That way you are able to create and trigger/control a HTTP Sensor or HTTP Binary Sensor in Home Assitent, just by using the Flic Button an the standard Flic App. From there, you can do what ever you want with that Sensor and for example change scenes.

This Flic Linux SDK is now available to be used with Raspberry Pi for example. Works great and even I could set it up with minimum knowledge over Linux, Raspberry, Home Assistant etc.

Link to SDK: https://github.com/50ButtonsEach/fliclib-linux-hci

BUT, I do have a problem. I don’t know how to make flic run as a service/daemon and always restart together with Pi reboot. (preferably before Home Assistant starts).

Here’s some instructions on how to run it as daemon (but I failed): https://github.com/50ButtonsEach/fliclib-linux-hci/issues/39

So, any more detailed instructions available on how to set this up?

Ah sorry… I forgot the mention this important part. Flic is now available as a component for HA: https://home-assistant.io/components/binary_sensor.flic/


I’ve got this set up to autostart on boot and it’s working beautifully.

<old version redacted>

See this post for current implementation.

Thanks SupahNoob!

I actually got this working already using the systemd example given in this issue: https://github.com/50ButtonsEach/fliclib-linux-hci/issues/15

But it’s good to have some options in case this fails.

Sure! I’m curious to know what you use the flic buttons for, so make a post in the Share Your Projects sub once you’ve come up with something fun :slight_smile:

Just got my flics implemented in a new HASS install. I have two buttons on the Dashboard and they display activity…very nice! Is there a way to rename the buttons? They are currently named flic_{bt id}, I want “Blue Flic”, “Black Flic” etc

Take a look at

Doesn’t seem to be working Is this the correct format. I get confused that the examples all seem to have dashes but I don’t think they belong in the file. I think they are just marking the relevant config lines ?

Here is what I tried

  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  # metric for Metric, imperial for Imperial
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Pacific/Honolulu
        entity_id: flic_80e4da714733
        friendly_name: BlackFlic

Not sure if this is the entity id but it is the current name of the button

Does anyone else know how to rename these flic buttons ?
Customize doesn’t seem to work.

check your customize syntax - and what it says in the log file - looks not quite right

Will check what I did for mine when I am home in a couple of hours - but I have renamed them:

@phileep thanks. I tried the following and managed to get them all to rename to FlicButton; but they are all the same. So I still don’t have it right. Somehow I need to figure out what the unique entity_id’s are for each button.

- entity_id: binary_sensor
friendly_name: FlicButton

my setup is to rename in the customize section

      friendly_name: Black1

Note the customize names the entity with a colon after it, then set your friendly name, icon etc

1 Like

I’m curious – why do you have these exposed to the frontend? What is the point, since they only register events, which shows up as a blip, in terms of displaying useful information.

Only for setup and diagnostics.

Agreed it is not that useful on the front end in general.

@SupahNoob Thanks for github comment. Do you have flicd starting on reboot. I created a init.d start stop and it works randomly manually and never on reboot. I have to start the process by hand and restart hass.

Good point…I expected the flics on the UI to be clickable to take the same actions but since it isn’t why display it at all. I started trying to name them because they displayed by default. Now I need to learn how to disable the display haha For now I will keep them because it helps me know when flicd isn’t running or is having an issue.

Are you running both services on a Raspberry Pi? I read elsewhere that the Linux community seems to be moving towards running services via systemd, so I took it as an opportunity to learn the process around that. For me, I have a Linux user account called homeassistant with the flic service script in /usr/local/bin … my startup script is below, and in /etc/systemd/system

path: /etc/systemd/system/[email protected]

Description=Flic Button Service
[email protected]

ExecStart=/usr/local/bin/flicd -w -s -p 5551 -l /home/homeassistant/.homeassistant/flic_log.txt -f /home/homeassistant/.homeassistant/flic.db


Whenever you edit this file, you’ll want to run the command sudo systemctl --system daemon-reload. If you’re new to Linux or just want me to explain, I can walk through what the script above means and does, to the best of my knowledge. Run sudo systemctl enable [email protected] to enable it. This will allow you to run a command similar to sudo systemctl restart [email protected] to start, stop, restart, or get the status of the service flic.

Welcome to HomeAssistant! It seemed like you were trying to do all the hard work in implementing a home automation platform from your comment on GitHub – I was there at one point in time. HomeAssistant is fantastic. The type of component that the Flic buttons are, are binary_sensors. From what I’ve seen, sensors are not interactive, unlike the component’s like light and media_player.

You should watch this video, which helps break down a lot of things. Ben’s quirky, but his videos do a good job of explaining things.

1 Like

@SupahNoob Thanks for that solution. I’ll give that a try since all my attempts failed so far. But one question:

Is there a reason why you are not using the -d option of the flicd service which makes it run as daemon?

I am not an expert in Linux, but to my understanding… Services are run on startup, and the line that denote Restart=always and RestartSec=3 will start the process back up should it fail/error out/crash… So it should be functionally similar to a daemon anyway.

I am quite new to home assistant, but I have a system set up now, and I am trying to get this Flic service to work. I have installed it and I manage to start the service manually by typing sudo /usr/local/bin/flicd -d -l /home/homeassistant/.homeassistant/flic_log.txt -f /home/homeassistant/.homeassistant/flic.db. If I then restart the homeassistant service, the Flic buttons all appear and I can create automations with them.

My problem is that I cannot get the Flic service to launch on pi boot. When I try to add the script above by SupahNoob to systemd, the service fails with status 1/failure. Have others experienced the same issue? What am I doing wrong?