Extracting data from complex sensor

This thread may help. Octopus Agile is a ToU tariff with half-hourly price updates, and there were a few solutions (including one I did) to work out the cheapest blocks of various lengths. AppDaemon is useful for this sort of thing.