angelnu / home_assistant_thethingsnetwork

TheThingsNetwork v3 integration for Home Assistant
33 stars 8 forks source link

Errors after install #3

Closed brynnneilson closed 5 months ago

brynnneilson commented 2 years ago

I've probably done something wrong. Here's what I did:

  1. New install of HA
  2. Enable persistent storage in TTN
  3. Installed TTN under custom_components
  4. Added TTN under Intergations with my TTN Server, App ID and API Key

The API Key might be where I'm going wrong because the V3 TTN Inegration asks for "Access Key" which used to be used in V2 TTN integrations.

Appreciate any advice. Below are the errors I'm getting in HA

brynn :-)

 [{'@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails', 'namespace': 'pkg/auth', 'name': 'token', 'message_format': 'invalid token', 'correlation_id': '98c1bf4f5f4f43fb87624a76b6f3e85f', 'code': 3}]}}
2022-02-15 08:12:12 ERROR (MainThread) [custom_components.thethingsnetwork] TTN entry without result: {'error': {'grpc_code': 3, 'http_code': 400, 'message': 'error:pkg/errors:validation (invalid `application_ids`: embedded message failed validation)', 'http_status': 'Bad Request', 'details': [{'@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails', 'namespace': 'pkg/errors', 'name': 'validation', 'message_format': 'invalid `{field}`: {reason}', 'attributes': {'field': 'application_ids', 'name': 'GetStoredApplicationUpRequestValidationError', 'reason': 'embedded message failed validation'}, 'correlation_id': 'e073560343c043c48804800f4cc89a12', 'cause': {'namespace': 'pkg/errors', 'name': 'validation', 'message_format': 'invalid `{field}`: {reason}', 'attributes': {'field': 'application_id', 'name': 'ApplicationIdentifiersValidationError', 'reason': 'value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$"'}, 'correlation_id': '2df80c75088048ea819899ad8c2c256f', 'code': 3}, 'code': 3}]}}
angelnu commented 2 years ago

the reason might be that the adapter is currently hard-coded to use the EU TTN endpoint: https://github.com/angelnu/home_assistant_thethingsnetwork/blob/74806b8e9d06c3fcfd5caab0d136ef98a4233aae/custom_components/thethingsnetwork/const.py#L16

I would need to add a selector to the wizard - could you try to fork the adapter and manually modify it for now?

If it works I will work in adding the selection.

brynnneilson commented 2 years ago

It worked. I changed "eu1.cloud.thethings.network" to "au1.cloud.thethings.network" then when I added it as an Integration I used my App ID: silo-environment and Access Key [API Key]

angelnu commented 5 months ago

This custom integration is deprecated as it has been integrated into the core HA since 2024.6.

Please migrate.