Skip to content

Commit

Permalink
[tibber] add level to today_prices and tomorrow_prices (#17916)
Browse files Browse the repository at this point in the history
Fixes #17915

Signed-off-by: Tom Quist <[email protected]>
  • Loading branch information
tomquist authored Dec 18, 2024
1 parent f45f29f commit f78c618
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 25 deletions.
72 changes: 48 additions & 24 deletions bundles/org.openhab.binding.tibber/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,99 +115,123 @@ Example of tomorrow and today prices data structure - an array of tuples:
[
{
"startsAt": "2022-09-27T00:00:00.000+02:00",
"total": 3.8472
"total": 3.8472,
"level": "NORMAL"
},
{
"startsAt": "2022-09-27T01:00:00.000+02:00",
"total": 3.0748
"total": 3.0748,
"level": "NORMAL"
},
{
"startsAt": "2022-09-27T02:00:00.000+02:00",
"total": 2.2725
"total": 2.2725,
"level": "CHEAP"
},
{
"startsAt": "2022-09-27T03:00:00.000+02:00",
"total": 2.026
"total": 2.026,
"level": "VERY_CHEAP"
},
{
"startsAt": "2022-09-27T04:00:00.000+02:00",
"total": 2.6891
"total": 2.6891,
"level": "CHEAP"
},
{
"startsAt": "2022-09-27T05:00:00.000+02:00",
"total": 3.7821
"total": 3.7821,
"level": "NORMAL"
},
{
"startsAt": "2022-09-27T06:00:00.000+02:00",
"total": 3.9424
"total": 3.9424,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T07:00:00.000+02:00",
"total": 4.158
"total": 4.158,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T08:00:00.000+02:00",
"total": 4.2648
"total": 4.2648,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T09:00:00.000+02:00",
"total": 4.2443
"total": 4.2443,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T10:00:00.000+02:00",
"total": 4.2428
"total": 4.2428,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T11:00:00.000+02:00",
"total": 4.2061
"total": 4.2061,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T12:00:00.000+02:00",
"total": 4.1458
"total": 4.1458,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T13:00:00.000+02:00",
"total": 3.9396
"total": 3.9396,
"level": "NORMAL"
},
{
"startsAt": "2022-09-27T14:00:00.000+02:00",
"total": 3.8563
"total": 3.8563,
"level": "NORMAL"
},
{
"startsAt": "2022-09-27T15:00:00.000+02:00",
"total": 4.0364
"total": 4.0364,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T16:00:00.000+02:00",
"total": 4.093
"total": 4.093,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T17:00:00.000+02:00",
"total": 4.1823
"total": 4.1823,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T18:00:00.000+02:00",
"total": 4.2779
"total": 4.2779,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T19:00:00.000+02:00",
"total": 4.3154
"total": 4.3154,
"level": "VERY_EXPENSIVE"
},
{
"startsAt": "2022-09-27T20:00:00.000+02:00",
"total": 4.3469
"total": 4.3469,
"level": "VERY_EXPENSIVE"
},
{
"startsAt": "2022-09-27T21:00:00.000+02:00",
"total": 4.2329
"total": 4.2329,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T22:00:00.000+02:00",
"total": 4.1014
"total": 4.1014,
"level": "EXPENSIVE"
},
{
"startsAt": "2022-09-27T23:00:00.000+02:00",
"total": 4.0265
"total": 4.0265,
"level": "EXPENSIVE"
}
]
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public InputStream connectionInputStream(String homeId) {

public InputStream getInputStream(String homeId) {
String query = "{\"query\": \"{viewer {home (id: \\\"" + homeId
+ "\\\") {currentSubscription {priceInfo {current {total startsAt level } tomorrow { startsAt total } today { startsAt total }}} daily: consumption(resolution: DAILY, last: 1) {nodes {from to cost unitPrice consumption consumptionUnit}} hourly: consumption(resolution: HOURLY, last: 1) {nodes {from to cost unitPrice consumption consumptionUnit}}}}}\"}";
+ "\\\") {currentSubscription {priceInfo {current {total startsAt level } tomorrow { startsAt total level } today { startsAt total level }}} daily: consumption(resolution: DAILY, last: 1) {nodes {from to cost unitPrice consumption consumptionUnit}} hourly: consumption(resolution: HOURLY, last: 1) {nodes {from to cost unitPrice consumption consumptionUnit}}}}}\"}";
return new ByteArrayInputStream(query.getBytes(StandardCharsets.UTF_8));
}

Expand Down

0 comments on commit f78c618

Please sign in to comment.