[Tibber] "time until rise/drop in price level" would be a nice to have

I’m using tibber to make my home heating run primarily in times of cheap electricity. Tibber offers a valuation of the energy price as “VERY CHEAP, CHEAP […] VERY EXPENSIVE”. Problem is, that long periods of “CHEAP” tend to overheat my floors, so I’d like to start heating them up only if it’s 5 hours or less until the next price rise. Currently, there is no access to that future data. Something like the “Sun” sensor which can be used to start things a certain time before sunset or sunrise would be nice to have.

Here’s some sample data from the API for that:

{
  viewer {
    home(id: "xxxx") {
      currentSubscription {
        priceInfo {
          today {
            level
            startsAt
          }
          tomorrow {
            level
            startsAt
          }
        }
      }
    }
  }
}

…returns:

{
  "data": {
    "viewer": {
      "home": {
        "currentSubscription": {
          "priceInfo": {
            "today": [
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T00:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T01:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T02:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T03:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T04:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T05:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T06:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T07:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T08:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T09:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T10:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T11:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T12:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T13:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T14:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T15:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T16:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-29T17:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-29T18:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-29T19:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T20:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-29T21:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-29T22:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-29T23:00:00.000+01:00"
              }
            ],
            "tomorrow": [
              {
                "level": "CHEAP",
                "startsAt": "2023-12-30T00:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-30T01:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-30T02:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-30T03:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-30T04:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-30T05:00:00.000+01:00"
              },
              {
                "level": "CHEAP",
                "startsAt": "2023-12-30T06:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-30T07:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-30T08:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-30T09:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-30T10:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-30T11:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-30T12:00:00.000+01:00"
              },
              {
                "level": "NORMAL",
                "startsAt": "2023-12-30T13:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T14:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T15:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T16:00:00.000+01:00"
              },
              {
                "level": "VERY_EXPENSIVE",
                "startsAt": "2023-12-30T17:00:00.000+01:00"
              },
              {
                "level": "VERY_EXPENSIVE",
                "startsAt": "2023-12-30T18:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T19:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T20:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T21:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T22:00:00.000+01:00"
              },
              {
                "level": "EXPENSIVE",
                "startsAt": "2023-12-30T23:00:00.000+01:00"
              }
            ]
          }
        }
      }
    }
  }
}