For my first effort I’m trying to write a program for a ESP8266-E12 in the arduino IDE.
The overall objective of the program is retrieve the half hourly price data from Octopus Energy’s API and then either turn on or off a relay depending upon the price.
So far, using various tutorials and example code, I can connect to the wifi, get the sntp time, print to the serial port the time in the right format for now and 30 mins ahead and get the JSON price data from Octopus using a fixed URL.
What I’m having problems with is getting the time data into the URL. The only way I can see do it is to convert each of year, month, day, hour, minute, colons and letters required into lots of strings and then add them into one big string.
is there a more efficient way?
time_got_json_got_making_link.ino (6.01 KB)