Is it possible to display Gas and Electricity usage on statistics graph? Like a bar chart showing how much was used of each every hour over a 24 hour period?
I’m using the very good HomeAssistant-OctopusEnergy integration. It provides usage data for the past 24 hours via the Smart Metre / Octopus’ API. It’d be handy to see what the busy times of usage are for Gas and Electricity in my house.
The integration provides an array showing how much of each resource was used in a 30 min period. There’s a lot of data, but I’m not sure how to turn this into a way that can be displayed as a bar chart in a UI?
Example array in one of the Integration>Sensor>Attributes.
e.g. sensor.octopus_energy_gas_XXXXXX_previous_accumulative_cost → Arrtibutes → Charges
[{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 0, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 0, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 0, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 1, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 1, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 1, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 1, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 2, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 2, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 2, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 2, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 3, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 3, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 3, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 3, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 4, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 4, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 4, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 4, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 5, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 5, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 5, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 5, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 6, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 6, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 6, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 6, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 7, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '4.522 kWh',
'cost': '£0.4',
'from': datetime.datetime(2022, 11, 4, 7, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 7, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '2.738 kWh',
'cost': '£0.24',
'from': datetime.datetime(2022, 11, 4, 7, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 8, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '1.295 kWh',
'cost': '£0.11',
'from': datetime.datetime(2022, 11, 4, 8, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 8, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 8, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 9, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 9, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 9, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.148 kWh',
'cost': '£0.01',
'from': datetime.datetime(2022, 11, 4, 9, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 10, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 10, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 10, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 10, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 11, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.182 kWh',
'cost': '£0.02',
'from': datetime.datetime(2022, 11, 4, 11, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 11, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.102 kWh',
'cost': '£0.01',
'from': datetime.datetime(2022, 11, 4, 11, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 12, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 12, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 12, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 12, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 13, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.25 kWh',
'cost': '£0.02',
'from': datetime.datetime(2022, 11, 4, 13, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 13, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.068 kWh',
'cost': '£0.01',
'from': datetime.datetime(2022, 11, 4, 13, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 14, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 14, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 14, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.057 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 14, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 15, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 15, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 15, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 15, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 16, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 16, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 16, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 16, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 17, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 17, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 17, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.045 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 17, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 18, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.636 kWh',
'cost': '£0.06',
'from': datetime.datetime(2022, 11, 4, 18, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 18, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '1.068 kWh',
'cost': '£0.09',
'from': datetime.datetime(2022, 11, 4, 18, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 19, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.091 kWh',
'cost': '£0.01',
'from': datetime.datetime(2022, 11, 4, 19, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 19, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 19, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 20, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '5.659 kWh',
'cost': '£0.5',
'from': datetime.datetime(2022, 11, 4, 20, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 20, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '3.443 kWh',
'cost': '£0.3',
'from': datetime.datetime(2022, 11, 4, 20, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 21, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '1.716 kWh',
'cost': '£0.15',
'from': datetime.datetime(2022, 11, 4, 21, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 21, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '3.045 kWh',
'cost': '£0.27',
'from': datetime.datetime(2022, 11, 4, 21, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 22, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '2.977 kWh',
'cost': '£0.26',
'from': datetime.datetime(2022, 11, 4, 22, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 22, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.148 kWh',
'cost': '£0.01',
'from': datetime.datetime(2022, 11, 4, 22, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 23, 0, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 23, 0, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 4, 23, 30, tzinfo=datetime.timezone.utc)},
{'consumption': '0.0 kWh',
'cost': '£0.0',
'from': datetime.datetime(2022, 11, 4, 23, 30, tzinfo=datetime.timezone.utc),
'rate': '8.7675p',
'to': datetime.datetime(2022, 11, 5, 0, 0, tzinfo=datetime.timezone.utc)}]