With the help of a REST API request, I get the consumption of hot water supply and cold water supply divided by the months 2020 and 2021.
My question is, how correctly and beautifully could this data be processed and displayed in the Lovelace Homeassistant? Does anyone have any ideas on how to do this correctly?
Here’s an example of what I get with a REST API request:
{
"success": true,
"data": {
"isAvailable": true,
"placeholder": {
"emoji": "👀",
"title": "....",
"description": "....."
},
"items": [{
"title": "Cold water consumption",
"color": "#4CBBF1",
"measureUnitTitle": "m³",
"years": [{
"id": 2020,
"summary": {
"delta": 46.05
},
"months": [null, null, null, {
"id": 4,
"value": "136.59",
"prevValue": "132.0900",
"delta": "4.5"
}, {
"id": 5,
"value": "141.697",
"prevValue": "136.5900",
"delta": "5.107"
}, {
"id": 6,
"value": "145.537",
"prevValue": "141.6970",
"delta": "3.84"
}, {
"id": 7,
"value": "149.94",
"prevValue": "145.5370",
"delta": "4.403"
}, {
"id": 8,
"value": "155.907",
"prevValue": "149.9400",
"delta": "5.967"
}, {
"id": 9,
"value": "161.907",
"prevValue": "155.9070",
"delta": "6"
}, {
"id": 10,
"value": "167.66",
"prevValue": "161.9070",
"delta": "5.753"
}, {
"id": 11,
"value": "173.36",
"prevValue": "167.6600",
"delta": "5.7"
}, {
"id": 12,
"value": "178.14",
"prevValue": "173.3600",
"delta": "4.78"
}]
}, {
"id": 2021,
"summary": {
"delta": 15.43
},
"months": [{
"id": 1,
"value": "181.86",
"prevValue": "178.1400",
"delta": "3.72"
}, {
"id": 2,
"value": "186.81",
"prevValue": "181.8600",
"delta": "4.95"
}, {
"id": 3,
"value": "191.48",
"prevValue": "186.8100",
"delta": "4.67"
}, {
"id": 4,
"value": "193.57",
"prevValue": "191.4800",
"delta": "2.09"
}, null, null, null, null, null, null, null, null]
}]
}, {
"title": "Hot water consumption",
"color": "#F82649",
"measureUnitTitle": "m³",
"years": [{
"id": 2020,
"summary": {
"delta": 29.23
},
"months": [null, null, null, {
"id": 4,
"value": "94.5",
"prevValue": "91.0100",
"delta": "3.49"
}, {
"id": 5,
"value": "98.062",
"prevValue": "94.5000",
"delta": "3.562"
}, {
"id": 6,
"value": "100.462",
"prevValue": "98.0620",
"delta": "2.4"
}, {
"id": 7,
"value": "102.1",
"prevValue": "100.4620",
"delta": "1.638"
}, {
"id": 8,
"value": "105.112",
"prevValue": "102.1000",
"delta": "3.012"
}, {
"id": 9,
"value": "108.732",
"prevValue": "105.1120",
"delta": "3.62"
}, {
"id": 10,
"value": "112.3",
"prevValue": "108.7320",
"delta": "3.568"
}, {
"id": 11,
"value": "116.74",
"prevValue": "112.3000",
"delta": "4.44"
}, {
"id": 12,
"value": "120.24",
"prevValue": "116.7400",
"delta": "3.5"
}]
}, {
"id": 2021,
"summary": {
"delta": 15.42
},
"months": [{
"id": 1,
"value": "123.03",
"prevValue": "120.2400",
"delta": "2.79"
}, {
"id": 2,
"value": "126.91",
"prevValue": "123.0300",
"delta": "3.88"
}, {
"id": 3,
"value": "130.84",
"prevValue": "126.9100",
"delta": "3.93"
}, {
"id": 4,
"value": "135.66",
"prevValue": "130.8400",
"delta": "4.82"
}, null, null, null, null, null, null, null, null]
}]
}]
}
}