WLED Android Tasker MacroDroid Light Alerts WLED Max How-To

WLED With Tasker and MacroDroid on Android

Automate WLED on Android with a Tasker or MacroDroid HTTP request to the JSON API, plus notification, NFC and time triggers.

By Published Updated on

If you already use Tasker or MacroDroid, you can drive WLED today with one HTTP request. Nothing else to install. The light listens at http://<light-ip>/json/state, and any trigger those apps know about can hit it: a notification, an NFC tag, a time, joining Wi-Fi, plugging in the charger.

The one thing plain HTTP can’t do well is a flash that puts the light back afterwards. For that there’s a plugin in WLED Max, covered further down.

First, give each light a DHCP reservation in your router so its IP never changes. Every automation below depends on it.

Tasker: HTTP Request

  1. Open Tasker, go to Tasks, tap +, and name it “WLED on”.
  2. Add Net > HTTP Request.
  3. Method POST, URL http://192.168.1.50/json/state.
  4. Headers: Content-Type:application/json.
  5. Body: {"on":true,"bri":200}. That’s on, at brightness 200 of 255. For a preset, send {"ps":2} on its own, since a preset usually saves its own brightness and would override the bri value.
  6. Test with the play button, then attach the task to a profile.
Net > HTTP Request (Tasker)
MethodPOST
URLhttp://192.168.1.50/json/state
HeadersContent-Type:application/json
Body{"on":true,"bri":200}

The four fields that matter in Tasker's HTTP Request action, written out.

MacroDroid: HTTP Request

  1. Add Macro, then a trigger, Day/Time for example.
  2. Action HTTP Request: POST, the same URL, content type application/json, the same body.
  3. Save and test.
HTTP Request (MacroDroid)
Request methodPOST
URLhttp://192.168.1.50/json/state
Content typeapplication/json
Body{"on":true,"bri":200}

Other bodies you’ll want: {"on":"t"} toggles, {"on":false} turns off, {"ps":5} loads preset 5, and {"nl":{"on":true,"dur":30,"mode":1}} starts a 30 minute fade-out.

If the request comes back with an error, it’s nearly always a wrong IP (the light got a new address) or a body that isn’t sent as JSON.

Triggers worth using

The action is always the HTTP Request above. What changes is the trigger.

In MacroDroid, next to Triggers tap +:

  • Notification: search “Notification”, choose Notification Received, pick the app (doorbell, washer) and tap OK. MacroDroid asks for notification access.
  • NFC: search “NFC”, tap NFC Tag, choose Write New Tag, name it (“Laundry”) and hold the phone to a blank NFC sticker.
  • Time: search “Day/Time”, set the time and days.

In Tasker, on Profiles tap +:

  • Notification: Event > UI > Notification, pick the app under Owner Application, tap back.
  • NFC: Event, type NFC in the filter box, tap NFC Tag, scan the tag.
  • Time: Time, set From and turn off To.

Then link the profile to your “WLED on” task and check the profile’s switch is on.

Flashing for a doorbell, and why HTTP isn’t enough

Loading a preset is easy. Flashing for three seconds and then restoring everything is not, because the automation would first need to save the light’s whole state. WLED’s realtime mode solves that on the light itself: UDP frames take over for a few seconds, then the light returns to what it was doing. Neither app has an easy way to send those raw UDP bytes. The background is in flash your WLED lights for the doorbell.

A simple compromise that works with plain HTTP: save a preset with the Blink or Strobe effect, have the task load it, add a Wait of 3 seconds, then load your usual preset again (or send {"on":false}). It won’t remember a one-off color you picked by hand, but for a doorbell it’s usually enough.

The Light Alert plugin (Android only)

Android New in 1.1.4

WLED Max 1.1.4 comes with a Tasker/Locale plugin called WLED Max Light Alert. It works in Tasker, MacroDroid and other apps that take Locale plugins.

Make the alert first, in Settings›Light Alerts. Start from Dinner’s ready, Laundry done, Print finished or Bedtime, or build one with a name, style, color, 2 to 10 seconds and the lights to flash. Test on My Lights checks it. New to this? Light Alerts step by step starts from the beginning.

Each saved alert has a Run Automatically button with a Show Me Step by Step guide. You pick how it should run and the guide shows each tap in the other app. Switching back and forth while you follow along is fine.

From the home screen. Tap Add to Home Screen, then Add. One tap on the icon runs it. Up to 4 alerts also appear when you long-press the WLED Max icon.

In MacroDroid:

  1. Tap Add Macro.

  2. Next to Triggers, tap + and pick a trigger from the list above (Notification Received, NFC Tag or Day/Time).

  3. Next to Actions, tap +, search "Plugin" and tap Tasker/Locale Plugin.

  4. Tap WLED Max Light Alert. WLED Max opens, and you tap the alert.

  5. Name the macro at the top and tap the checkmark at the bottom right.

In Tasker:

  1. On Profiles, tap + and pick a trigger from the list above.

  2. Tap New Task, call it "Flash", and tap the checkmark.

  3. Tap +, then Plugin, then WLED Max Light Alert.

  4. WLED Max opens. Tap your alert. If it doesn't open, tap the pencil next to Configuration.

  5. Back out to Profiles and check the profile's switch is on.

WLED Max doesn’t watch your notifications itself. To flash when an app you pick posts one, let Tasker or MacroDroid be the trigger and the plugin be the action, as above.

What it needs: Receive UDP realtime on in WLED (the app offers to turn it on). The phone has to be on the same Wi-Fi as the lights, since alerts go straight from phone to light. Android 9 or newer. The free plan flashes one light, and several at once needs Premium.

If the task runs but nothing flashes

Works when tapped, not from the automation. Battery saving, almost always. Android Settings > Apps > MacroDroid or Tasker > Battery > Unrestricted. Same for WLED Max if you use the plugin.

Nothing at all. Is the phone on home Wi-Fi? Open http://<light-ip>/json/state in the phone’s browser. If that doesn’t load either, the light is offline or got a new address.

The home screen icon died. It probably points to an alert you deleted or rebuilt. Remove the icon, open the alert and tap Add to Home Screen again.

The plugin runs but nothing flashes. Open the alert in WLED Max and tap Test on My Lights. If that does nothing either, the light is offline or Receive UDP realtime is off.

The macro or profile never fires. Check its switch in MacroDroid or Tasker. For notification triggers, check notification access is still granted. Some phones quietly revoke it after an update.

Related: WLED widgets and the Quick Settings tile, and for iPhone owners in the house, WLED with Shortcuts and Siri.