Forgot to say:
I installed the Flic App on the TvBox.
Beside the fact that it runs sideway (like if the TV set was a phone) when I try to add aFlic button, it ask for location permission (correctely):
"You location services are turned off.Android requires location services to be turned on to scan for Bluetooth devices."
"Please tunr on Location services and try again"
When you press to confirm it opens the OS setting for Location (correct) where, being a TvBox, there is only the choice "Use Wi-Fi to estimate location" or "off".
Chosing the first, does not solves the problem. The OS reports still that "no apps have requested location recently"
Unfortunately BlueZ which is otherwise the commonly used Bluetooth stack on Linux didn't provide the stability, features and responsiveness that we would like for Flic. That's why we made our own direct implementation. It will use one HCI device, so if you want to use Bluetooth for something else you can add an extra dongle. If you want to share one Bluetooth controller you can always implement the Flic 2 protocol yourself for your chosen Bluetooth stack, according to our protocol at https://github.com/50ButtonsEach/flic2-documentation/wiki/Flic-2-Protocol-Specification.
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.