Octopus Energy Agile Tariff

thanks for your reply stefano, i tried that but get an error: UndefinedError: None has no element 0
i tried replacing your binary_sensor with the octoblock sensor: sensor.octopus_1hour_time
and still get the same error, ive been reading the post The EPIC Time Conversion and Manipulation Thread! and am no closer to understanding how to achieve what i need as it is for people who already have a decent knowledge of scripting. i may have to start learning python script though it seems like a lot of effort for something that will be quite easy for some of the advanced members of this community.