šŸŒ¤ WUnderground data uploader

Hi,

A pm2.5 value isnā€™t available in the Wunderground API documentation.
Thatā€™s probably why it doesnā€™t work.

Nice! Iā€™ll probably repurpose the idea for another API.

Hi there @dvandonkelaar ! Thanks for providing this blueprint. Iā€™m having problems getting it to run though. Iā€™m currently using Node Red and I know that the sensors that I am using do work well with the WU Iā€™m using in NR. Note that I am using password with NR upload but I did pull the station key value from WU profile.

I did notice that some of my sensors did not autopopulate the dropdowns so I just pasted the HA entity value. I have also confirmed that Iā€™ve added the curl_get command and restarted. It shows up fine when I look in services. I try to do a force run on my automation but it doesnā€™t do anything and I canā€™t find any problems in the logs. Last run shows ā€˜Neverā€™. Can you give me a push on what I should be checking and where I might get some kind of clue as to why nothing is happening?

alias: WEATHER - WUnderground upload
description: ""
use_blueprint:
  path: dvandonkelaar/wunderground_upload.yaml
  input:
    sensor_baro: sensor.office_temp_humid_pressure
    sensor_temp: sensor.acurite_5_in_1_temperature
    station_id: [redacted]
    station_key: [redacted]
    sensor_winddir: sensor.acurite_5_in_1_wind_direction_filtered
    sensor_windspeed: sensor.acurite_5_in_1_wind_speed_filtered
    sensor_windgust: sensor.acurite_5_in_1_wind_gust
    refresh_frequency: 300
    sensor_rain: sensor.acurite_5_in_1_rain
    sensor_dailyrain: sensor.acurite_5_in_1_rain_today
    trigger_entities:
      - sensor.office_temp_humid_pressure
      - sensor.acurite_5_in_1_temperature
      - sensor.acurite_5_in_1_wind_direction_filtered
      - sensor.acurite_5_in_1_wind_speed_filtered
      - sensor.acurite_5_in_1_wind_gust
      - sensor.acurite_5_in_1_rain
      - sensor.acurite_5_in_1_rain_today
    curl_command_service: shell_command.curl_get
    sensor_humidity: sensor.acurite_5_in_1_humidity
    sensor_dewpt: sensor.acurite_5_in_1_dewpoint
    calculate_dewpt: false
    sensor_indoortemp: sensor.lr_temp_humid_temperature
    sensor_indoorhumidity: sensor.lr_temp_humid_humidity
    delay: 60

Found a bug. The uploader automation fails when the wind speed sensor has a unit of measurement of ā€œmphā€. I changed to km/h and the automation runs fine. Is mph a valid unit?

Hi,

Did you managed to get this to work? Maybe the pasted sensor names give a problem in the blueprint/automation because the device_class is not correct. Can you check the device classes with the needed device classes?

There is nothing wrong with te supplied code, so the problem must be somewhere else.

Hi,

According to the sensor device classes, mph is a valid unit.
The code only does a calculation if the unit_of_measurement is ā€œkm/hā€ and takes the text value if it has an other unit_of_measurement.
Commit 19f366d fixes this issue.

Thanks for the update. Unfortunately I did just convert this over to an automation myself yesterday so timing is a bit off. I may try it later at some point but for now Iā€™ll just stick with what I just wrote.

Thanks for making the fix to the wind speed! Units of ā€œmphā€ work now.

Nice to hear it all works now.
The blueprint is updated with a solarradiation and UV sensor, so these could also be added to the WUnderground upload.

2 Likes

Thanks for your blueprint Dirk.
How can I trigger this automation every 5 minutes? What I need to add to the code?
Iā€™m sorry for the dumb question; Iā€™m new to this world.
Thank you.

This isnā€™t possible with the default blueprint.
You can edit the blueprint and change the trigger to a time_pattern trigger.

The following YAML needs to be changed

trigger:
  - platform: state
    entity_id: !input trigger_entities

to:

trigger:
  - platform: time_pattern
    minutes: "/5"
1 Like

Thank you! You are very kind

The blueprint looks great, thanks. When trying to set it up, however, I get the following error message:

Message malformed: invalid template (TemplateSyntaxError: unexpected '}', expected ')') for dictionary value @ data['variables']['baromin']

I went thought the yaml file and counted the ) and } but could not find an error in the blueprint.
Anyone an idea how to resolve this? Thanks.

Thatā€™s strange, because it works for me and the baromin value doesnā€™t have a wrong } or ).
Do you have the exact same file as on GitHub?

If it is the same, can you post a screenshot of the state page for the entity in the developer tools?

I just copy pasted the Github file into the weatherunderground_upload.yaml using studio code server.
Then I reloaded all the yaml configuration files. Now it saves and when needed I can edit.

Thanks for helping.

The strang thing is that the data does not seem to arrive at WeatherUnderground. I have verified that Home Assistant has the correct data from my Davis Vantage to MQTT integration. The Davis entities are available and correct in home assistant.
Iā€™ve also correctly put in the station ID and key from my WU account.
The automation is running every 5 seconds.

I just found out to put the curl-part in the configuration.yaml and reference the shell_command.curl_get in the automation. Iā€™ve reloaded the yaml-configurations, but it still does not work.

Home Assistant complains that the automation is asking for an unknown service: shell_command.curl_get

A bit more help would be highly appreciated, thanks

Have you added this to your yaml config as per post #1, and rebooted.

shell_command:
  curl_get: 'curl -X GET {{ url }}'

Thatā€™s what HA is looking for in your error msg.

You are right, rebooting solved the issue. I had only reloaded the yaml

Thanks!

1 Like

I canā€™t find an error in my settings. It seems I did everything as described above. Installed WUnderground upload, created automation,

 alias: WUnderground upload my
 description: ""
 use_blueprint:
   path: dvandonkelaar/wunderground_upload.yaml
   input:
     station_id: XXXXXX
     station_key: YYYYYY
     sensor_baro: sensor.outdoor_temperature_pressure
     sensor_temp: sensor.outdoor_temperature_temperature
     calculate_dewpt: true
     sensor_humidity: sensor.outdoor_temperature_humidity
     refresh_frequency: 300
     trigger_entities: sensor.outdoor_temperature_temperature
     curl_command_service: shell_command.curl_get

added it to the configuration fileā€¦

shell_command:
  curl_get: 'curl -X GET {{ url }}'

The result is that if I run the automation manually, the data is sent to the site, everything works fine. But automation itself does not start. As I understand it, she should get tired every 5 minutes? Or when the value of one of the sensors changes? What am I doing wrong?

A bit late, but did you manage to get this working?
If there is an unknown service, it probably isnā€™t loaded correctly. A reload of the yaml-configuration only reloads the shell_command configurations one already exists (if iā€™m correctly). So a Home Assistant restart should resolve the issue.