Trappers.net REST sensor

Hi,

Just wanted to share a simple RESTful sensor in case someone else is looking for the same thing.

My employer allows us to collect points whenever we bike to work. This is tracked via an RFID chip that you put in your bike wheel and sensors on the bike shed’s entrance.

The points are tracked on trappers.net and can then be spent in their shop.

Here’s how you configure a sensor to fetch the points-balance in home assistant.

In my case I use it for a progress bar that tracks towards a certain goal:

Hope it’s useful!

3 Likes

I’ve updated the gist to include a sensor that fetches the last logged date that you biked to work.

The balance sensor gets an extra attribute with the bearer token and we then re-use that in the 2nd sensor which posts to the endpoint which has the event log, where we fetch the last logged date.

Two important things to note:

  1. I’ve re-named the sensor to sensor.trappers_balance
  2. Both sensors need to have a “desynced” scan-interval as running them as exactly the same time causes a lot of confusion as the token is invalid on the next sensor-update. :slight_smile: