{"id":15683434,"url":"https://github.com/compatech/stromer","last_synced_at":"2025-05-07T13:03:44.495Z","repository":{"id":41855344,"uuid":"468666097","full_name":"CoMPaTech/stromer","owner":"CoMPaTech","description":"Stromer custom_component for Home Assistant","archived":false,"fork":false,"pushed_at":"2025-05-05T10:25:47.000Z","size":244,"stargazers_count":20,"open_issues_count":6,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T13:03:31.113Z","etag":null,"topics":["e-bike","ebike","hacs","hacs-integration","home-assistant","home-automation","homeassistant","pedelec","stromer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CoMPaTech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-11T08:20:30.000Z","updated_at":"2025-05-05T10:25:49.000Z","dependencies_parsed_at":"2022-08-11T19:31:32.218Z","dependency_job_id":"36705c17-428e-4e0b-aba1-b0bda18664eb","html_url":"https://github.com/CoMPaTech/stromer","commit_stats":null,"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoMPaTech%2Fstromer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoMPaTech%2Fstromer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoMPaTech%2Fstromer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoMPaTech%2Fstromer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoMPaTech","download_url":"https://codeload.github.com/CoMPaTech/stromer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883227,"owners_count":21819158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["e-bike","ebike","hacs","hacs-integration","home-assistant","home-automation","homeassistant","pedelec","stromer"],"created_at":"2024-10-03T17:05:21.964Z","updated_at":"2025-05-07T13:03:44.472Z","avatar_url":"https://github.com/CoMPaTech.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stromer Custom Component for Home Assistant\n\n**:warning::warning::warning:Read the [release notes](https://github.com/CoMPaTech/stromer/releases) before upgrading, in case there are BREAKING changes!:warning::warning::warning:**\n\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/CoMPaTech/stomer/)\n[![CodeFactor](https://www.codefactor.io/repository/github/CoMPaTech/stromer/badge)](https://www.codefactor.io/repository/github/CoMPaTech/stromer)\n[![HASSfest](https://github.com/CoMPaTech/stromer/workflows/Validate%20with%20hassfest/badge.svg)](https://github.com/CoMPaTech/stromer/actions)\n[![Generic badge](https://img.shields.io/github/v/release/CoMPaTech/stromer)](https://github.com/CoMPaTech/stromer)\n\n[![CodeRabbit.ai is Awesome](https://img.shields.io/badge/AI-orange?label=CodeRabbit\u0026color=orange\u0026link=https%3A%2F%2Fcoderabbit.ai)](https://coderabbit.ai)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=CoMPaTech_stromer\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=CoMPaTech_stromer)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=CoMPaTech_stromer\u0026metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=CoMPaTech_stromer)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=CoMPaTech_stromer\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=CoMPaTech_stromer)\n\n## Requirements\n\nA Stromer bike that has \"Mobile phone network\" connectivity. This *excludes* the standard ST1 without the \"Upgrade\" (see [Stromer Connectivity](https://www.stromerbike.com/en/swiss-technology-connectivity-omni)). ST2, ST3, ST5 and ST7 come standard with the required connectivity.\n\n## Installation\n\n[![Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=CoMPaTech\u0026repository=stromer\u0026category=integrations)\n\n## Configuration\n\nConfigure this integration the usual way, before starting you will need to retrieve your\n\n- [ ] Client ID\n- [x] Client Secret `*) only if you already have this or require APIv3`\n\nFor the API using a tool like MITM-proxy so you can intercept traffic between the app on your phone and the Stromer API.\n\nAdditional the setup flow will ask you for your username (i.e. e-mail address) and password for the Stromer API and the secrets retrieved through MITM-proxy.\n\n## What it provides\n\nIn the current state it retrieves `bike`, `status` and `position` from the API every 10 minutes.\n\nThere is an early implementation on toggling data on your bike, `light` and `lock` can be adjusted.\nDo note that the switches do not immediately reflect the status (i.e. they will when you toggle them, but switch back quickly).\nAfter your 'switch' command we do request an API update to check on the status, pending that update the switch might toggle back-n-forth some time.\nThe light-switch is called 'Light mode' as depending on your bike type it will switch on/off or between 'dim and bright'.\n\nAs with the `switch` implementation a `button` is added to reset your trip_data.\n\nMulti-bike support (see #81 / #82 for details and progress). The config-flow will now detect if you have one or multiple bikes. If you have one, you can only select it (obviously). When multiple bikes are in the same account, repeat the 'add integration' for each bike, selecting the other bike(s) on each iteration.\n\n## If you want more frequent updates\n\nBasically you'll have to trigger (through automations) the updates yourself. But it's the correct way to learn Home Assistant and the method shown below also saves some API calls to Stromer. Basically this will determine if the bike is **unlocked** and if so start frequent updates. The example will also show you how to add a button to immediately start the more frequent updates. And yes, I'm aware we can make blueprints of this, but I'll leave that for now until we have a broader user base and properly tested integration.\n\n- [![Open your helpers.](https://my.home-assistant.io/badges/helpers.svg)](https://my.home-assistant.io/redirect/helpers/)\n- Create a `switch` (i.e. input-boolean) named `Stromer Frequent Updates` (i.e. becoming `input_boolean.stromer_frequent_updates`. Feel free to name it otherwise, but this is what will be referred to below.\n\n- [![Open your automations.](https://my.home-assistant.io/badges/automations.svg)](https://my.home-assistant.io/redirect/automations/)\n- Create a new automation, click on the right-top three dots and select 'Edit as YAML'. Don't worry, most of it you will be able to use the visual editor for, it's just that pasting is much easier this way. Do note that you'll have to change the `stromer` part of the bike (or after pasting, select the three dots, go back to visual editor and pick the correct entity).\n\n```automation.yml\nalias: Stromer cancel updates when locked\ndescription: ''\ntrigger:\n  - platform: state\n    entity_id: binary_sensor.stromer_bike_lock\n    to: 'on'\n  - platform: template\n    value_template: \u003e-\n      {{ now().timestamp() - as_timestamp(states.sensor.stromer_last_status_push.state) \u003e 600 }}\ncondition: []\naction:\n  - service: homeassistant.turn_off\n    data: {}\n    target:\n      entity_id: input_boolean.stromer_frequent_updates\nmode: single\n```\n\n- Create another automation, same process as above\n\n```automation.yml\nalias: Stromer start updates when unlocked\ndescription: ''\ntrigger:\n  - platform: state\n    entity_id: binary_sensor.stromer_bike_lock\n    to: 'off'\n  - platform: template\n    value_template: \u003e-\n      {{ now().timestamp() - as_timestamp(states.sensor.stromer_last_status_push.state) \u003e 600 }}\ncondition: []\naction:\n  - service: homeassistant.turn_on\n    data: {}\n    target:\n      entity_id: input_boolean.stromer_frequent_updates\nmode: single\n```\n\n- And the final one, actually calling the updates (example every 30 seconds). We'll only point to speed, but it will update the other sensors\n\n```automation.yml\nalias: Stromer update sensors\ndescription: ''\ntrigger:\n  - platform: time_pattern\n    seconds: /30\ncondition:\n  - condition: state\n    entity_id: input_boolean.stromer_frequent_updates\n    state: 'on'\naction:\n  - service: homeassistant.update_entity\n    data: {}\n    target:\n      entity_id: sensor.stromer_speed\nmode: single\n```\n\n- Final step is adding a button to your dashboard if you want to trigger updates right now. Do note that your bike must be **unlocked** before triggering, otherwise it will 'cancel itself' :) In a dashboard, click the three buttons right top, and add a `button`-card, through `view code editor` paste, switch back to visual editor and customize the below to your taste. Again pointing at speed but it will refresh if the bike is unlocked and trigger the updates helper.\n\n```lovelace.yml\nshow_name: true\nshow_icon: true\ntype: button\ntap_action:\n  action: call-service\n  service: homeassistant.update_entity\n  service_data: {}\n  target:\n    entity_id: sensor.stromer_speed\nentity: ''\nhold_action:\n  action: none\nname: Start Stromer updates\nicon: mdi:bike\nshow_state: false\n```\n\n## State: BETA\n\nEven though available does not mean it's stable yet, the HA part is solid but the class used to interact with the API is in need of improvement (e.g. better overall handling). This might also warrant having the class available as a module from pypi.\n\n## What does it support?\n\n- Location\n  - It inherits zones, but you could also plot your location on a map\n- Sensors\n  - Like motor and battery temperature\n- Binary Sensors\n  - Light-status and Omni-lock status and theft status\n\n## How to install?\n\n- Use [HACS](https://hacs.xyz)\n- Navigate to the `Integrations` page and use the three-dots icon on the top right to add a custom repository.\n- Use the link to this page as the URL and select 'Integrations' as the category.\n- Look for `Stromer` in `Integrations` and install it!\n\n### How to add the integration to HA Core\n\nFor each bike (i.e. api-user) you will have to add it as an integration. Do note that you first have to retrieve your client ID and Secret using some tool like [mitmproxy](https://mitmproxy.org) to fetch these. If you don't know how to do this or what this implies; search from someone who can eloborate on this or do not use this integration. For more details and/or helpful users see [the Dutch Stromer forum](https://www.speedpedelecreview.com/forum/viewtopic.php?f=8\u0026t=1445)\n\n- [ ] In Home Assistant click on `Configuration`\n- [ ] Click on `Integrations`\n- [ ] Hit the `+` button in the right lower corner\n- [ ] Search or browse for 'Stromer e-bike' and click it\n- [ ] Enter your e-mail address, password and the client ID and Secret\n\n## Frequently Asked Questions (FAQ)\n\n### I don't like the name of the sensor or the icon\n\nYou can adjust these in `Configuration`, `Integration` -\u003e `Entities` (e.g. `https://{Your HA address}/config/entities`)\n\nJust click on the device and adjust accordingly!\n\nPlease note that you can also click the cogwheel right top corner to rename all entities of a device at once.\n\n### It doesn't work\n\nI'm on Discord and used to frequent the Dutch Stromer forum more often, but feel free to add a Bug through the Issues tab on [Github](https://github.com/CoMPaTech/stromer).\n\n### Is it tested?\n\nIt works on my bike and Home Assistant installation :) Let me know if it works on yours!\n\n[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-black.svg)](https://sonarcloud.io/summary/new_code?id=CoMPaTech_stromer)\n\nAnd [Home-Assistant Hassfest](https://github.com/home-assistant/actions) and [HACS validation](https://github.com/hacs/action)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompatech%2Fstromer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompatech%2Fstromer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompatech%2Fstromer/lists"}