Good point! also noted that @Paul1964 has a solution to that.
The only problem is if we trigger it a minute late is that we need to ask the API for the exact half an hour time slot - eg it must be 15:00 to 15:30. If we ask for 15:01 to 15:31 it’ll actually report back the full hours pricing (which includes 15:00 to 15:30 and 15:30 to 16:00) and the formula won’t work.
Perhaps we could somehow round the time up or down? So if it’s 15:27 it gets rounded down to 15:00 and if its past half the an hour mark it’s rounded down to 15:30 - and the 2nd part is requested in sync.
Any input on that? I think actually the waiting 5 seconds might be the most accurate.