Convert data to forecast card

I’ve got a basic understanding of home assistant at this point, but this idea is a little out of my depth.

I’m running a REST query for some external data that provides a local forecast of the fire danger rating in my area. I’ve got it working for the current day, but unsure how to go about creating a forecast of the next 3-5 days.

The single day was easy enough using the gauge card:

image

Does anyone have any knowledge of cards that would let me take the data to a forecast much like a weather card, or would this have to be something entirely custom?

I can change how the JSON/Array is presented. At the moment it looks like this. Each date is on a scale from 1-5.

[
  "2023-01-31" => [
  "adjr" => 1,
  ],
  "2023-02-01" => [
  "adjr" => 1,
  ],
  "2023-02-02" => [
  "adjr" => 1,
  ],
  "2023-02-03" => [
  "adjr" => 1,
  ],
  "2023-02-04" => [
  "adjr" => 1,
  ],
  "2023-02-05" => [
  "adjr" => 1,
  ],
  "2023-02-06" => [
  "adjr" => 1,
  ],
  "2023-02-07" => [
  "adjr" => 2,
  ],
]

Depends on what you want your output to look like. If you can live with apexcharts e.g. column or points then you could try to read the above json into a sensor with attributes, e.g. I would put the ‘today’ value as a state and the forecast in a ‘forecast’ attribute. Then apexc can extract them.

Here’s an example with another source to covert to attribute… seems a bit ‘off’ but it works

  - platform: command_line
    name: testevents
    scan_interval: 1500
    command: >
         echo "{\"events\":" $(
         curl 
         -s 
         'https://api.fingrid.fi/v1/variable/336/events/json?start_time={{ (now()-timedelta(hours=4)).strftime('%Y-%m-%dT%H:%M:%SZ') }}&end_time={{ (now()+timedelta(hours=12)).strftime('%Y-%m-%dT%H:%M:%SZ') }}'
         ) "}" 
    value_template: > 
        {{ value_json.events | length }}
    json_attributes:
        - events