Hi @Bernhard-h,
thanks for posting this helpful FF Sensor.
I want to update this post, as the API has changed a couple of weeks ago.
Steps to add custom sensor: (e.g. Hamburg Jungfernstieg)
- Visit your club’s website (e.g. https://www.fitnessfirst.de/clubs/hamburg-mitte-jungfernstieg)
- Open Developer Console (F12) and search for
data-clubbelowblock-clubcheckinsblock. You’ll need to copy that number from data-club (e.g. 1376532610)
Alternatively, reload the page with open network tab and you should see a request with a number (e.g. 1376532610). - Create your custom sensor (e.g. in configuration.yaml) with the following yaml:
command_line:
- sensor:
name: FF_HH_Jungfernstieg_Checkins
command: 'curl -s https://www.fitnessfirst.de/club/api/checkins/1376532610 | jq -r "if any(.data.items[]; .isCurrent == true) then .data.items[] | select(.isCurrent == true).percentage else 0 end"'
unit_of_measurement: "%
- Create a card with e.g.:
type: gauge
name: FitnessFirst HH Jungfernstieg
unit: '%'
entity: sensor.ff_hh_jungfernstieg_checkins
severity:
green: 0
yellow: 45
red: 85