home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.02k stars 31.06k forks source link

thethingsnetwork component not loading #10725

Closed peerv closed 6 years ago

peerv commented 7 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.57.2 on Windows10

Python release (python3 --version): 3.6 32bits

Component/platform: thethingsnetwork

Description of problem: After working for weeks "thethingsnetwork" component is not loading anymore after a restart. The logging function is loaded. There is no entry at all in the error log about "thethingsnetwork" No change was made to the configuration file. Any idea where to look?

Expected:

Problem-relevant configuration.yaml entries and steps to reproduce:

thethingsnetwork:
  app_id: pv_bmp280
  access_key: ttn-account-v2.DUlBAjBvfgsdfgsdfgsfd56456ghdfhW3v_sdfg4535swgdsdfg

sensor:
  - platform: thethingsnetwork
    device_id: bmp280
    values:
      mbar: "bar"
      celcius: "C"

Traceback (if applicable):

Additional info:

MartinHjelmare commented 7 years ago

Please mock your access_key. If that was your real key, I'd change it now.

fabaff commented 7 years ago

It works fine for me on dev. At first glance I would say that there is something wrong with your token or that your data storage integration is broken. Can you check if you are able to retrieve the data:

curl -X GET --header 'Accept: application/json' --header 'Authorization: key ttn-account-v2.DUlBA....' 'https://pv_bmp280.data.thethingsnetwork.org/api/v2/query'

or at https://pv_bmp280.data.thethingsnetwork.org/

peerv commented 7 years ago

Hi Fabian, thanks for looking into this. I double checked the Data Integration interface of Thethingsnetwork.org In the swagger UI the curl GET command works fine with the same access-key as in the HASS configuration file. My main problem is that there is no indication at all in the error log that the thethingsnetwork component is loading or has had an error during loading. I have debug logging on for the thethingsnetwork component. It has worked for weeks and suddenly after a restart the component has disappeared completely. Any suggestion on how to tackle this?

fabaff commented 7 years ago

No output in the log? Like:

2017-11-23 08:21:32 INFO (MainThread) [homeassistant.loader] Loaded thethingsnetwork from homeassistant.components.thethingsnetwork
2017-11-23 08:21:32 INFO (MainThread) [homeassistant.setup] Setting up thethingsnetwork
2017-11-23 08:21:32 INFO (MainThread) [homeassistant.setup] Setup of domain thethingsnetwork took 0.0 seconds.
2017-11-23 08:21:32 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=thethingsnetwork>
peerv commented 7 years ago

Hi Fabian,

Indeed there is nothing in the logs….

2017-11-24 11:53:45 DEBUG (SyncWorker_10) [homeassistant.components.mysensors] Invalid values: {4: '1003.16'}: sensor platform: node 207 child 42: S_BARO requires value_type V_FORECAST @ data[5] 2017-11-24 11:53:45 INFO (SyncWorker_6) [homeassistant.components.mysensors] Adding new devices: [<Entity Distance Sensor 1 1: None>, <Entity Distance Sensor 2 2: None>, <Entity Distance Sensor 3 2: None>, <Entity BME280 Sensor 207 40: None>, <Entity BME280 Sensor 207 42: None>, <Entity BME280 Sensor 207 41: None>] 2017-11-24 11:53:45 DEBUG (SyncWorker_6) [homeassistant.components.mysensors] Entity update: BME280 Sensor 207 40: value_type 0, value = 22.6 2017-11-24 11:53:45 DEBUG (SyncWorker_3) [homeassistant.components.mysensors] Entity update: Distance Sensor 1 1: value_type 13, value = 14 2017-11-24 11:53:45 DEBUG (SyncWorker_13) [homeassistant.components.mysensors] Entity update: Distance Sensor 2 2: value_type 13, value = 19 2017-11-24 11:53:45 DEBUG (SyncWorker_13) [homeassistant.components.mysensors] Entity update: BME280 Sensor 207 42: value_type 4, value = 1003.16 2017-11-24 11:53:45 DEBUG (SyncWorker_7) [homeassistant.components.mysensors] Entity update: Distance Sensor 3 2: value_type 13, value = 21 2017-11-24 11:53:45 DEBUG (SyncWorker_15) [homeassistant.components.mysensors] Entity update: BME280 Sensor 207 41: value_type 1, value = 45.254

I attach the configuration file for you to check.

Thnks Peter

Van: Fabian Affolter Verzonden: donderdag 23 november 2017 08:23 Aan: home-assistant/home-assistant CC: peerv; Author Onderwerp: Re: [home-assistant/home-assistant] thethingsnetwork component notloading (#10725)

No output in the log? Like: 2017-11-23 08:21:32 INFO (MainThread) [homeassistant.loader] Loaded thethingsnetwork from homeassistant.components.thethingsnetwork 2017-11-23 08:21:32 INFO (MainThread) [homeassistant.setup] Setting up thethingsnetwork 2017-11-23 08:21:32 INFO (MainThread) [homeassistant.setup] Setup of domain thethingsnetwork took 0.0 seconds. 2017-11-23 08:21:32 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=thethingsnetwork> — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

peerv commented 7 years ago

The only indication for the existance of the "thethingsnetwork" component is an entry in the error log after I wake up the computer with HASS after sleep. This is the error entry:

2017-11-25 08:31:04 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2017-11-25 08:31:05 ERROR (MainThread) [homeassistant.components.sensor.thethingsnetwork] Error while accessing: https://pv_bmp280.data.thethingsnetwork.org/api/v2/query/bmp280
2017-11-25 08:31:05 ERROR (MainThread) [homeassistant.components.sensor.thethingsnetwork] Error while accessing: https://pv_bmp280.data.thethingsnetwork.org/api/v2/query/bmp280
fabaff commented 7 years ago

Is your configuration splitted across multiple files?

fabaff commented 7 years ago

It could be an option than you create a read-only API token and sent this to me in private. This way I would be able to test it.

peerv commented 7 years ago

Fabian,

I did some further debugging and found that the following logger: setup prevents the thethingsnetwork component from loading: logger: default: error logs:

homeassistant.components.mysensors: debug

#mysensors: debug
homeassistant.components.thethingsnetwork: debug

When I comment “default: error” thethingnetwork component is loading again.

Hope you can reproduce this error.

I you need I can send you an API key for debugging.

Thanks

peter

Van: Fabian Affolter Verzonden: woensdag 29 november 2017 08:26 Aan: home-assistant/home-assistant CC: peerv; Author Onderwerp: Re: [home-assistant/home-assistant] thethingsnetwork component notloading (#10725)

It could be an option than you create a read-only API token and sent this to me in private. This way I would be able to test it. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

balloobbot commented 6 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

balloobbot commented 6 years ago

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem 👍