<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by MacroDroid on Medium]]></title>
        <description><![CDATA[Stories by MacroDroid on Medium]]></description>
        <link>https://medium.com/@macrodroid?source=rss-b5394b39c49d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*76KlfpLubqwHrrQcSgyHoA.png</url>
            <title>Stories by MacroDroid on Medium</title>
            <link>https://medium.com/@macrodroid?source=rss-b5394b39c49d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 23:56:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@macrodroid/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating macros with inverted conditions]]></title>
            <link>https://medium.com/@macrodroid/creating-macros-with-inverted-conditions-96f1fb8aa3e?source=rss-b5394b39c49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/96f1fb8aa3e</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[macro]]></category>
            <category><![CDATA[android-apps]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[MacroDroid]]></dc:creator>
            <pubDate>Sun, 28 Oct 2018 06:50:20 GMT</pubDate>
            <atom:updated>2020-03-07T16:18:37.121Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s very common to scenario to want to create two macros with opposite / inverted conditions, for example:</p><ul><li>When I enter an area, set priority mode to ‘block all’; when I exit that area set priority mode to ‘allow all’</li><li>When I plug in my device set brightness to 100%; when I unplug set brightness to 40%</li><li>When I open YouTube force landscape mode on; when I close YouTube cancel force landscape mode.</li></ul><p>The most obvious way to implement the above examples is to create two macros. One with a trigger for the first condition and one with a trigger for the opposite case. This is a perfectly acceptable solution and will work fine, but you can end up with many additional macros with very simple functionality.</p><p>It’s actually very easy to combine both cases in a single macro using multiple triggers and a simple IF / ELSE check within the actions.</p><h3><strong>Configuring the macro</strong></h3><p>Firstly make sure you are creating a new macro from the Edit Macro screen (not the simplified wizard view as IF actions are not available there). If you have configured the app to always show the wizard mode when creating a new macro you can disable this via the MacroDroid settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*8ZmJUvlgjiBQBNoQO45x0g.png" /><figcaption>Configure the wizard mode options from the settings cr</figcaption></figure><h4>Add the triggers</h4><p>Now add your two triggers to the macro. In this example I have decided to use the Power Connected/Disconnected trigger and I have added one trigger for when power is connected and one for when power is removed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*zJ3AH1ZYTafOFxHrjfSqMg.png" /><figcaption>Two (opposite) triggers added to the same macro</figcaption></figure><h4>Add the actions</h4><p>The first action we want in the macro is called the If clause. If you are showing categories when adding an action it is listed under Conditions/Loops.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*GUmzgDl89aeaVFQL3RYjoQ.png" /><figcaption>Choose the IF clause action as your first action</figcaption></figure><p>When configuring the If clause click the + button to add a condition and select the Trigger Fired condition which can be found in the MacroDroid Specific category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*9VWYWgfIPFeeQbhiAdVYgw.png" /><figcaption>Add the Trigger Fired condition</figcaption></figure><p>Select the ‘Trigger Fired’ configuration option and then the Power Connected option (both should be defaults). Now hit OK on the If clause configuration screen and you will see the action added to the list of actions with an associated End If. Any child actions added between the If and End If will only be run if the If condition is true.</p><p>Click n the If action and select the ‘Add else clause’ option and you will see an Else clause added between the If and End if.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*gK-Aw-pEu6_BpBrU3FPgdg.png" /><figcaption>Actions configured with If / Else / Endif</figcaption></figure><p>Now any child actions added between the If and Else clause will be run if the If condition is true and any actions between the Else and End If will be run if the condition is false.</p><p>Click on the If action and select the ‘Add child action’ option. In my case I chose the Brightness action (which is under the Screen category) and configured it to 100%.</p><p>Now click on the Else action and select the ‘Add child action’ option. Once again I chose the Brightness action, but this time set it to 40%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*TWBOFPm9WEz7H0pp3Ws8sA.png" /><figcaption>Actions configured to run based on the trigger that fires</figcaption></figure><p>You can add as many child actions as you want in each section. For example if you want to change the ringer volume in each case just add a child action to both the If and Else clause to set the value as desired.</p><h4>Final macro configuration</h4><p>The final full macro configuration is shown below. It is still a fairly simple macro to understand, but it avoids creating multiple macros and keeps the related functionality in one place so it is easier to manage and update in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*r3GYPZeOsQR5YnDP0TCrRw.png" /><figcaption>Final macro configuration</figcaption></figure><p>Thanks for reading this post, I hope it has helped some users to understand an easy way to handle multiple triggers in a single macro.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96f1fb8aa3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing the Webhook trigger]]></title>
            <link>https://medium.com/@macrodroid/introducing-the-webhook-trigger-a760e2ee140d?source=rss-b5394b39c49d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a760e2ee140d</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[macrodroid]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[MacroDroid]]></dc:creator>
            <pubDate>Thu, 21 Jun 2018 06:53:18 GMT</pubDate>
            <atom:updated>2018-06-21T15:23:15.699Z</atom:updated>
            <content:encoded><![CDATA[<p>In V3.25 of MacroDroid a new trigger was introduced call the Webhook trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/1*q2JTdMxLuHADns9np1UFGg.png" /><figcaption>Icon for a Webhook</figcaption></figure><h3><strong>What is a webhook?</strong></h3><p>From the wikipedia definition of a webhook: <a href="https://en.wikipedia.org/wiki/Webhook">https://en.wikipedia.org/wiki/Webhook</a></p><p>Webhooks are “user-defined HTTP callbacks”</p><h3>What does this mean for MacroDroid?</h3><p>In simple terms it means you can type a particular Url into a web browser and then a trigger will be invoked on your device.</p><p>An example of such a URL is shown below:</p><p>http://<a href="http://trigger.macrodroid.com/c306bcd7-5f78-4895-bee4-69600af77d4d/example">trigger.macrodroid.com/c306bcd7–5f78–4895-bee4–69600af77d4d/example</a></p><p>This URL consists of the following parts:</p><p><a href="http://trigger.macrodroid.com/"><strong>http://trigger.macrodroid.com/</strong></a><strong> </strong>(A fixed address always at the start)</p><p><a href="http://trigger.macrodroid.com/c306bcd7-5f78-4895-bee4-69600af77d4d/example"><strong>c306bcd7–5f78–4895-bee4–69600af77d4d</strong></a> (A unique device id assigned to an individual device)</p><p><strong>example</strong> (An identifier for a specific trigger so you can have as many Webhook triggers as you desire on a single device).</p><p>For more techy users you can use both an HTTP GET or HTTP POST in the above format.</p><h3>How can I use it?</h3><p>Of course the whole point of MacroDroid is for you the user to come up with your own unique way of using the trigger but to get you started it may help to offer a few examples.</p><p><strong>Inter device communication in MacroDroid -</strong>By using the Open Website/HTTP get action (and selecting the HTTP Get option), you can invoke a trigger on another device.</p><p><strong>Integration with IFTT </strong>-<a href="https://ifttt.com/">IFTT</a> is a very powerful automation app that can connect to a ton of web services to trigger events (but it’s Android capabilities are very limited compared to MacroDroid). Unfortunately they don’t make it easy to integrate with an Android app such as MacroDroid (unless you pay them lots of money) so by using a WebHook action (THAT in IFTT speak) you can easily invoke a MacroDroid macro from IFTT.</p><p><strong>Trigger MacroDroid events from a desktop browser</strong> -By simply creating a series of browser bookmarks you could have a quick and easy way to manipulate your phone. For example you can create a webhook with id ‘silent’ that will put your device into do not disturb and then be invoked from a bookmark in your chrome browser.</p><p><strong>Send information from your home automation system to MacroDroid</strong> -For example using Prota OS you could invoke a WebHook to send the temperature of a sensor to store in a MacroDroid variable.</p><h3>Sending parameters</h3><p>In addition to an identifier it is also possible to send URL parameters to the trigger which are then used to set MacroDroid Variables. The format for sending parameters is as follows:</p><p><a href="http://trigger.macrodroid.com/c306bcd7%E2%80%935f78%E2%80%934895-bee4%E2%80%9369600af77d4d/example?intparam=42&amp;strparam=sometext">http://trigger.macrodroid.com/c306bcd7–5f78–4895-bee4–69600af77d4d/example?intparam=42&amp;strparam=sometext</a></p><p>For example we could configure a macro that speaks some text that can be defined in the web link and then send that text across as follows:</p><p><a href="http://trigger.macrodroid.com/c306bcd7%E2%80%935f78%E2%80%934895-bee4%E2%80%9369600af77d4d/speakText?textToSpeak=Hello">http://trigger.macrodroid.com/c306bcd7–5f78–4895-bee4–69600af77d4d/speakText?textToSpeak=Hello</a></p><p>Please be aware you should have previously defined the MacroDroid variable in the list of variables. MacroDroid will attempt to set the value based on the variable type but if for example you try and send a text string on an integer variable it will of course not work correctly.</p><h3>About the device id</h3><p>You may be rightly wondering why the url ends up being so unfriendly with such a long and hard to remember deviceId. The device id is generated at first app run to uniquely identify a device. The value chosen is a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier"><strong>UUID</strong></a><strong> </strong>which simply means to all intents and purposes we can be sure this is will be unique and a clash between two devices will never occur.</p><p>In the long run I’m open to the possibility of creating user friendly aliases to a URL to help produce something that is easier to remember and share but it is not without difficulties.</p><p>I would need to implement some way of tracking what user ‘owns’ a particular alias so they could transfer it to a new device. The advantage of the current mechanism is that no user management/sign in is required.</p><p>As with a URL it is likely that popular aliases would be taken quickly for example a user might want to identify there device as ‘GalaxyS9’ so ids such as this would be quickly snapped up.</p><p>I welcome your feedback on this but in the mean time I hope this is good enough to get going with.</p><h3>TinyUrl and Url sharing</h3><p>When configuring a Webhook trigger there is the option to generate a TinyUrl link for the URL (fixed address + your unique deviceid). This essentially creates a much shorter alias which you can then just append your ids to trigger particular macros.</p><p>Also from the configuration page you are able to easily share and copy the URL link of both the standard and tiny url so you can send the link to where you need it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a760e2ee140d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>