I have created a TCP Client in Python that responds to button clicks from the Flic Hub. My idea was to create an Integration to HomeAssistant, but I haven't had the time to finish it. So I wanted to share the python tcp client for other people to use and improve.
Pull requests and feedback is appriciated :)
You can find the repository here
I have read the documentation of the 'Flic Hub SDK Tutorial'
I see that I can upload JS Modules with https://hubsdk.flic.io/
What is the best and easiest way to get the JS Modules on the hub. I would prefer to configure hub with our own IOS/Android App what are the possibilities? Can I save Module so that I can upload them to an other flic hub???
@antonio-mestre the net module implements just a raw TCP socket. The secure web socket protocol uses the Websocket protocol on top of the TLS protocol on top of the TCP protocol.
Right now our sdk unfortunately does not include modules for TLS (but we have https) nor Websocket, so you would have to implement that yourself if you want to use wss, using the net module in the bottom for TCP.
Hi. None of our of our official libraries do expose RSSI for Flic 2. We don't have any official react-native implementation for Flic 2 but at least on Android our Java library is open source so you can add the feature yourself if you want. But we have not heard of such a request earlier.
I know your post is old, but I've been struggling too with connecting Flic 2 and Home Assistant. Using Flicd addon didn't give a stable integration, but this is a workaround I've found was quite stable. Works only with a Flic Hub and Apple Homekit running!
In Home Assistant, set up an input boolean for single, double and hold for each Flic button. That's three input booleans for each button.
Then expose Home Assistant to Homekit via the Homekit integration. You should now be able to control Home Assistant entities in Homekit, including your new input booleans.
In the Flic app, set up your Flic button to run through Homekit
In Homekit app, set up the button to turn on the input booleans corresponding to single, double and hold press.
You can now create automations in Home Assistant, that fires when the states for your input booleans turn on. Also make an automation that turns off the input booleans again.
A foreground service should be enough (at least according to Android's official documentation). A wake lock should not be used/needed. This works perfectly fine on "original" Android devices such as Google Pixel devices. Some chinese phone manufacturers might neglect the intended behaviour for a foreground service and kills the process anyway though after some undocumented rules, unless the app is white listed or similar.
The sample application at https://github.com/50ButtonsEach/flic2lib-android-sample uses a foreground service. You can check that out.
@bashar_8383 If you get "Client EOF" in the flicd log, it simply means the client connecting to flicd has gracefully exited. I suggest you to ask the people working on home assistant for this kind of issue.
I'm looking for a similar thing - or even an API of some sort to interact with the HUB eg, send commands to trigger the actions on the hub.
I've found flichub-linux-kernel, which seems like the kernal installed to the hub, but haven't tried reverse engineering it yet.
Any docs, or any pointers on where to look? Happy to hack/reverse engineer things if the docs aren't in place.
@mattias-0 Why can't I use any of the flic/Wyze applets already posted. I have flic2 so I guess that's my answer but why can't your interface detect which type of flic is being pushed? I assume there must be a difference but I don't see anything to help me. What I'm trying to do is simply turn on/off a Wyze smart plug. When I try to create this I add "flic" from your menu of stuff to the "if". For the "this/then" part I add the "Turn on Wyze plug". Now I get asked to select "Options" NADA can't do anything. Tried using a Tagged flic whatever that means, doesn't ask for any options and I get "Finish". I click that and I get to title my applet which I did. Now I get "Can't create Applet, try again later". What the hell is going on? I should not have to worry about whether I have a flic or a flic 2 YOUR interface should be able to detect and take care of that, why should I? If you want your stuff to make it in this market you need to SIMPLIFY things. I have 38 years of programming experience. I could dig into this and probably figure it out, is that what you want the average Joe off the street with no programming experience to do? YOU WANT THIS TO BE EASY FOR ANYBODY, OTHERWISE YOU WILL NOT MAKE IT!