Restfull input no json

Hello,

I am tring to get information in an entity from

http://gpsgadget.buienradar.nl/data/raintext?lat=52.03959&lon=5.63154

The probleem is that the answer is not a json string, but a text file.

In configuration yaml I put:

rest:
  - resource: "http://gpsgadget.buienradar.nl/data/raintext?lat=52.03959&lon=5.63154"
    scan_interval: 3600
    sensor:
      - name: "Regenvoorspelling"
        value_template: ""

The sensor is there, but no value in it.

How should I change so that the values are loaded?

Remove your value_template line. You’ve asked it to transform the input into an empty string.

I have done that, but the sensor still has no value at all.
Log also shows no activity (for testing I changed interval to 60)

Have you reloaded?

It worked for me but gave me a “you’re not in Netherlands or Belgium” error in the state.

(removed incorrect advice about escaping ampersands)

Thats’it.

Thanks!!

Well,
It was almost it. I had to go away so I had no time to work it out further. Now I return and go on with HA, I see that the error comes because the & That breakes the input one or else way.
Sending in a webbrowser the string

http://gpsgadget.buienradar.nl/data/raintext?lat=52.03959&lon=5.63154

gives in the browser the same error.

The browser changes the input than to:

https://gpsgadget.buienradar.nl/data/raintext/?lat=52.04&lon=0

which is a coordinate far away from the netherlands
It seems to need the ampersand, so is there a way to get that in the rest-resource
I tried
(&), &#38, {{&}}, {{&}}, {{'&'}}, {{"&"}}, all with and without the complete line between " "but nothing works.

Any idea how to fix?

Ah, I thought it was complaining about my location. Revert to & — the problem is that the return value is more than the 255 character limit for a state.

Stand by, I’ll get you a fix.

Total response is less than 255 characters, and a fixed format…

It isn’t though, as the file has DOS line breaks (\r\n) adding two characters to each of the 11 lines, bring them to 24 characters per line = 264 total:

mark@NAS:/volume1/docker/homeassistant/config$ curl -s -o test.txt "https://br-gpsgadget.azurewebsites.net/data/raintext/?lat=52.04&lon=5.63" ; wc -c test.txt
264 test.txt

What information do you want? For example, this provides a sub-255-character JSON list with the start time followed by each value:

rest:
  - resource: http://gpsgadget.buienradar.nl/data/raintext?lat=52.03959&lon=5.63154
    scan_interval: 3600
    sensor:
      - name: "Regenvoorspelling"
        value_template: >-
          {% set ptl = value.split() %}
          {% set ns = namespace(pl=[]) %}
          {% for p in ptl %}
            {% set ns.pl = ns.pl + [{"time":p.split('|')[1],
                                     "rain":p.split('|')[0]}] %}
          {% endfor %}
          {{ ([ns.pl[0]["time"]]+ns.pl|map(attribute="rain")|list)|to_json }}

image

Some further ideas for you:

The “full list” (ns.ds here) is too big to be the state but you can have it as an intermediate step in your calculation of the final state.

I do only need the numbers (3 digits), not intereseted in the times.
From that digits it ois possible to calcultate how much rain is expected and that makes it possible for example to put in the sun-screen in time bij my home-domotica.

To sum the individual rainfall numbers across the forecast, this should work:

value_template: >-
  {{ ('["'~value.replace('\r','').replace('\n','","')|regex_replace("\|\d\d:\d\d",'')~'"]')|from_json|map('int')|list|sum }}

It builds up a string that looks like a list of values, converts it to an actual list of integers, then sums them all.

Hello,

I dit edit your code a bit, because there have to be made calculations before the right number is shown.
That’s done in my code.

Template tester:

{% set value = "077|21:25 000|21:30 000|21:35 000|21:40 000|21:45 000|21:50 000|21:55 000|22:00 000|22:05 000|22:10 000|22:15 000|22:20 000|22:25 000|22:30 000|22:35 000|22:40 000|22:45 000|22:50 000|22:55 000|23:00 000|23:05 000|23:10 000|23:15 000|23:20" %}
 
          {% set ptl = value.split() %}
          {% set ns = namespace(pl=[]) %}
          {% for p in ptl %}
          {% set ns.pl = ns.pl + [{"time":p.split('|')[1],
                                 "rain":(10**((p.split('|')[0] | float -109)/32))| round(1)} ] %}
          {% endfor %}
          {{ ([ns.pl[0]["time"]]+ns.pl|map(attribute="rain")|list)|to_json }}

It gives as outcome:

[
  "21:25",
  0.1,
  0.1,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0
]

The 0.1 is because I changed the string from “000” to “077” to check the calculation. That’s correct.

Problem is that the outcome is a list.
I need a couple of numbers (or a string to convert to float), to add some codes together and it looks loke a list cannot be split (al least I cannot)
So, seperate, item 1, 2, 3, 4 and combined 1+2+3+4+5+6

It’s now late in the evening, so tomorrow I go on with the testing and trying.

Not quite sure what you’re trying to do here. This applies your transformation (10**((x-109)/32)) to each item and adds the results together:

value_template: >-
  {% set list = ('["'~value.replace('\r','').replace('\n','","')|regex_replace("\|\d\d:\d\d",'')~'"]')|from_json|map('int')|list %}
  {% set ns = namespace(total=0.0) %}
  {% for item in list %}
    {% set ns.total = ns.total + 10**((item|float-109)/32) %}  
  {% endfor %}
  {{ ns.total|round(1) }}

If that’s not what you’re trying to achieve and need more help, have another go at asking with some pseudocode or examples.

Thanks a lot for your help!

Found at last the solution I was looking for.
Used your template to get the value from the url, then created input_number entities which get there value from an automation, extracted from the sensor you made. Works good!

1 Like

sorry to bump, but need some help getting data from this json feed

https://data.buienradar.nl/2.0/feed/json

ifI check that it brings below output. Of that I just want to create a sensor for the

  "forecast": {
    "$id": "44",
    "weatherreport": {
      "$id": "45",

and

    "shortterm": {
      "$id": "46",

and finally:

    "longterm": {
      "$id": "47",

The buienradar integration does not provide these more descriptive forecasts, and Id love to see them in a markdown or so.

Please help me out creating the correct rest sensor and have these attributes, or maybe even 3 separate ones, still requiring the text in an attribute because of 255 char limit.

my guess would be the state for 45 could be the “title”, and the other 2 take “startdate” as state?

Hope anyone can help please, thanks

Full (but abridged....) json output
{
  "$id": "1",
  "buienradar": {
    "$id": "2",
    "copyright": "(C)opyright Buienradar / RTL. Alle rechten voorbehouden",
    "terms": "Deze feed mag vrij worden gebruikt onder voorwaarde van bronvermelding buienradar.nl inclusief een hyperlink naar https://www.buienradar.nl. Aan de feed kunnen door gebruikers of andere personen geen rechten worden ontleend."
  },
  "actual": {
    "$id": "3",
    "actualradarurl": "https://api.buienradar.nl/image/1.0/RadarMapNL?w=500&h=512",
    "sunrise": "2024-09-29T07:36:00",
    "sunset": "2024-09-29T19:18:00",
    "stationmeasurements": [
      {
        "$id": "4",
        "stationid": 6391,
        "stationname": "Meetstation Arcen",
        "lat": 51.5,
        "lon": 6.2,
        "regio": "Venlo",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "OZO",
        "temperature": 13.4,
        "groundtemperature": 13.5,
        "feeltemperature": 13.4,
        "windgusts": 5.3,
        "windspeed": 2.8,
        "windspeedBft": 2,
        "humidity": 59,
        "precipitation": 0,
        "sunpower": 257,
        "rainFallLast24Hour": 1.4,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 113
      },
      {
        "$id": "5",
        "stationid": 6275,
        "stationname": "Meetstation Arnhem",
        "lat": 52.07,
        "lon": 5.88,
        "regio": "Arnhem",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "ZO",
        "airpressure": 1026.3,
        "temperature": 14.3,
        "groundtemperature": 15.2,
        "feeltemperature": 13.2,
        "visibility": 49800,
        "windgusts": 6.6,
        "windspeed": 4.3,
        "windspeedBft": 3,
        "humidity": 60,
        "precipitation": 0,
        "sunpower": 311,
        "rainFallLast24Hour": 0,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 131
      },
      {
        "$id": "6",
        "stationid": 6249,
        "stationname": "Meetstation Berkhout",
        "lat": 52.65,
        "lon": 4.98,
        "regio": "Berkhout",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Vrijwel onbewolkt (zonnig/helder)",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/a.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/A.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/a",
        "winddirection": "ZZO",
        "temperature": 14.7,
        "groundtemperature": 16.2,
        "feeltemperature": 13.3,
        "visibility": 26600,
        "windgusts": 8,
        "windspeed": 5.6,
        "windspeedBft": 4,
        "humidity": 59,
        "precipitation": 0,
        "sunpower": 509,
        "rainFallLast24Hour": 2.9,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 165
      },
      {
        "$id": "7",
        "stationid": 6260,
        "stationname": "Meetstation De Bilt",
        "lat": 52.1,
        "lon": 5.18,
        "regio": "Utrecht",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "ZZO",
        "airpressure": 1025.9,
        "temperature": 13.2,
        "groundtemperature": 13.4,
        "feeltemperature": 13.2,
        "visibility": 47300,
        "windgusts": 6.3,
        "windspeed": 3,
        "windspeedBft": 2,
        "humidity": 62,
        "precipitation": 0,
        "sunpower": 237,
        "rainFallLast24Hour": 0.1,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 154
      },
      {
        "$id": "8",
        "stationid": 6235,
        "stationname": "Meetstation Den Helder",
        "lat": 52.92,
        "lon": 4.78,
        "regio": "Den Helder",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "ZZO",
        "airpressure": 1025.2,
        "temperature": 15.2,
        "groundtemperature": 15.6,
        "feeltemperature": 15.2,
        "visibility": 42900,
        "windgusts": 6.7,
        "windspeed": 4.5,
        "windspeedBft": 3,
        "humidity": 57,
        "precipitation": 0,
        "sunpower": 545,
        "rainFallLast24Hour": 3.8,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 164
      },
      {
        "$id": "9",
        "stationid": 6370,
        "stationname": "Meetstation Eindhoven",
        "lat": 51.45,
        "lon": 5.42,
        "regio": "Eindhoven",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "OZO",
        "airpressure": 1025.8,
        "temperature": 13.8,
        "groundtemperature": 14.3,
        "feeltemperature": 13.8,
        "visibility": 39700,
        "windgusts": 5.3,
        "windspeed": 2.9,
        "windspeedBft": 2,
        "humidity": 63,
        "precipitation": 0,
        "sunpower": 258,
        "rainFallLast24Hour": 3.4,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 105
      },
      {
        "$id": "10",
        "stationid": 6377,
        "stationname": "Meetstation Ell",
        "lat": 51.2,
        "lon": 5.77,
        "regio": "Weert",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "O",
        "temperature": 13.7,
        "groundtemperature": 14.6,
        "feeltemperature": 12.7,
        "visibility": 88400,
        "windgusts": 5.4,
        "windspeed": 3.5,
        "windspeedBft": 3,
        "humidity": 65,
        "precipitation": 0,
        "sunpower": 303,
        "rainFallLast24Hour": 1.4,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 100
      },
      {
        "$id": "11",
        "stationid": 6350,
        "stationname": "Meetstation Gilze Rijen",
        "lat": 51.57,
        "lon": 4.93,
        "regio": "Gilze Rijen",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "ZO",
        "airpressure": 1025.6,
        "temperature": 13.6,
        "groundtemperature": 14.1,
        "feeltemperature": 12.6,
        "visibility": 44200,
        "windgusts": 5.4,
        "windspeed": 3.5,
        "windspeedBft": 3,
        "humidity": 64,
        "precipitation": 0,
        "sunpower": 255,
        "rainFallLast24Hour": 0.1,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 126
      },
      {
        "$id": "12",
        "stationid": 6323,
        "stationname": "Meetstation Goes",
        "lat": 51.53,
        "lon": 3.9,
        "regio": "Goes",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "ZO",
        "airpressure": 1024.8,
        "temperature": 13.2,
        "groundtemperature": 13.7,
        "feeltemperature": 11.6,
        "windgusts": 6.2,
        "windspeed": 4.8,
        "windspeedBft": 3,
        "humidity": 59,
        "precipitation": 0,
        "sunpower": 266,
        "rainFallLast24Hour": 0,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 143
      },
      {
        "$id": "13",
        "stationid": 6283,
        "stationname": "Meetstation Groenlo-Hupsel",
        "lat": 52.07,
        "lon": 6.65,
        "regio": "Oost-Overijssel",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Vrijwel onbewolkt (zonnig/helder)",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/a.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/A.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/a",
        "winddirection": "ZO",
        "temperature": 14.5,
        "groundtemperature": 14.1,
        "feeltemperature": 14.5,
        "windgusts": 4,
        "windspeed": 2.2,
        "windspeedBft": 2,
        "humidity": 63,
        "precipitation": 0,
        "sunpower": 435,
        "rainFallLast24Hour": 1.6,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 146
      },
      {
        "$id": "14",
        "stationid": 6280,
        "stationname": "Meetstation Groningen",
        "lat": 53.13,
        "lon": 6.58,
        "regio": "Groningen",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Vrijwel onbewolkt (zonnig/helder)",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/a.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/A.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/a",
        "winddirection": "ZZW",
        "airpressure": 1026.6,
        "temperature": 14.7,
        "groundtemperature": 17.4,
        "feeltemperature": 13.9,
        "visibility": 32800,
        "windgusts": 6.7,
        "windspeed": 3.6,
        "windspeedBft": 3,
        "humidity": 55,
        "precipitation": 0,
        "sunpower": 466,
        "rainFallLast24Hour": 0.5,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 204
      },
      {
        "$id": "15",
        "stationid": 6278,
        "stationname": "Meetstation Heino",
        "lat": 52.43,
        "lon": 6.27,
        "regio": "Zwolle",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Vrijwel onbewolkt (zonnig/helder)",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/a.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/A.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/a",
        "winddirection": "ZZO",
        "temperature": 14.7,
        "groundtemperature": 16.6,
        "feeltemperature": 14.7,
        "windgusts": 5.8,
        "windspeed": 3,
        "windspeedBft": 2,
        "humidity": 58,
        "precipitation": 0,
        "sunpower": 542,
        "rainFallLast24Hour": 0.1,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 149
      },
      {
        "$id": "40",
        "stationid": 6248,
        "stationname": "Meetstation Wijdenes",
        "lat": 52.63,
        "lon": 5.17,
        "regio": "Hoorn",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "Z",
        "windgusts": 6.5,
        "windspeed": 4.8,
        "windspeedBft": 3,
        "winddirectiondegrees": 171
      },
      {
        "$id": "41",
        "stationid": 6257,
        "stationname": "Meetstation Wijk aan Zee",
        "lat": 52.5,
        "lon": 4.6,
        "regio": "Wijk aan Zee",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "temperature": 13.9,
        "groundtemperature": 15.2,
        "humidity": 55,
        "precipitation": 0,
        "sunpower": 295,
        "rainFallLast24Hour": 0.1,
        "rainFallLastHour": 0
      },
      {
        "$id": "42",
        "stationid": 6340,
        "stationname": "Meetstation Woensdrecht",
        "lat": 51.45,
        "lon": 4.33,
        "regio": "Woensdrecht",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "ZO",
        "airpressure": 1025.4,
        "temperature": 13.1,
        "groundtemperature": 13.3,
        "feeltemperature": 13.1,
        "visibility": 44600,
        "windgusts": 4.2,
        "windspeed": 2.4,
        "windspeedBft": 2,
        "humidity": 63,
        "precipitation": 0,
        "rainFallLast24Hour": 0,
        "rainFallLastHour": 0,
        "winddirectiondegrees": 127
      },
      {
        "$id": "43",
        "stationid": 6239,
        "stationname": "Meetstation Zeeplatform F-3",
        "lat": 54.85,
        "lon": 4.73,
        "regio": "Noordzee",
        "timestamp": "2024-09-29T14:50:00",
        "weatherdescription": "Zwaar bewolkt",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/c.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/C.png",
        "graphUrl": "https://www.buienradar.nl/nederland/weerbericht/weergrafieken/c",
        "winddirection": "ZZW",
        "airpressure": 1024.2,
        "temperature": 14.2,
        "feeltemperature": 12.5,
        "visibility": 47900,
        "windgusts": 9.3,
        "windspeed": 6.4,
        "windspeedBft": 4,
        "humidity": 64,
        "winddirectiondegrees": 212
      }
    ]
  },
  "forecast": {
    "$id": "44",
    "weatherreport": {
      "$id": "45",
      "published": "2024-09-29T12:45:00",
      "title": "Toenemende sluierbewolking",
      "summary": "Vandaag is het zonnig en blijft het overal droog. Vanuit het zuidwesten neemt de bewolking echter wel toe en dat is een voorbode voor de maandag... Het natte en soms winderige herfstweer doet dan opnieuw zijn intrede, maar niet voor lang!",
      "text": "Vandaag is het zonnig en blijft het overal droog. Vanuit het zuidwesten neemt de bewolking echter wel toe en dat is een voorbode voor de maandag... Het natte en soms winderige herfstweer doet dan opnieuw zijn intrede, maar niet voor lang!Vandaag is er vrij veel zon, al zullen de strakblauwe luchten waar we vooral vanochtend nog mee te maken hadden steeds vaker schuilgaan achter wat (sluier)bewolking. Vanuit het zuidwesten neemt de bewolking op nadering van een storing namelijk toe, maar het blijft voorlopig nog wel droog. De temperatuur bereikt vanmiddag maximaal 15 of 16 graden en doordat er slechts een zwakke tot matige wind staat uit het zuiden tot zuidoosten kan het in de zon best lekker aanvoelen.Vanavond trekt een dik pak hoge (sluier)bewolking over ons land, maar regen valt hier niet uit. Richting middernacht klaart het op veel plekken weer even breed op, maar in Zeeland dient zich dan alweer nieuwe bewolking aan. De zuidoostenwind begint toe te nemen en wordt matig boven land tot vrij krachtig aan zee.Vannacht breidt de bewolking zich opnieuw uit van zuidwest naar noordoost over ons land. Pas in de late nacht vallen hieruit de eerste regendruppels in het zuiden van het land. Door de bewolking koelt het niet meer zo hard af als afgelopen nacht en liggen de minima rond 7 of 8 graden. Aan de kust is het nog iets zachter met 9 tot 11 graden.Morgen beginnen we in de zuidelijke helft van het land grijs en kan daar wat lichte regen vallen, in het noorden en oosten is dan nog even de zon te zien en is het droog. Morgenmiddag gaat het in het zuidwesten wat meer doorregenen en dit breidt zich verder over het land uit, al kan het in het uiterste noordoosten nog tot aan de avond droog blijven. De temperatuur bereikt opnieuw ongeveer de 15 graden en de zuidoostenwind waait stevig door tot mogelijk krachtig langs de kust. Morgen eind van de middag en in de avond draait de wind langs de kust naar het zuidwesten en neemt daar toe tot mogelijk hard (windkracht 7) met in de late avond een toenemende kans op zware windstoten.De dagen erna krijgen we op dinsdag te maken met veel wind en komt het mogelijk weer tot zware windstoten aan de kust. Ook is het die dag nat met flink wat regen. Vanaf woensdag volgt een weersverbetering en vanaf donderdag blijft het zelfs een aantal dagen droog met meer zon. De middagtemperaturen liggen vaak tussen de 15 en 16 graden en vooral de nachten kunnen later volgende week weer koud uitpakken.",
      "author": "Philippe Schambergen",
      "authorbio": "Sinds 2017 als junior Meteoroloog actief voor het weekendteam van Buienradar.  Daarnaast student van de Bachelor Bodem, Water & Atmosfeer aan de Wageningen Universiteit."
    },
    "shortterm": {
      "$id": "46",
      "startdate": "2024-09-30T00:00:00",
      "enddate": "2024-10-04T00:00:00",
      "forecast": "Eerst sterk wisselvallig met veel regen en wind, vanaf donderdag overwegend droog en meer zon. Vrij koel.\n"
    },
    "longterm": {
      "$id": "47",
      "startdate": "2024-10-05T00:00:00",
      "enddate": "2024-10-09T00:00:00",
      "forecast": "Grote (ca. 70%) kans op een wisselvallig weertype bij maxima die geleidelijk onder normaal dalen. "
    },
    "fivedayforecast": [
      {
        "$id": "48",
        "day": "2024-09-29T00:00:00",
        "mintemperature": "2/5",
        "maxtemperature": "15",
        "mintemperatureMax": 5,
        "mintemperatureMin": 2,
        "maxtemperatureMax": 15,
        "maxtemperatureMin": 15,
        "rainChance": 10,
        "sunChance": 50,
        "windDirection": "zo",
        "wind": 3,
        "mmRainMin": 0,
        "mmRainMax": 0,
        "weatherdescription": "Mix van opklaringen en middelbare of lage bewolking",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/b.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/B.png"
      },
      {
        "$id": "49",
        "day": "2024-09-30T00:00:00",
        "mintemperature": "8",
        "maxtemperature": "16",
        "mintemperatureMax": 8,
        "mintemperatureMin": 8,
        "maxtemperatureMax": 16,
        "maxtemperatureMin": 16,
        "rainChance": 70,
        "sunChance": 20,
        "windDirection": "z",
        "wind": 4,
        "mmRainMin": 5,
        "mmRainMax": 15,
        "weatherdescription": "Zwaar bewolkt en regen",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/q.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/Q.png"
      },
      {
        "$id": "50",
        "day": "2024-10-01T00:00:00",
        "mintemperature": "11",
        "maxtemperature": "16",
        "mintemperatureMax": 11,
        "mintemperatureMin": 11,
        "maxtemperatureMax": 16,
        "maxtemperatureMin": 16,
        "rainChance": 70,
        "sunChance": 20,
        "windDirection": "zw",
        "wind": 5,
        "mmRainMin": 10,
        "mmRainMax": 20,
        "weatherdescription": "Zwaar bewolkt en regen",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/q.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/Q.png"
      },
      {
        "$id": "51",
        "day": "2024-10-02T00:00:00",
        "mintemperature": "10",
        "maxtemperature": "15",
        "mintemperatureMax": 10,
        "mintemperatureMin": 10,
        "maxtemperatureMax": 15,
        "maxtemperatureMin": 15,
        "rainChance": 40,
        "sunChance": 30,
        "windDirection": "n",
        "wind": 3,
        "mmRainMin": 0,
        "mmRainMax": 3,
        "weatherdescription": "Afwisselend bewolkt met (mogelijk) wat lichte regen",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/f.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/F.png"
      },
      {
        "$id": "52",
        "day": "2024-10-03T00:00:00",
        "mintemperature": "5/10",
        "maxtemperature": "15",
        "mintemperatureMax": 10,
        "mintemperatureMin": 5,
        "maxtemperatureMax": 15,
        "maxtemperatureMin": 15,
        "rainChance": 10,
        "sunChance": 40,
        "windDirection": "no",
        "wind": 2,
        "mmRainMin": 0,
        "mmRainMax": 0,
        "weatherdescription": "Mix van opklaringen en middelbare of lage bewolking",
        "iconurl": "https://www.buienradar.nl/resources/images/icons/weather/30x30/b.png",
        "fullIconUrl": "https://www.buienradar.nl/resources/images/icons/weather/96x96/B.png"
      }
    ]
  }
}

jsonpathfinder shows me:

but I am never sure how to create that into an actual rest sensor…

I started with:

rest:

  - resource: https://data.buienradar.nl/2.0/feed/json
    scan_interval: 86400
    sensor:
      - unique_id: rest_sensor_buienradar_weather_report
        value_template: >
          {{value_json.forecast.weatherreport.title}}
        json_attributes_path: "$.weatherreport"
        json_attributes:
          - summary
          - text

and that is partly successful, state is correct, but no attributes are created:

update

nevermind… user error here. I simply had to reuse the full attributes path:

rest:

  - resource: https://data.buienradar.nl/2.0/feed/json
    scan_interval: 86400
    sensor:
      - unique_id: rest_sensor_buienradar_weather_report
        value_template: >
          {{value_json.forecast.weatherreport.title}}
        json_attributes_path: "$.forecast.weatherreport"
        json_attributes:
          - summary
          - text

and all three:

rest:

  - resource: https://data.buienradar.nl/2.0/feed/json
    scan_interval: 86400
    sensor:
      - unique_id: rest_sensor_buienradar_weatherreport
        value_template: >
          {{value_json.forecast.weatherreport.title}}
        json_attributes_path: '$.forecast.weatherreport'
        json_attributes:
          - summary
          - text

      - unique_id: rest_sensor_buienradar_shortterm
        value_template: >
          {{value_json.forecast.shortterm.startdate}}
        json_attributes_path: '$.forecast.shortterm'
        json_attributes:
          - forecast
          - startdate
          - enddate

      - unique_id: rest_sensor_buienradar_longterm
        value_template: >
          {{value_json.forecast.longterm.startdate}}
        json_attributes_path: '$.forecast.longterm'
        json_attributes:
          - forecast
          - startdate
          - enddate