Problems with Wunderground integration

Hello,

having a problem with the Wunderground integration.
I would like to get the data from my own weatherstation. Therefore, i use the Wunderground integration. I have an API key as i am transmitting data to WU.

Config (excerpt)

####################################################

Wunderground

####################################################

  - platform: wunderground
    api_key: !secret wunderground_api_key
    pws_id: !secret wunderground_my_pws_id
    lang: de
    monitored_conditions:
      - temp_c
      - relative_humidity
      - pressure_mb
      - precip_today_metric
      - UV
      - dewpoint_c
      - wind_string
      - wind_mph

But logfile tells me the following error:

Platform wunderground not ready yet. Retrying in 180 seconds.

16:25 helpers/entity_platform.py (WARNING) - Die Nachricht ist zum ersten Mal um 13:33 aufgetreten und erscheint 58 mal

Error fetching WUnderground data: ContentTypeError("0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='http://api.wunderground.com/api/d0e19e678edb4c4ba19e678edbcc4b78/conditions/lang:EN/q/pws:ISTHEIDE6.json")

16:25 components/wunderground/sensor.py (ERROR) - Die Nachricht ist zum ersten Mal um 13:25 aufgetreten und erscheint 63 mal

Platform wunderground not ready yet. Retrying in 60 seconds.

13:26 helpers/entity_platform.py (WARNING)

Any hints what i didi wrong?
Many thanks in advance!
/ Ralf

The original integration does not seem to work anymore with the new API key.
I use https://github.com/cytech/Home-Assistant-wundergroundpws

1 Like

Hello Flop2006,

thanks very much for this information.
Will check on your link to the alternative.
Hopefully, the integration will be updated soon so nobody else gets into trouble…

/ Ralf

Hello,

tried the mentioned github script but HA does not start anymore.
I am getting this error when checking the config:

Error: Testing configuration at /config
INFO:homeassistant.util.package:Attempting install of aiofiles==0.4.0
INFO:homeassistant.util.package:Attempting install of aiogithubapi==0.4.3
INFO:homeassistant.util.package:Attempting install of hacs_frontend==20200104192235
INFO:homeassistant.util.package:Attempting install of integrationhelper==0.2.2
INFO:homeassistant.util.package:Attempting install of semantic_version==2.8.4
INFO:homeassistant.util.package:Attempting install of fritzconnection==0.8.4
INFO:homeassistant.util.package:Attempting install of fritz-switch-profiles==1.0.0
ERROR:homeassistant.scripts.check_config:BURB
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/scripts/check_config.py", line 205, in check
    async_check_ha_config_file(hass)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete
    return future.result()
  File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 164, in async_check_ha_config_file
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 265, in get_platform
    f"{self.pkg_path}.{platform_name}"
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/wundergroundpws/sensor.py", line 45, in <module>
    load_config = config.load_yaml_config_file(conf_file)
  File "/usr/src/homeassistant/homeassistant/config.py", line 339, in load_yaml_config_file
    conf_dict = load_yaml(config_path)
  File "/usr/local/lib/python3.7/unittest/mock.py", line 1011, in __call__
    return _mock_self._mock_call(*args, **kwargs)
  File "/usr/local/lib/python3.7/unittest/mock.py", line 1077, in _mock_call
    result = effect(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/scripts/check_config.py", line 167, in mock_load
    return MOCKS["load"][1](filename)
  File "/usr/src/homeassistant/homeassistant/util/yaml/loader.py", line 59, in load_yaml
    with open(fname, encoding="utf-8") as conf_file:
FileNotFoundError: [Errno 2] No such file or directory: '/root/.homeassistant/configuration.yaml'
Fatal error while loading config: [Errno 2] No such file or directory: '/root/.homeassistant/configuration.yaml'
Failed config
  General Errors:
    - [Errno 2] No such file or directory: '/root/.homeassistant/configuration.yaml'
Successful config (partial)

Think i need to search for another solutions…
/ Ralf

This thread should help you out, if you haven’t found it yet: https://github.com/cytech/Home-Assistant-wundergroundpws/issues/1

@sandman98321
Thanks very much for your help pointing me to this link!
Will try to check today evening and report back here

/ Ralf

Hello,

got it working!
If someone needs to do same (description for hass.io):

  1. install the custom component manually as described in the github link:
    https://github.com/cytech/Home-Assistant-wundergroundpws

  2. change file /config/custom_components/wundergroundpws/sensor.py, line 45
    from: load_config = config.load_yaml_config_file(conf_file)
    to: load_config = config.load_yaml_config_file('/config/configuration.yaml')
    as described in https://github.com/cytech/Home-Assistant-wundergroundpws/issues/1

  3. run a code check in HA to confirm if everything is ok

  4. restart HA -> you will find new entities named sensor.wupws_*

  5. if you want - like me - the humidity displayed as a graph, you need to convert it to an int (it’s a string by default)
    I used the following:

- platform: template
    sensors:
      my_wupws_humidity:
        unit_of_measurement: "%"
        value_template: "{{states('sensor.wupws_humidity') | int }}"

BTW: the lang parameter caused an error in my config (maybe i did s.th. wrong here?)
My config of the component as following

  - platform: wundergroundpws
    api_key: !secret wunderground_api_key
    pws_id: !secret wunderground_my_pws_id
#    lang: de
    monitored_conditions:
      - stationID
      - solarRadiation
      - obsTimeLocal
      - uv
      - winddir
      - humidity
      - dewpt
      - heatIndex
      - windChill
      - precipTotal
      - precipRate
      - temp
      - windGust
      - windSpeed

Hope it helps others!

/ Ralf

4 Likes

R A L F !!!

YOU saved my day :slight_smile: :slight_smile: :slight_smile:
After spending so much time in my wh2600 and home assistand i’m now able to see something <3

Do you have a good recommendation for some nice lovelace panel? Like windrose and directions e.g.

1 Like

Hello,

Glad i could help.
I have no dedicated panel. For my Dashboard view i just use a glance. On click (tap_action), it switches to a bigger extra view with some nicer mini-graph pictures i added there.
But an extra panel would be an idea…

/ Ralf

1 Like

Is there a problem with WU integration to HA at the moment. I am running 2 instances (Pi and VM) with both reporting the same error:

Error fetching WUnderground data: ContentTypeError("0, message=‘Attempt to decode JSON with unexpected mimetype: text/html’

My system has been down 16 hours. When I log in via WU url data is being received and updated from my weather system.

I’m seeing a few timeout errors today.

I haven’t had any updates at all. Only set this up a week ago.

I pull the 5-day forecast. It’s been updating regularly throughout the day. Temperature, humidity, and wind data come from the PWS.

You must have brought me some luck. Data updated on both platforms 3 minutes ago. Appreciate you coming back to me on this. All the best, keep safe.

Hi Ralf,

as you edited the sensor.py you could take a look at the variable “LANG_CODES”, there you can find the allowed values. So if you use “de-DE” its working fine. :wink:

Kind regards,
Andreas

Thanks for this tipp, i just had “de” in. Sometimes the solution is quite simple…

/ Ralf

complete list of sensors for those who help:

sensor:
    platform: wundergroundpws
    api_key: YOUR_API_KEY
    pws_id: YOUR_STATION_ID
    numeric_precision: none
    # lang: it-IT
    monitored_conditions:
      - stationID
      - solarRadiation
      - obsTimeLocal
      - uv
      - winddir
      - humidity
      - dewpt
      - heatIndex
      - windChill
      - precipTotal
      - precipRate
      - precip_1d
      - precip_2d
      - precip_3d
      - precip_4d
      - precip_5d
      - precip_chance_1d
      - precip_chance_2d
      - precip_chance_3d
      - precip_chance_4d
      - precip_chance_5d
      - temp
      - temp_high_1d
      - temp_high_2d
      - temp_high_3d
      - temp_high_4d
      - temp_high_5d
      - temp_low_1d
      - temp_low_2d
      - temp_low_3d
      - temp_low_4d
      - temp_low_5d
      - windGust
      - windSpeed
      - weather_1d
      - weather_1n
      - weather_2d
      - weather_2n
      - weather_3d
      - weather_3n
      - weather_4d
      - weather_4n