Closed HansPeterDurand closed 3 months ago
Hi @HansPeterDurand . Did you enable the storage API in TheThingsNetwork? This might be the problem.
Btw: I am working towards submitting this code into the Home Assustant core code to replace the broken v2 there. I am thinking about checking if the storage api is set.
Good morning Angel,
Thank you for your hint. I checked the configuration. Storage has been configured (see attachment).
In addition I created a new API Key an registered the application "ms24-letterbox".
As a result i got a success message:
So far so good. On Home Assistant I still get this message (no devices or entities).
Interesting aspect: Having a look into the "Protokoll" I see no entry (last timestamp: 09:09:13 from another integration)!
Seems that, I came a step further?
regards
Hans Peter
@HansPeterDurand if you do not see errors in the integration logs then there are 2 things to check next:
decoded_payload
entry? Each value in it will get added as home assistant entityHello Angel, I had a look at the logs and couldn't find an unlink message. Up to know I can say that the Device as well as the gateway work as they should do (see below)
I'll check the configuration with a colleague that has an almost similar configuration.
Regards Hans Peter
uplinks are what is needed (typo in my reply) and you seem to have plenty. But do you have payload formarters?
This is how the decode_payload
looks in one of my uploads:
Hello Angel here i am again :-)
Up to now i havent defined any payload formater. So i choose the "Custom Javascript Formater". I copie the payload from the last message (see attachment)
You see the result below. In the message I see that the gateway id ist "test". Strange...
{ "f_port": 1, "frm_payload": "DkZ//wAAAP////8=", "decoded_payload": { "bytes": [ 14, 70, 127, 255, 0, 0, 0, 255, 255, 255, 255 ] }, "rx_metadata": [ { "gateway_ids": { "gateway_id": "test" }, "rssi": 42, "channel_rssi": 42, "snr": 4.2 } ], "settings": { "data_rate": { "lora": { "bandwidth": 125000, "spreading_factor": 7 } }, "frequency": "868000000" } }
The gateway test
comes from testing the payload formater
But at least you should get an entity in home assistant called bytes with the values being the array - not very useful yet but at least it would show that the integration is working.
For getting more useful values you will need a decoder matching your device. You have more information in this page: https://www.thethingsindustries.com/docs/integrations/payload-formatters/ I personally build my own devices so I use the Cayenne format but each TTN vendor can decide its own format.
Hi Angel, In the meantime, I have discussed my problem with my colleague. We will compare and document our installation in the coming days. I have looked at the topic of decoders (the sensor is from Dragino, type SN50v3-LB/LS). The supplier has linked a decoder file in his description (https://github.com/dragino/dragino-end-node-decoder/tree/main/SN50_v3-LB). I downloaded this file and used it as "Custom Javascript Formatter". When configuring the sensor, I selected "Use Device Repository Formatters". The result is that the live data is now output in formatted form. That looks better now. It now looks better on the Home Assistant page. Now one device and 10 entities are visible! As far as I can tell, thanks to your help, I have made a big step forward. Unfortunately I have to stop now, I still have a few other things to do. I will document the final situation.
Thanks again!
Translated with DeepL.com (free version)
Jep, thislooks right. So let us close this for now.
Please notice that I added some words about the decoders to the documentation PRr at https://github.com/home-assistant/home-assistant.io/pull/31930 but as this part was too implicit before
Good afternoon, I managed to installHome Assistant wir Zigbee and various other Integrations. Actually i am working on the TTN intergation. Gateway and sensor work (up to now finde). I also managed to install the new "The Tings Network" Integration. So far so good(or not). On the things network console i create an API Key, that will be used for the registartion. In HA I used as requestet the created API Key (copied/past) and the application ID "ms24-letterbox". As a result I got the message from HA: No devices or entites? For this is strange. Have I missed someting?
besten regards for any hint.
Hans Peter
--------------------------------------------------excerpt from the log file-----------------------------------------------
![Screenshot 2024-03-16 154015](https://github.com/angelnu/home_assistant_thethingsnetwork/assets/155103102/f5093a45-3d9e-4668-a655-cfb87c5831a3)
Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht
Logger: custom_components.thethingsnetwork Quelle: custom_components/thethingsnetwork/TTN_client.py:204 Integration: The Things Network (Dokumentation, Probleme) Erstmals aufgetreten: 14:41:41 (12 Vorkommnisse) Zuletzt protokolliert: 15:25:55
TTN entry without result: {'error': {'code': 3, 'message': 'error:pkg/auth:token (invalid token)', 'details': [{'@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails', 'namespace': 'pkg/auth', 'name': 'token', 'message_format': 'invalid token', 'correlation_id': 'ed70b8418fb24509a2f0302fddf1bdd0', 'code': 3}]}} TTN entry without result: {'error': {'code': 3, 'message': 'error:pkg/auth:token (invalid token)', 'details': [{'@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails', 'namespace': 'pkg/auth', 'name': 'token', 'message_format': 'invalid token', 'correlation_id': 'ef5b4db91e1445f184dc0f21a36843a6', 'code': 3}]}} TTN entry without result: {'error': {'code': 3, 'message': 'error:pkg/auth:token (invalid token)', 'details': [{'@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails', 'namespace': 'pkg/auth', 'name': 'token', 'message_format': 'invalid token', 'correlation_id': 'dc5bf9a17b6c42c9808e1a2a560137b8', 'code': 3}]}} TTN entry without result: {'error': {'code': 3, 'message': 'error:pkg/auth:token (invalid token)', 'details': [{'@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails', 'namespace': 'pkg/auth', 'name': 'token', 'message_format': 'invalid token', 'correlation_id': 'b563f95d30fc47daa8da2182c820780d', 'code': 3}]}} TTN entry without result: {'error': {'code': 3, 'message': 'error:pkg/errors:validation (invalid
application_ids
: embedded message failed validation)', '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': '90bbe75ab26d4e86b0d350335ffa5b27', '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{2,}$"'}, 'correlation_id': 'db1d96c01415447794985a710b3c7691', 'code': 3}, 'code': 3}]}}