Hubitat Integration for Home Assistant: how to update the API key?

I’m happily using GitHub - jason0x43/hacs-hubitat: A Hubitat integration for Home Assistant but want to make some configuration changes to the already-integrated-hub (change my API key). I’m having the hardest time figuring out where I go edit the existing configuration, either through the HA interface or through whatever config file has the details.

I know this is dumb, but can someone please point me in the right direction? Best case there’s a UI in HA where I can go “edit my config” and see, then change, things like my MakerAPI app ID, secret key, etc. @jason0x43 if you have the easy answer I’d be greatful.

Thx

You don’t see a “configure” button?

E.g.

Hmmmm… I’m on mobile so maybe I’m missing something but generally yes, I see a config button the the whole custom integration it simply doesn’t have the fields I care about (eg makerapi app id and secret_key)

You’re pointing out a config menu for a single integrated device, no?


Currently all the unique device and entity IDs are tied to the API key, so the key can’t be (easily) changed. I’ve had an issue open for quite some time to fix this, but it hasn’t been a high priority.

You could update it manually by shutting down HA and updating all the occurrences of the hub access token (the full thing and just the first part) in core.config_entries, core.device_registry, and core.entity_registry in your HA config.

There they are!! I simply didn’t know where things were stored so seeing the filenames makes it perfectly understandable now! The unlocker for me was looking for the filenames you just quoted that live in the HA local .storage/ folder (<- hidden with a dot for those on cmdline).

thx!

Can you maybe help point me in the right direction to learn how to make this manual change? My hubitat integration is all hosed ATM.

You’d need to shut down HA and then navigate to config/.storage in your HA distribution and update those three files.

If you’re running full HA OS, you’ll want to use the SSH & Web Terminal add on. Install it, then configure it so that you can ssh into HA from another machine. Ssh in and run ha core stop to shut down HA (the SSH add-on will keep running). Cd to config/.storage and use vi or nano to edit core.config_entries. Note the first chunk of your Hubitat entry’s current access_token value and save it somewhere. Update the access token to the new value and save the file. Also note the first chunk of the new access token. For example, if your access token is “abc123de-5cad-48f1-99b3-9b4bf6c6b80e”, then the first chunk is “abc123de”. We’ll call the first chunk of an access token the “token ID”.

Edit core.device_registry and core.entity_registry and replace all occurrences of the old token ID with the new token ID. If you have a lot of devices you could use sed. Assuming the old token ID was “abc123de” and the new token ID was “def234ab”, you could do:

sed -i.bak 's/abc123de/def234ab/g' core.device_registry core.entity_registry

Note that this would replace any instances of abc123de, so if that string came up somewhere that wasn’t Hubitat related (unlikely), it would cause problems. The -i.bak option saves backups, just in case.