Smart home

Upgrade your smart lights

By The IFTTT Team

April 13, 2022

Upgrade your smart lights

Our most popular smart lights Applets just got a major upgrade using a query from the Weather Underground service and filter code.

See the upgrade in action.

The IFTTT Team edited this popular Applet and added new filter code. If it's sunny outside, the Applet will skip its action. This way, the Applet action only fires when you actually need your lights on.

This Applet upgrade is available for all the lighting services on IFTTT. Use the filter code to make your own, or enable the Applets we published.

All IFTTT users can edit existing Applets and enable an unlimited number of Published Applets. Search through the Explore page to find an existing Applet to make your own.

explore-applet

The IFTTT Team edited this lighting Applet based on requests from our community. We used filter code to specify which conditions are favorable for this Applet to run its action. If it's sunny outside, then the Applet will skip its action. Whenever skies are dark or the sun has already set, then the Applet will run.

Use this filter code with the other lighting services on IFTTT by replacing the action "Hue.turnOnAllHue.skip" with the desired action. Filter code funnel

Filter Code

Write JavaScript code to override action fields and skip actions. All actions will run unless you explicitly skip them. Check out this help center article for more information and examples.

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(Its still daytime so we're leaving the lights off);
}

All IFTTT users can enable an unlimited amount of Applets. Try this upgraded lighting Applet for yourself.

Enable lighting Applet button