MySmartBike (Mahle powered e-bikes) integration for Home-Assistant

Hi Home-Assistant User Group,

after focussing a few years on Mercedes cars, here a new integration for MySmartBike (Mahle). It’s an early version as always.

Github-repo: GitHub - ReneNulschDE/ha-mysmartbike: Custom Component to integrate MySmartBike (Mahle) data into Home Assistant

tl;dr: Sensor for State of charge and a device tracker for Mahle powered e-bikes

Happy to get your feedback!

BR
Rene

Readme:

MySmartBike (Mahle powered e-bikes) integration for Home-Assistant.

HassFest tests

MySmartBike (Mahle powered e-bikes) platform as a Custom Component for Home Assistant.

:warning: This component is in an very early state and tested with an Schindelhauer Arthur IX only.

IMPORTANT:

  • Please login once in the MySmartBike IOS or Android app before you install this component. Make sure you connected your bike(s) in the app
  • Tested Countries: DE

Features:

  • Connect to MySmartBike Cloud and collect registered devices
  • Create sensors and device tracker for the found devices

Installation

Manual installation

  • This is a Home Assistant custom component (not an Add-in).
  • Download the folder custom_component and copy it into your Home-Assistant config folder.
  • How to install a custom component?
  • Restart HA, Refresh your HA Browser window

HACS

Configuration

Use the “Add Integration” in Home Assistant and select “MySmartBike” and follow the following steps:

  1. Put in your MySmartBike email address and password in the component setup.

Sensors

  • State of charge (Percent, 0-100)
  • Odometer (in meters) - Conversation is WIP

Diagnostic Sensors

Diagnostic sensors are hidden by default, check the devices page to see the current values

  • None

Services

  • None

Switches

  • None

Logging

Set the logging to debug with the following settings in case of problems.

logger:
  default: warn
  logs:
    custom_components.mysmartbike: debug

Open Items

  • List is too long as we are on version 0.0.1

Useful links

Trademark Legal Notices

All product names, trademarks and registered trademarks in this repository, are property of their respective owners and are used by this project for identification purposes only.

The use of these names, trademarks and brands appearing do not imply endorsement.

hi, i have hibrid 101 eu. i have log in your integration, login ok ebike star and watch in app but in HA 0 SENSOR. WHY?

Hi,

please enable the debug logging on the integration page.

Reload the integration

wait 1min and disable the debug-log. Check the file for errors (lines with custom_components.mysmartbike).

Has anyone thought of being able to connect to the bike directly with bluetooth? I really want a method that can switch on and off charging on the ebike, if charge >95% then switch off. Has anybody done anything like that, communicating directly with bike using bluetooth?

I’m not aware of such solution. The bike can connect to one bt module only (AFAIK) and this would mean that when you ride the bike your mobile phone needs to reconnect first before you can use the bike/phone connection.

As long as the phone is the range of the bike, you can build an automation that stops the charging via a smart power plug. This component is refreshing the data every 5min by default.

1 Like

I would really like to use your integration. I added them via HACS. However, when adding a new integration from MySmartBike across devices, I cannot log in. It always shows me the message “Authentication failed. Check that your email address and password are correct.” I have also changed the password several times. Does anyone have an idea how I can track down the error?

Hi @R3gan ,

First, please try to login with the same credentials on the website www.mysmartbike.com. If this works, please enable the debug-log. Check the home-assistant-log for errors and share it here.

Best
Rene

Many thanks for your response! Apparently you have to wait a few hours after changing your password. Now the error message no longer appears. However, it still doesn’t add the integration. I also tried adding it while connected to the bike.

image

I can log in via the browser. Unfortunately I cannot activate the debug log if the integration is not added.

Please take a look on the readme and search for Logging. There you can find a configuration.yaml entry to enable the debug log…

Hi Rene many thanks for your integration. Installation and access to mysmartbike cloud worked from the start and connection is stable. Could you also add an entity for the remaining km supported by battery. The odometer seem to show the total km of the bike,
Thx
Andreas

Hi Andreas, welcome to the club. Sure, let me check what the Mahle API provides. BR Rene

Hi Andreas,

I have published a new version v0.4.0. The version contains a new sensor remaining_capacity (in km).

BR
Rene

1 Like

Hi Rene,

thanks for your quick response and implementation. Just updated the integration and added the new sensor. I need to check on the data as information received from the API are questionable - currently it shows 242km (I would be happy…) however in the Mahle App its 58km which seem to be more realistic. I’ll monitor in the coming weeks…

BR
Andreas

Hi,

you are right. this is the remaining capacity in “W” and not “km”. I will change it.

BR
Rene