Multiple Wunderground PWS Sensors

Hey all,

At one point this worked, not sure what changed. I am trying to poll two different weather stations so I can compare various parameters. Now I’m getting errors about duplicate entities:

2018-02-28 10:09:16 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.pws_temp_f
2018-02-28 10:09:16 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.pws_precip_today_in
2018-02-28 10:09:16 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_platform.py", line 260, in _async_add_entity
    msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: sensor.pws_station_id

The config is pretty simple:

- platform: wunderground
  api_key: !secret wunderground_api_key
  pws_id: KOHSUNBU11
  monitored_conditions:
  - weather
  - temp_f
  - station_id
  - feelslike_f
  - heat_index_f
  - dewpoint_f
  - wind_mph
  - UV
  - pressure_in
  - wind_dir
  - relative_humidity
  - precip_today_in
  - alerts

- platform: wunderground
  api_key: !secret wunderground_api_key
  pws_id: KOHJOHNS13
  monitored_conditions:
  - weather
  - temp_f
  - station_id
  - feelslike_f
  - heat_index_f
  - dewpoint_f
  - wind_mph
  - UV
  - pressure_in
  - wind_dir
  - relative_humidity
  - precip_today_in
  - alerts

Any way to get this working again? Thanks so much!!

I was having the same problem with a couple automations. Check that you don’t have to automations names that “normalize” to the same entity id. Or aliases with same.

@Tyler_Terzigni - I’m not 100% sure what you mean. Before all the sensors from the second one just showed up with a _2 at the end of their name. So I had some stuff using the one without the _2, and some using the one with the _2.

Did you duplicate (copied) any of your .yaml files when making changes and forgot to delete them later? I had the same issue, when I wanted to preserve old .yaml while making changes and wound up with duplicate sensors.

Also, if you name automations with similar names. : “weather api San fran upper” and "weather api san fran lower’ they may normalize to “weather_api_san_fran” and potentially collide… This is what @Tyler_Terzigni was referring too. Or at least this is what I think… :slight_smile:

Ahh that makes sense. But nope. I don’t ever duplicate yamls because of that reason, I backup them all to github. I searched the entire config directory for wunderground though just to be sure, it only hits in the log and the yaml I copied from above.

And i just double checked, no I don’t have anything that should be colliding. Looking at my config I’m actually not using any of the data for automations anyway. I do have a few of the sensors customized, but again no collisions:

sensor.pws_temp_f:
  friendly_name: Outside Temp
sensor.pws_temp_f_2:
  friendly_name: Brian Temp
sensor.pws_alerts:
  friendly_name: Weather Alerts
  icon: mdi:alert
sensor.pws_relative_humidity:
  friendly_name: Outside Humidity
  icon: mdi:water-percent
sensor.pws_weather:
  friendly_name: Weather
sensor.pws_wind_dir:
  friendly_name: Wind Direction
  icon: mdi:compass
sensor.pws_wind_mph:
  friendly_name: Wind MPH
  icon: mdi:weather-windy

This seems to be a bug in the platform, I opened an issue here: https://github.com/home-assistant/home-assistant/issues/12852