Strava Home Assistant Integration

Same here - broke this morning.

I turned on debug logging and found it was failing to import HTTP_OK from /usr/src/homeassistant/homeassistant/const.py

I looked at the code and decided to remove the import and hard code the value :

/config/custom_components/ha_strava # pwd
/config/custom_components/ha_strava
/config/custom_components/ha_strava # grep HTTP_OK *py
__init__.py:HTTP_OK = "200"
__init__.py:                status=HTTP_OK, data={"hub.challenge": webhook_subscription_challenge}
__init__.py:        return Response(status=HTTP_OK)
__init__.py:        return Response(status=HTTP_OK)
config_flow.py:HTTP_OK = "200"


As well as setting the value, you need to remove the import (If the import is at the end of a list, be sure to remove the trailing comma too)

Edit :

This fix is better :slight_smile: adopts removal of hass.const.HTTP_* by thoemmi · Pull Request #36 · codingcyclist/ha_strava · GitHub

4 Likes

thanks very much for this…changes to two files were made and now working as expected

great news!

fyi, je bent van regio brugge/oostende neem ik aan? (HA’ers van de buurt, altijd leuk :slight_smile: )

Indeed, Varsenare :slight_smile:

My Strava stopped working so I deleted it and reinstalled from HACS. I’ve done a restart but now when I try to add it to integrations it is not there. I can see it in custom_components, I have changed the manifest and added the version and restarted but it still does not show up. I’m on Home Assistant 2021.12.1

Any help would be appreciated :slight_smile:

same here …

There is a PR that fixes the errors since 2021.12.0.

2 files need to be fixed for it to start working.

Look Here

Watching this as well as I’m running into the same issue of the integration not showing up.

I just tried the adopts removal of hass.const.HTTP_* by thoemmi · Pull Request #36 · codingcyclist/ha_strava · GitHub fix and it doesn’t help. I don’t see strava under available integrations. Did something new break?

Question, is there a way to pull the data which you walked from Strava on the same way we pull running, riding and swimming from Strava?

2022-02-08 03:02:03 WARNING (MainThread) [homeassistant.helpers.entity] Entity camera.strava_cam (<class 'custom_components.ha_strava.camera.UrlCam'>) implements device_state_attributes. Please report it to the custom component author.

Hope they fix this warning too :slight_smile:

has development stopped on this integration? I’ve tried all the manual fixes that guys have identified, but I can’t even get my HA to let me add in the integration, as it can’t see it

I’m getting the usual log entry that it’s an untested custom integration, but that’s about it.

have also tried this fork, which gives me the same outcome: https://github.com/madmic1314/ha_strava

if anyone has it working, can they share what they did to make it work?

I just installed the Strava integration via HACS (madmic1314’s fork) last night and have no issue with it. It throws some things in the logs but still works without issue. After installing from HACS did you add the integration from the Integrations panel?

1 Like

yep, followed it the way I would if I’d copied down any other Integration from a GitHub repo that’s not available via HACS. I’ll try again in case I missed something…

Installed via HACS showing forked repo:

HACS item after reboot:

After adding HA Strava integration in Integrations panel:
Screen Shot 2022-02-21 at 7.20.15 PM

Devices it created:

it’s working now - took a reboot and several 500 errors before it worked… got me beat what was wrong…

1 Like

If after a HA restart the integration does not load correctly and you get the “-1” entries showing up, I found that clicking on Configure and changing the Image rotation from say 15 to 25 secs and vice versa then finishing off setting it up , will bring all the sensors back after a few seconds. This works 100% of the time for me.

I have had no luck getting this to work for a while now.

I have tried both:

They both seem to load and show up under HACS but neither show up in integrations.

Any help would be appreciated.

@bj24 Just to make sure, after you install it in HACS, you still have to add the integration in the integrations panel, it won’t just appear. Are you not seeing the HA Strava integration in the list of available integrations after rebooting?

@XeoSpeed confirmed, I try to add the integration within Integrations by clicking + ADD INTEGRATION in the bottom right corner after it was added via HACS and shows up in the integrations page in HACS. I search and/or scroll through the list of integrations and Strava is not there. I have done many restarts of HA and still unable to find the integration to add.