aex351 / home-assistant-neerslag-card

Display Buienalarm and/or Buienradar data in a graph for Home Assistant.
29 stars 3 forks source link

No data from Buienradar #41

Closed Dualdriven closed 10 months ago

Dualdriven commented 10 months ago

First of all, thanks for your time to make this awesome card! I have been using this for 1 week now and it looks great on the dashboard.

However, I noticed I do not get any data from buienradar, hope you have any ideas.

Things I tried;

  1. Clean install through HACS.
  2. Re-copied sensor configs
  3. Checked if templates for long and lat were returning correct values.
  4. Actually setting lon and lat as numbers instead of using the advanced config.
  5. Wondering what could be wrong without coming up with a result.

When I check the gpsgadget.buienradar.nl I do get some raw data which states rainfall at certain times, somehow its just not returned to HA. If I check the sensor.neerslagen_buienradar_Regen_Data I do see thats it is being refreshed all the time.

Config:

  - platform: command_line
    command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://cdn-secure.buienalarm.nl/api/3.4/forecast.php?lat={{state_attr("zone.home", "latitude") | round(3, default="not available")}}&lon={{state_attr("zone.home", "longitude") | round(3, default="not available")}}&region=nl&unit=mm%2Fu&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":'+dataRequest+'}';    print(data);"
    name: Neerslag_Buienalarm_Regen_Data
    json_attributes:
      - data
    value_template: 'last_changed: {{states.sensor.neerslag_buienalarm_regen_data.last_changed | default(now())}}'
    scan_interval: 240

  - platform: command_line
    command: python3 -c "import requests; import json; import random; dataRequest = requests.get('https://gpsgadget.buienradar.nl/data/raintext?lat={{state_attr("zone.home", "latitude") | round(2, default="not available")}}&lon={{state_attr("zone.home", "longitude") | round(2, default="not available")}}&c='+str(random.randint(0,999999999999999)) ).text; dataRequest = dataRequest.replace('\r\n',' '); data = '{\"data\":\"'+dataRequest+'\"}';    print(data);"
    name: Neerslag_Buienradar_Regen_Data
    json_attributes:
      - data
    value_template: 'last_changed: {{states.sensor.neerslag_buienradar_regen_data.last_changed | default(now())}}'
    scan_interval: 240

Current card: Neerslag-card1

Raw data gpsgadget: Neerslag-card buienradar raw data

Sensor: image

Thanks in advance!

Dualdriven commented 10 months ago

Just tried the ap (why didnt I think of that before... ), both sensors showing up. Above no longer needed.

Sweepr commented 8 months ago

Sorry to hi-jack this issue, but what was the fix to this issue as i have exactly the same problem.

aex351 commented 8 months ago

Instead of manually setting up the sensors using the neerslag-card try the neerslag-app.

Sweepr commented 8 months ago

Thank you, i wasn't aware of the app, seems to work good now, let's wait for some rain to come 😆.