Title is a bit vague, but I’ll try to elaborate on it.
There is this awesome open source project for bike riders to measure distance of overtaking cars to your own bike called OpenBikeSensor. I just took a short look into it, but my imagination went crazy!
My mind came up with two main topics:
Integrate it into Home Assistant with ESPHome
Integrate it into Home Assistant to transfer the recorded data into InfluxDB and make some crazy visualisations.
More on that later on.
Add more sensors
Add more sensors and record everything in your interest like:
- speed - it has a GPS
- speed - magnet on spokes and hall sensor on frame
- cadence - mount a magnet on your crank and put a hall sensor to the frame
- current gear - store the different cock sizes and with wheel rotation and crank rotation you get the gear
- height - add a barometric sensor and measure the height
- slope - we have the height and the horizontal speed, let’s calculate the slope
- …
Additional for eBikes: - battery level - just measure the voltage of the battery pack
- current draw by the motor - add a shield with a shunt resistor and get the data
- …
All this data can be great to analyze which cadence is efficient in battery usage at a given slope for example.
Having a history of current draw of the same segment over time can show you the training effort…
How to integrate with ESPHome
This is why I am asking. I haven’t taken a look into the ESPHome code so far.
I have got experience in Python programming, I did some stuff with ESP32s in Arduino sketches, did some tinkering with ESP IDF but nothing to fancy and my C++ isn’t just rusty, it’s worse than a leaky bucket made of iron.
Hence, before I dive deeper into the topics wanted to know whether it could be possible to take an existing firmware like the one of OBS and wrap it with an ESPHome custom offline sensor?
The default CustomSensors seem to have to be in the HA WiFi all the time, but the OBS sensors would be away again and again and have to import the data as batches later on…
Is there an abstraction in ESPHome to cover such a case?