Fitness First tells you how many people are allowed and how many are checked in

If you go to https://www.fitnessfirst.de/club/api/checkins/muenchen2, you’ll get a JSON object with max allowed and currently checked-in people at your Fitness First studio.
You just need to replace the club name with your own club and you’re good to go. Just go to your home club page with any browser, and look at the source.
Search for:
<section v-cloak class="show-club-checkin" data-club="muenchen2">
and you’ll find your club name.
For putting the data in a sensor, I use:

sensor:
- platform: rest
    name: FFLaim
    method: GET
    value_template: '{{ value_json.data }}'        
    json_attributes_path: "data"
    json_attributes:
      - "check_ins"
      - "allowed_people"
    resource: https://www.fitnessfirst.de/club/api/checkins/muenchen2

And if you want to have the occupation in %, here’s my sensor:

template:
  sensor:
    - name: belegunglaim
      state: "{{ (state_attr('sensor.fflaim', 'check_ins') / state_attr('sensor.fflaim', 'allowed_people') * 100) | round(1) }}"
1 Like

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)

  1. Visit your club’s website (e.g. https://www.fitnessfirst.de/clubs/hamburg-mitte-jungfernstieg)
  2. Open Developer Console (F12) and search for data-club below block-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).
  3. 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: "%
  1. 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

Remember to change data-club id in API url and name according to your FF club.

3 Likes

Thanks for sharing, this is super helpful! I have modified the sensor a little to enrich the attributes with today’s opening hours

Sensor:

command_line:
  - sensor:
      name: FF_Mannheim_Checkins
      command: "curl -s https://www.fitnessfirst.de/club/api/checkins/1272859330 | jq '{ percentage: ((.data.items[] | select(.isCurrent == true) | .percentage ) // 0), startTime: .data.startTime, endTime: .data.endTime }'"
      unit_of_measurement: "%"
      icon: mdi:dumbbell
      value_template: "{{ value_json.percentage }}"
      json_attributes:
        - startTime
        - endTime
      scan_interval: 300

Dashboard:

  - type: conditional
    conditions:
      - condition: state
        entity: sensor.ff_mannheim_checkins
        state_not: '0'
    card:
      type: tile
      entity: sensor.ff_mannheim_checkins
      state_content:
        - state
        - startTime
        - endTime
      name: Fitness First Mannheim
2 Likes