🌤 WUnderground data uploader

If a manual run works, there is nothing wrong with the configuration.
The change will happen when one of the trigger_entities change value. You can look in the traces to see what is happening.

Maybe the fix should be to write the trigger_entities as a list, like below.

trigger_entities:
  - sensor.outdoor_temperature_temperature

Thank you very much for your answers. The problem was resolved without my visible participation. I was busy with other things, and when I returned to HA, the data had already begun to arrive on the site. Perhaps I rebooted the HA and that helped, as you said.

Hi Dirk,

Thank you so much for the effort that has gone into this.
I am having an issue, I am not a programmer/coder but can typically work my way through things, but this has got me stumped.

When importing the blueprints and configuring everything to point to my Netatmo devices, then saving the blueprint this all saves to my automations.yaml and creates the folder where your source file exists under blueprints.

I have tried this twice now without luck, trying to debug in HA with the logs is hit and miss I find it fails trying to retrieve the station ID and or key.

WUnderground uploader: Check if station_id and station_key exist: Error executing script. Unexpected error for call_service at pos 1:

During the blueprint import I have tried entering the details directly as in this post example,
station_id: !secret wunderground_station_id
station_key: !secret wunderground_station_key
And in my secrets.yaml file adding wunderground_station_id: “IBRISB534” and wunderground_station_key: “MyWUStationKey” (I have tried the codes in the secrets.yaml with no quotes and single quotes) from the my devices page of WU.
I have also tried import again after cleaning everything out and for the station ID and Key, and get this same message, it shows these details in the trace(s).

I hope someone can help.

Thanks in Advance, Dan

don’t think the secrets.yaml works…didn’t for me anyway and had to add ID & KEY into the Automation direct…all working fine from there

1 Like

Thanks Gavin, I think I tried this, it was the first attempt, but will try again.

I did note that they called secret rather than secrets so also created that file, but still didn’t work.
I have manually added the station and key into the automation.yaml directly and still no joy.
Added it in both automation.yaml and the wunderground_upload.yaml, no joy.
I added the details to only the wunderground_upload.yaml and in the automation.yaml set to ‘’ for both values
And now it seems to be working. Automation completes but at the moment I am not seeing data in wunderground, will wait and see since this weatherstation has been inactive for quite some time.

I have manually added the station and key into the automation.yaml directly and still no joy.

Did you reload the automations after the change?

Is automation running at all? If so, you can create a shell command with the payload from the latest run to test.
How do the automation variables look for the latest automation trace? (please redact the station key)

Hi Dirk,

Yes saved and full restart of homeassistant each time, because I don’t trust reloading just the yaml files.
And yes now that I have manually modified only the wunderground_upload.yaml with my station id and key and the automation does finish to completion, and is auto triggered by change in any values of my devices.

this:
entity_id: automation.wunderground_uploader
state: ‘on’
attributes:
id: ‘1712699992388’
last_triggered: ‘2024-04-11T06:33:17.838839+00:00’
mode: single
current: 0
friendly_name: WUnderground uploader
last_changed: ‘2024-04-11T00:37:27.260014+00:00’
last_updated: ‘2024-04-11T06:33:27.843203+00:00’
context:
id: 01HV5XRYH30YB2J1E2BYTZVMBV
parent_id: null
user_id: null
trigger:
id: ‘0’
idx: ‘0’
alias: null
platform: state
entity_id: >-
sensor.unknown_70_ee_50_37_0a_18_unknown_70_ee_50_37_0a_18_unknown_70_ee_50_37_0a_18_outdoor_temperature
from_state:
entity_id: >-
sensor.unknown_70_ee_50_37_0a_18_unknown_70_ee_50_37_0a_18_unknown_70_ee_50_37_0a_18_outdoor_temperature
state: ‘27.7’
attributes:
state_class: measurement
unit_of_measurement: °C
attribution: Data provided by Netatmo
device_class: temperature
friendly_name: LoungeDetails OurWeather Temperature
last_changed: ‘2024-04-11T06:30:52.740686+00:00’
last_updated: ‘2024-04-11T06:30:52.740686+00:00’
context:
id: 01HV5XM724TM0EG27K74874C06
parent_id: null
user_id: null
to_state:
entity_id: >-
sensor.unknown_70_ee_50_37_0a_18_unknown_70_ee_50_37_0a_18_unknown_70_ee_50_37_0a_18_outdoor_temperature
state: ‘27.5’
attributes:
state_class: measurement
unit_of_measurement: °C
attribution: Data provided by Netatmo
device_class: temperature
friendly_name: LoungeDetails OurWeather Temperature
last_changed: ‘2024-04-11T06:42:52.620744+00:00’
last_updated: ‘2024-04-11T06:42:52.620744+00:00’
context:
id: 01HV5YA62CCZ54ES3KDECJ6B13
parent_id: null
user_id: null
for: null
attribute: null

sensor_solarradiation: ‘’
sensor_UV: ‘’
rtfreq: 300
delay: 10
baromin: 29.97882701047428
tempf: 81.5
humidity: 56
windspeedmph: 4.3491
windgustmph: 8.0769
winddir: 270
rainin: 0
dailyrainin: 0
indoortempf: 82.75999999999999
indoorhumidity: 48
solarradiation: ‘’
UV: ‘’
dewptf_calculated: 64.28787889748189
dewptf: 64.28787889748189
payload: >-
ID=&PASSWORD=&action=updateraww&realtime=1&dateutc=now&rtfreq=300&baromin=29.979&tempf=81.5&dewptf=64.288&humidity=56.0&windspeedmph=4.349&windgustmph=8.077&winddir=270.0&rainin=0.0&dailyrainin=0.0&indoortempf=82.76&indoorhumidity=48.0

Maybe I see the problem.
The station_id: ‘’ and station_key: ‘’ indicate these values are empty. The payload also misses this information.
Did you remove this information?

If station_id or station_key misses, the automation won’t run, indicated by ‘no action taken’ in step 2.

He’s put them in via a secrets.yaml file and the Blueprint doesn’t like that…see my reply a few post back.

If I import your blueprint and fill out all the details including the station ID and key, this will not run past get station id and key.
If I manually put them in the automations.yaml it does not run, just times out on the get station ID and key.
I tried to put them in the secrets.yaml and also created a secret.yaml as per your examples right at the beginning, it will not run just times out at the same point.

If I have these keys in the automation and the wunderground_upload.yaml it still does not run and times out at the get station id and key

The only way I managed to get this to run at all past the get station id and key was to manually put it in the wunderground_upload.yaml in the station id and key, and leave the automations.yaml file as just ‘’ for the id and key. which shows the output above.

I have no idea now what is wrong and am confused because I guess it should just work out of the box by completing the import details?

edit:
also at some point the netatmo integration screwed up the naming of my devices, as you can see from the unkown… stupid long strings, so have removed it and re-added it, and now the names are more meaningful.

Update have re-imported with new tidy Netatmo sensors, and the script times out, I have even tried to use a different wunderground device ID and Key.

Gavin when you say you enter in the automation do you mean the automations.yaml or another you are calling from there? The station ID and Key is it “PWS1234” or ‘PWS1234’ or PWS1234 ? Did you have to make any other changes to the blueprint? I am using the Station key and ID in the automations.yaml without any quotes

An update, I have now overridden the import from here with the raw data from github posted later in the post to the source https://raw.githubusercontent.com/dvandonkelaar/home-assistant-blueprints/main/wunderground_upload.yaml
I have removed the check for station ID & key out of this.

The automation runs to a point, collects all the details and creates a string to upload, but times out, if I copy and paste this automation generated url into a browser session it is successful uploading to my PWS.

Does anyone know what I am missing?

Let’s start from the beginning. How does your automation look?
The secrets should work, maybe something is misconfigured. See the docs for more details.
The station ID and key are without quotes if I see my automation traces.

A sample config:

automation:
  - id: wunderground_data_upload
    alias: WUnderground data upload
    use_blueprint:
      path: wunderground_upload.yaml
      input:
      station_id: ID1234
      station_key: KEY1234
      sensor_baro: 'sensor.outdoor_pressure'
      sensor_temp: 'sensor.outdoor_temperature'
      sensor_humidity: 'sensor.outdoor_humidity'
      sensor_rain: 'sensor.outdoor_rain'
      sensor_dailyrain: 'sensor.outdoor_rain_today'
      refresh_frequency: 300
      trigger_entities:
        - sensor.outdoor_temperature
        - sensor.outdoor_humidity
        - sensor.outdoor_rain
        - sensor.outdoor_rain_today
      curl_command_service: shell_command.curl_get

that’s what I have in the BluePrint…entered directly into UI and working fine
outside that it’s pretty much exactly as @dvandonkelaar has it in the post above.

(and FWIW @dvandonkelaar I couldn’t get scerets to work for me either…but just moved on, no worries)

1 Like

Automation.yaml entry as follows. Wind Gust appears down the bottom now because I added this after, because of an issue with the netatmo config disabling it by default when adding to homeassistant, manual enable in entity and all is working fine.
Running this automation manually generates a https upload string that if I copy and paste into browser uploads to wunderground, if you look at my station ID you will see manual runs today, only copying and pasting the generated URL in the automation step details

- id: '1712881449838'
  alias: WUnderground uploader
  description: Weather Underground Uploaded from Netatmo
  use_blueprint:
    path: dvandonkelaar/wunderground_upload.yaml
    input:
      station_id: IBRISB534
      station_key: MySecretStationKey
      sensor_baro: sensor.ourweather_pressure
      sensor_temp: sensor.ourweather_outdoor_temperature
      sensor_humidity: sensor.ourweather_outdoor_humidity
      sensor_windspeed: sensor.ourweather_anemometer_wind_strength
      sensor_winddir: sensor.loungedetails_ourwind_direction
      sensor_rain: sensor.ourweather_rain_gauge_rain
      sensor_dailyrain: sensor.ourweather_rain_gauge_rain_today
      refresh_frequency: 300
      trigger_entities: sensor.ourweather_anemometer_wind_strength
      curl_command_service: shell_command.curl_get
      sensor_windgust: sensor.ourweather_anemometer_gust_strength

@dvandonkelaar Thank you for all the help.

Why i am getting this error when i try to create the automation?

Already added ```
shell_command:
curl_get: ‘curl -X GET {{ url }}’
to the configuration.yaml.

I dont know what is happening. Thank you so much.

Hi Dan,

Just to be sure, with this configuration the automation runs, but doesn’t go past the station_id and station_key check? As stated in this post?
That shouldn’t be possible since this information is filled in correctly.
What I see is that the sensor names are not quoted, which is different than in my example, but that should only be an issue for the upload.

You say the automation runs manual, that indicates the trigger_entities are not correctly filled in. You could try this suggestion to resolve that.

Hi @pCharden,

What is causing this error message? Is that my blueprint?
The code data['entity_id'] is not used in my blueprint.

Could you let me know a little more what you did to cause this message?

@dvandonkelaar Yes my friend. I just imported your blueprint from the button at the start of the discussion and later added the shell code to the configuration.yaml.
So, when i try to create the automation from the blueprint, i get that error.

My Home Assistant is installed via CasaOS. Maybe that is the problem.

Hi Dirk,

I have stripped out the station ID and Key checks, after I read through the posts and saw mention that others had this issue.
After doing this then I was able to get information in the trace of the automation with a collection of the details for upload to wunderground, the script still just times out after 60 seconds.

As above In the trace window if I grab the https string generated and paste it into a web browser window I get a success confirmation in the web body, and the data uploads to wunderground

Timeout from Server Logs - None of this really means much to me.



Did you fully restart homeassistant? I believe this is the message your receive if you haven’t restarted homeassistant, you will need to do this before attempting to import and configure the blueprint.
And I would also recommend using the raw from github not the import from this page, as I believe the import from this page is out of date, and caused me issues early on.