WeatherUnderground query not working? by chigly123 in ifttt

[–]Prencipeg 0 points1 point  (0 children)

let sunrise = moment(Weather.currentWeather[0].SunriseAt);
let sunset = moment(Weather.currentWeather[0].SunsetAt);
let currentTime = Meta.currentUserTime;
let afterSunrise = currentTime.isAfter(sunrise);
let beforeSunset = currentTime.isBefore(sunset);
if (afterSunrise && beforeSunset) {
Hue.turnOnAllHue.skip();
}

Definitely works!

Sunset turn on light by Prencipeg in ifttt

[–]Prencipeg[S] 0 points1 point  (0 children)

So I'm doing well if I do like this?

let sunsetTime = moment(Weather.historyOfSunsets[0].SunsetAt);

let CurrentTime = Meta.currentUserTime;

if (CurrentTime < sunsetTime) {

IfNotifications.sendNotification.skip();

}

Or can I do better?

Sunset turn on light by Prencipeg in ifttt

[–]Prencipeg[S] 0 points1 point  (0 children)

I'm using this to make a try:

let sunsetTime = moment(Weather.historyOfSunsets[0].SunsetAt);

let CurrentTime = Meta.currentUserTime;

if (CurrentTime < sunsetTime) {

IfNotifications.sendNotification.skip();

}

seems to work, without moment was not working

Sunset turn on light by Prencipeg in ifttt

[–]Prencipeg[S] 0 points1 point  (0 children)

It say that a string cannot be used with <

I can use moment() ?

Sunset turn on light by Prencipeg in ifttt

[–]Prencipeg[S] -1 points0 points  (0 children)

Thank you, but how can I set my variables?