Error while setting up coinbase platform for sensor
The problem
When adding a wallet balance in the coinbase integration the wallet is not added. This occurs regardless of which wallet is chosen. Exchange rates do work correctly.
What version of Home Assistant Core has the issue?
core-2024.9.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Coinbase
Link to integration documentation on our website
https://www.home-assistant.io/integrations/coinbase
Diagnostics information
home-assistant_coinbase_2024-09-17T08-59-18.117Z.log
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Attempting to set up EUR account sensor with v3 API
2024-09-17 12:11:47.284 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up coinbase platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/src/homeassistant/homeassistant/components/coinbase/sensor.py", line 88, in async_setup_entry
entities.append(AccountSensor(instance, currency))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/coinbase/sensor.py", line 130, in __init__
float(account[API_ACCOUNT_AMOUNT])
ValueError: could not convert string to float: '0.00515969893.71772555'
Additional information
No response
Hey there @tombrien, mind taking a look at this issue as it has been labeled with an integration (coinbase) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of coinbase can trigger bot actions by commenting:
-
@home-assistant closeCloses the issue. -
@home-assistant rename Awesome new titleRenames the issue. -
@home-assistant reopenReopen the issue. -
@home-assistant unassign coinbaseRemoves the current integration label and assignees on the issue, add the integration domain after the command. -
@home-assistant add-label needs-more-informationAdd a label (needs-more-information, problem in dependency, problem in custom component) to the issue. -
@home-assistant remove-label needs-more-informationRemove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
(message by CodeOwnersMention)
coinbase documentation coinbase source (message by IssueLinks)
I also get an error when trying to set up the integration. "API credentials rejected by Coinbase due to an invalid API key." (Translated with Deepl)
@JustAmply It looks like you're not using the correct API credentials. Please make sure you're running the latest version of Home Assistant as support for v3 API credentials was added recently. Full instructions can be found here.
@pgomersbach I can't reproduce this with either crypto to fiat wallets. The output looks like the Coinbase API messed up which happens more often than it should.
@JustAmply It looks like you're not using the correct API credentials. Please make sure you're running the latest version of Home Assistant as support for v3 API credentials was added recently. Full instructions can be found here.
You are right, the API credentials i was given by Coinbase were faulty.
The API key somehow was in the format cdp_XXXXXXXXXX instead of organizations/XXXXX/apiKeys/XXXXX.
After regenerating them it works, thanks Tom!
API key was in the format cdp_XXXXXXXXXX instead of organizations/XXXXX/apiKeys/XXXXX. Thanks, solved!