🌤 WUnderground data uploader

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.

I removed the blueprint YAML in the first post to prevent this issue.

@pCharden Is adding the blueprint from the button (straight from GitHub) and restarting HomeAssistant working?

Is your home-assistant installation able to reach out to the internet?

Hi Dirk,

Yes I have PVOutput electricity data uploading from homeassistant without issue from automations. The first automation config for this used the curl command used here, and I could not get it working, along with others who moved these to using a restful command.
Home Assistant is running in a docker container if that makes any difference?

Positive. I imported the blueprint by the button and restarted the RPi.

when i try to save the automation, i receive this error:

You are missing the ID, each entity must have a unique ID. Either it is generated when filling out the blueprint during import. Or you need to create a name for it, see below example, mine was an autogenerated number

Hi @danwnz
Running in a docker container is no issue, Home Assistant runs (almost) always in a docker container.
Is shell_command.curl_get working correctly? This can be tested with, for example, the following service in the developers tools:

service: shell_command.curl_get
data:
    url: "https://ifconfig.me"

If correct, the outlput shows your public IP after stdout.