Weather underground (Wunderground) weather sensor

Line 33 of wunderground.py needed to be changed on Raspberry Pi to self._unit_of_measurement = TEMP_FAHRENHEIT from self._unit_of_measurement = “°F” because of ‘utf-8’ codec error. TEMP_FAHRENHEIT is defined in the homeassistant package in const.py and also needs to be added after line 7: from homeassistant.const import TEMP_FAHRENHEIT

For those newbies like me, I included the following in my configuration.yaml file:

  1. At the end of the homeassistant: section, I added ’ customize: !include customize.yaml’. Note the two spaces in front of the line.

  2. I added wunderground as my first sensor (note there are two spaces in front of everything after sensor below
    sensor:
    platform: wunderground
    api_key: YOURKEY
    pws_id: KMANORTH112

  3. I added the sensor templates file as my next sensor:
    sensor 2: !include sensor_templates.yaml

  4. Towards the end of my configuration.yaml file, I added the group line:
    group: !include group_config.yaml

1 Like

Install instructions same for Pi all-in-one installer?

For Pi AIO you save to custom_components/sensor or deps folder?

I’m having a hard time getting this sensor up and running. Did everything macaroni1975 posted when I restart HA doesn’t start no log output either.

Correct. I’m on AIO as well.

Can somone with a working wundergroud setup share their .yaml files? I must be grouping or customizing something wrong.

Before you try customizing/grouping, just make sure that you are getting those sensors created with the right data (start simple). What error are you getting?

Take a look here:

I provided all the YAML files as well as screenshots.

thanks… i actually figured it out last night. was struggling with it for a few days… I used wget to grab py file so opening it revealed html code. used git to grab py file everything is working now.

1 Like

Good to hear!

Just created a PR for the Wunderground sensor

2 Likes

How will this affect the current method of display using template sensors? Will it change at all?

I guess, some minor modifications to the customize.yaml will be required based on the name of the sensors. Otherwise, should work just fine.

I finally got around to trying this but was disappointed when I saw how many attributes were missing from the original implementation and so I went back. I’d love to use the component and get rid of all the overhead associated with all the template sensors, but not at the expense of losing all that data I was getting.

Any chance the code will be updated to get all of the WU attributes that were available?

Which attributes specifically?

I took a look at readding forecast data. I am still blocked by this question.

I haven’t tried it yet (still on 0.26), but I assume I could update, remove the built-in WU component, and just keep using my existing custom component. You should try that.

personally I liked Last Observed/Observation Time.

Hello guys,

I’m working on it to add alerts advisories as well.

I can try to add other attributes if you want. Any one in special?

mmello

Here’s the sensors I have using the older custom component.

     pws_stationid:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.station_id }}'
     pws_location:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.display_location.full }}'
     pws_elevation:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.observation_location.elevation }}'
     pws_uv:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.UV }}'
     pws_solarradiation:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.solarradiation }}'
     pws_pressure_trend:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.pressure_trend }}'
     pws_observation_time:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.observation_time }}'
     pws_relative_humidity:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.relative_humidity }}'
     pws_wind_degrees:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.wind_degrees }}'
     pws_wind_dir:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.wind_dir }}'
     pws_wind_string:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.wind_string }}'
     pws_dewpoint_string:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.dewpoint_string }}'
     pws_feelslike_string:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.feelslike_string }}'
     pws_heat_index_string:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.heat_index_string }}'
     pws_precip_1hr_string:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.precip_1hr_string }}'
     pws_precip_today_string:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.precip_today_string }}'
#
#
#  Fahrenheit/Imperial Measurements
#
     pws_dewpoint_f:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.dewpoint_f }}'
     pws_temp_f:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.temp_f }}'
     pws_feelslike_f:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.feelslike_f }}'
     pws_heat_index_f:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.heat_index_f }}'
     pws_precip_1hr_in:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.precip_1hr_in }}'
     pws_precip_today_in:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.precip_today_in }}'
     pws_pressure_in:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.pressure_in }}'
     pws_visibility_mi:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.visibility_mi }}'
     pws_wind_mph:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.wind_mph }}'
     pws_wind_gust_mph:
       value_template: '{{ states.sensor.weather_underground_pws.attributes.wind_gust_mph }}'
#

I didn’t have to remove the HA Component, I just had to return the original to the custom components directory and uncomment all my templates when I was done testing.

Hey There,
I just wanted to pick this Topic up again, because weatherunderground doesn’t need an api key to get data from it.
You just can send a request to http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=INEUNKIR2 where INEUNKIR2 is the ID of the desired weatherstation and get an xml view of all data.

Very interesting! I tried this with my own weather station ID and noticed some additional info that isn’t available via the API key like the Type of Weather Station (AcuRite Weather Station). I wonder if there are any limitations on this method?

Hello @rpitera,

I’ve added some few more attributes to the Wunderground sensor at https://gist.github.com/tchellomello/309b0a643470646312ee257cd4ea1aff.

Install the custom component and let me know if it worked as you want. If works, I’ll check the other ones missing and we can add as well.

Please let me know how it goes.

mmello

Thanks! I’ll test it out this weekend and let you know how it works for me.