Cowboy bike support

Hi,

I am looking for an integration with Cowboy bikes. https://cowboy.com/
More specifically, i would like to monitor the battery of the bike, as well as the location.

During my search, i found this guy that already did some scripting against their API:
https://github.com/samueldumont/cowboybike-strava-sync

Some of their unofficial docs:
https://cowboybike.readthedocs.io/en/master/api-usage/

I am a bit more familiar with powershell, and i managed to pull out some data, but i have no idea how to get started in python, let alone integrating this in home-assistant :slight_smile:

Screenshot for your reference:

Thanks in advance!
D.

#replytoself

I found an existing custom integration for the cowboy bike:
https://gitlab.com/samueldumont/cowboy-ha

@samueldumont thanks for this, I was not aware you where on this forum as well :wink:

After I manually added a manifest.json to the custom_component/cowboy/ folder everything started working

{
  "domain": "cowboy",
  "name": "cowboy",
  "documentation": "https://gitlab.com/samueldumont/cowboy-ha",
  "dependencies": [],
  "codeowners": ["@samueldumont"],
  "requirements": [
     "cowboybike"
  ],
  "version": "0.0.5"
}

2 Likes

hey @davidvf , cool nice to see that it was useful to you ! I did not maintain it but if this works out of the box, i’ll create the manifest so it’s easier for other people !

1 Like

I only think there is some protection on the Cowboy API, after a while you get a lot of denied in the logs.

I tried to get this working… via Terminal cloned the repo; renamed to “cowboy” and added credentials in configuration.yaml (and also added the manifest.json). But when trying to restart, I get an error, stating “The system cannot restart because the configuration is not valid: Integration error: cowboy - Integration ‘cowboy’ not found.

Hi, I had the same issue but found a solution:

First: if you did like me and copy/paste the example configuration.yaml, you will find that it isn’t always correctly formatted: in this case it had an extra space before the username and password entry.

try:
configuration.yaml

cowboy:
  username: your_cowboy_username
  password: your_cowboy_password

the other thing i ran into is that HA didn’t install the requirement cowboybike. So you might want to install that by:

pip install cowboybike

After a restart i now have my Cowboy stats running on my HA dashboard.

Hi,
I performed the actions mentioned above, but wasn’t able to add it.
the pip install cowboybike did succeed, but when I add the yaml part and verify the yaml via developer, it keeps spinning and doesn’t give a message the yaml is valid.

When I ignore it, and restart my HA anyway, I don’t see the bike coming available.
No specific errors in the logs, besides this one, which i guess is normal :

2023-03-03 16:49:42.993 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration cowboy which has not been tested by Home Assistant.

You might need to restart after adding the cowboy folder, but before adding the lines the configuration.yaml. After home assistant has restarted, add the lines to configuration.yaml. Now it might be recognized and let you restart.
See also similar problem in this post: Custom component not found by configuration.yaml - #6 by ardysusilo
You will not get an Integration card in Settings, but you will get entities that start with bike.*.

Hello everyone, I pulled directory as mentioned, renamed it to cowboy
Added the manifest.json
Restarted, and then, added my credentials to .yaml.
But nothing pops after a restart :frowning:

Unsatisfied with the status quo, I spent the last day building a custom integration, you can find it here: GitHub - elsbrock/cowboy-ha: 🤠 Custom Home Assistant Integration for Cowboy Bikes 🚴

5 Likes

Can confirm that this just works amazingly. Huge thanks for sharing this!

@else many thanks! works great with the Cowboy 3

@else I’m having a hard time finding you cowboy integration in HACS. It doesn’t show up when searching for “cowboy”.

Any ideas?

Did you add it as custom repository?

I did! But I forgot a letter when copying. My bad :see_no_evil: Thank you for the quick help!