Yr welcome. It all depends on what you want to achieve of course. Iâve noticed the calculations with time are easier with UNIX time, but if your input is limited, you could do without
I figured Unix time was a pain, but it is really easy with the Time library if you take a little time (pun intended) to study it
@Dmitriy for me it would just be sunrise and sunset at the moment as any âtwilightâ adjustments could be done with a slider. Ideally though all fields from all APIâs should be available. Not an easy task I know.
Perhaps I should rephrase that. Say X number of fields to be available from each API. So all fields technically being available but a limitation on how many can be used within Blynk at any one time. As you will know some APIâs have hundreds of fields and it wouldnât be practical to be working on all of them within Blynk.
I have very simple idea in case you need only 1 field. But I donât know how to deal with many fields. For example in case you need only 1 field from above response you could specify in widget :
results.sunrise
and Blynk will return you only 1 string 5:43:55 AM
@Lichtsignaal itâs an excellent library that I use on a regular basis and by far the most popular Json parser there is. I wouldnât normally recommend âmanualâ parsing.
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <WiFi.h>
#include <BlynkSimpleWifi.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "802d623481724fedaabf96aa31e3a174";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "FRITZ!Box Fon WLAN 7390";
char pass[] = "4506523768287213";
char server_ip[] = "192.168.1.110";
int port = 8442;
void setup() {
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, server_ip, port);
}
void loop(){
Blynk.run();
}
BLYNK_CONNECTED() {
Serial.println("BLYNK_CONNECTED()");
Blynk.virtualWrite(V0, "");
}
BLYNK_WRITE(V0) {
Serial.println("BLYNK_WRITE(V0)");
String value = param.asStr();
Serial.println(value);
}
BLYNK_WRITE(V1) {
Serial.println("BLYNK_WRITE(V1)");
int value = param.asInt();
Serial.println(value);
if (value == 1) Blynk.virtualWrite(V0, "");
}
Unfortunately Iâve no data back from web⌠whatâs wrong?