Hi,
I am trying to get battery life information out from the FLIC http restfull call.
I have setup everything and the functionality is very nice. BUT… I cannot get the last informationer out from the restfull api.
My working setup:
- Flic 2 buttons connected to a FLIC HUB 2
- The hub is configured to send a HTTP post on http://HA_IP:8123/api/events/flick_clic
- In HA I have an automation triggering on this event. All is nice except I cannot see the battery level on the flic buttons.
I know the information is in the header of the http post from the flic hub because, as a test, I have setup a python webserver to listen to the event. The header shows up like this:
10.0.0.99 - - [31/Jan/2021 21:50:02] "GET /favicon.ico HTTP/1.1" 200 -
INFO:root:POST request,
Path: /api/events/test
Headers:
Accept-Encoding: gzip
Authorization: Bearer --censored---
User-Agent: Google-HTTP-Java-Client/1.23.0 (gzip)
button-serial-number: censored
**button-battery-level: 100**
**button-name: Test**
timestamp: 2021-01-31T20:50:10Z
Content-Type: json
Cache-Control: no-cache
Pragma: no-cache
Host: 10.0.0.99:8080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: close
Content-Length: 49
As seen above I know the information gets to the HA but I cannot see anywhere in the documentation how to get the header information out from an event that is just waited for.
I cannot see any solution to this but installation a python webserver that translates this into the body of the post request before it hits the HA. Can I write at script, command or something else to get to this information from the HA?