Possible to install - ha-carson-living

Generally new to the platform but have been running Home Assistant OS under Proxmox which has been a great experience. I’ve been trying to add a custom camera feed from apartment building front door (in NYC and dealing with constant package theft with a very unresponsive build board is not great). The building uses an app called Carson Living which lets you have some basic functions (door buzz, access to camera feed, etc) but is a pretty terrible UI and not very responsive.

I discovered that someone else has already created an integration (GitHub - rado0x54/ha-carson-living: Home Assistant Component for Carson Living) but I’m having trouble figuring out how to get it installed with my existing setup. HACs custom repo allows me to add the integration but when I add the required login details to config.yaml it complains that Carson is not an installed integration. Very aware this is an issue with lack of knowledge on my part. Looking through the repo it looks like there are several dependencies (https://github.com/rado0x54/ha-carson-living/blob/b3be3f9608b60e4023829f7f055719f1c13cbcd8/requirements_tests.txt) so I’m sure this is also part of the problem. The integration looks a bit dated but the API version it uses with Carson is still the same so I’m sure the integration would function. Ideal world I can get this working with my existing install but I’m not sure if HAOS would allow it or if I would need to create a secondary HA install just to run this and possibly link it with the Remote-HomeAssistant component.

Large ask for a first time poster but very happy to finally join the community that has made this much possible so far. Looking forward to digging in and contributing as well.

You need to add the integration to HA, then restart HA so it can be loaded. Only then can you configure it.

Thanks @Tinkerer
I had tried that but still no luck until I saw that the manifest.json was missing a version number which blocked it. I updated that and now it’s loading which is great.

Next issue is I hit this error - it does seem to be much further along though! Could someone point me in the right direction? I believe I need to update the auth.py, specifically modify:

self._token_payload = jwt.decode(token, verify=False)

and update it to this:

self._token_payload = jwt.decode(token, algorithms=["ES256"], verify=False)

But I’m not sure if that’s possible.

Logger: custom_components.carson.config_flow
Source: custom_components/carson/config_flow.py:33 
Integration: Carson 
First occurred: 4:12:32 PM (5 occurrences) 
Last logged: 4:36:20 PM

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/carson_living/auth.py", line 105, in token
    self._token_payload = jwt.decode(token, verify=False)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jwt/api_jwt.py", line 210, in decode
    decoded = self.decode_complete(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jwt/api_jwt.py", line 147, in decode_complete
    raise DecodeError(
jwt.exceptions.DecodeError: It is required that you pass in a value for the "algorithms" argument when calling decode().

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/carson/config_flow.py", line 56, in async_step_user
    token = await validate_input(self.hass, user_input)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/carson/config_flow.py", line 33, in validate_input
    await hass.async_add_executor_job(auth.update_token)
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/carson_living/auth.py", line 137, in update_token
    self.token = data.get('token')
    ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/carson_living/auth.py", line 115, in token
    raise CarsonTokenError('Cannot decode invalid token {}'
carson_living.error.CarsonTokenError: Cannot decode invalid token xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Just wanted to close this loop. I did some digging and the integration was dependent on PyJWT. It turns out that the verify=False parameter was depreciated versions ago… so it makes sense why this wasn’t working. I updated the parameter and now all is well!

Anyway - thanks for being a great community and look forward to diving in!

1 Like

@justanz I am also trying to integrate that repo. Do you mind sharing the updated code?

Hi there.

To get this to work, you need to update line 105 in the auth.py file to read as follows:
self._token_payload = jwt.decode(token, options={"verify_signature": False})

All should work after that!