I’m trying to integrate a Flic Button (https://flic.io) with Home Assistant (HA). Using the Android Flic App this works by using the “Internet Request” provider and the POST method within the Flic app to set an HTTP Sensor oder HTTP Binary Sensor in HA.
A Flic Button has three Interaction: Click, Double-Click and Hold. Currently I’m using a HTTP Binary Sensor and am sending the following payload to change the stete of one HTTP Binary Sensor:
Click: {"state": "on", "attributes": {"friendly_name": "Flic"}}'
Double-Click: {"state": "off", "attributes": {"friendly_name": "Flic"}}'
Hold: (not in use yet)
I’d like to use each of the three interactions of one Flic button to toggle the sate of three different HTTP binary sensory in HA. That way a click would toggle sensor A, a double-click would toggle sensor B and hold would toggle sensor C. This makes one Flic button way more versatile.
Is there a way to toggle a HTTP Binary Sensor with just one request?
I tried something like {"state": "toggle", "attributes": {"friendly_name": "Flic"}}' but this just sets the sate to the value “toggle”.
Did you solve this?
I just got my first flic, connected to my phone and send http requests from flic app to HA.
I solved this by creating a input_boolean. this you can toggle. http://yourip/api/services/input_boolean/toggle
I didn’t solve the toggle question but I have integrated the flics now using the Flic Component, so there is no use for this workaround using HTTP requests anymore.
xydix, would you mind going through how to do this for a newcommer? I have no idea what text to put where. I have a cheap china iTag button, so the Flic Component is not an option for me, but I can send the URL, just have no idea what to do next.
Hi. Did you solve this?
Otherwise, at first create a input_boolean.
With this created you send a POST to toggle it.
Exactly wich part do you need help with?
I am very new to HA, so I don’t even know how to make an input_boolean and how to toggle it with a POST. Right now, all I have is the iTag app sending a http to http://MY_IP_ADDRESS:8123/api/states/binary_sensor.entre
When i send a HTTP my settings is:
Request URL: http://my_ip_adress:port/api/services/input_boolean/toggle?api_password=my_password
Request method: POST
Request content type: JSON
Request content: {"entity_id": = "input_boolean.name_of_the_inputbolean" }