NASA’s ACE and NOAA’s DSCOVR spacecraft send measure the solar wind and data is made available every minute via these two JSON files: magnetic field parameters and solar wind parameters.
Each file contains many sensor read-outs. I want to import them all into Home Assistant.
From research, I understood the way to do this was using the Restful integration. My understanding is that I need to add this into configuration.yaml manually.
I added the following (using the example shown at the Restful integration page, and just changing what I knew needed changing):
# ACE & DSCOVR solar wind measurements
rest:
- scan_interval: 60
resource: https://noaa-swpc-pds.s3.amazonaws.com/json/rtsw/rtsw_wind_1m.json
sensor:
- name: "ACE/DSCOVR solar wind parameters"
json_attributes_path: "$.response.system"
value_template: "OK"
json_attributes:
- "time_tag"
- "active"
- "source"
- "proton_speed"
- "proton_temperature"
- "proton_density"
- "proton_vx_gse"
- "proton_vy_gse"
- "proton_vz_gse"
- "proton_vx_gsm"
- "proton_vy_gsm"
- "proton_vz_gsm"
- "proton_sample_size"
- "alpha_speed"
- "alpha_temperature"
- "alpha_density"
- "alpha_vx_gse"
- "alpha_vy_gse"
- "alpha_vz_gse"
- "alpha_vx_gsm"
- "alpha_vy_gsm"
- "alpha_vz_gsm"
- "alpha_sample_size"
- "max_convergence_flag"
- "max_data_flag"
- "max_error_count_flag"
- "max_processing_flag"
- "max_range_flag"
- "max_sample_count_flag"
- "max_telemetry_flag"
- "overall_quality"
# ACE & DSCOVR solar wind magnetic field measurements
rest:
- scan_interval: 60
resource: https://noaa-swpc-pds.s3.amazonaws.com/json/rtsw/rtsw_mag_1m.json
sensor:
- name: "ACE/DSCOVR solar wind magnetic field measurements"
json_attributes_path: "$.response.system"
value_template: "OK"
json_attributes:
- "time_tag"
- "active"
- "source"
- "range"
- "scale"
- "sensitivity"
- "manual_mode"
- "sample_size"
- "bt"
- "bx_gse"
- "by_gse"
- "bz_gse"
- "theta_gse"
- "phi_gse"
- "bx_gsm"
- "by_gsm"
- "bz_gsm"
- "theta_gsm"
- "phi_gsm"
- "max_telemetry_flag"
- "max_data_flag"
- "overall_quality"
Unfortunately, I have little understanding of JSON and so realistically I have no idea what I’m doing.
With the above, all I get is an entity called “ACE/DSCOVR solar wind parameters” with a status “OK” and that’s it. I don’t get all the readings from each sensor into separate entities in Home Assistant.
Could someone please explain what I’m doing wrong?
Thanks.