MacroDroid setup an HTTPS macro

Two examples for general purpose use

1 - When the URL is sent the device speaks it's battery level

2 - When the URL is sent it sends the action as an HTTP request [proxy function]
[for use by a Fitbit companion to access
HTTP devices]
See reference at the bottom


1 - Start a new macro for the battery level macro

new


Click + to enter a Trigger

add
Select Webhook

trigger

1 - Enter "battery" for the identifier
2- Click + and enter "action" and create the variable



Completed the trigger

start


3 - Click the copy button with the identifier filled
to have the complete url to invoke the macro

[This macro doesn't actually use the "action" variable but it's good practice]

"https://trigger.macrodroid.com/3b045d6e-659e-49d7-xxxx-e0adbb02057f/battery"

Ok the Trigger to save it

Click + to create a new action

action

Choose speak text
Enter the text
"SimpleHome says phone battery level is {battery} percent"
where shown below

macro

  OK and tick to save action
Tick to save all changes

Finished macro

final

To test, paste the copied URL [marked 3 above]
into the browser and execute

NOTE: The identifier is case sensitive, so "battery" and "Battery" are 2 different triggers


2 - A workaround for a Fitbit companion
and HTTP to any local devices
in addition to those permitted

Start a new macro for sending
HTTP requests


new

Setup the trigger same as in the previous example
except use "SimpleHome" for the identifier


 Click the copy button [3] with the identifier filled
to have the url to invoke the macro

Ok the Trigger to save it


Click + to create a new action
choose HTTP request

http

Insert the following settings

request

Finalise macro - which looks like this

dorequest


To test, paste the copied URL [marked 3 above]
into the browser and the action to execute

If it works from the browser it should also work from the Fitbit companion

It looks something like this

https://trigger.macrodroid.com/3b045d6e-659e-49d7-xxxx-e0adbb02057f/SimpleHome?action=http://192.168.106.131/relay?state=1

Notes:

This will send the HTTP request required, the response isn't handled but it may also be possible


If you are working across multiple local LANs access must be granted by the router.

Reference:
Consult this link to see Valid Local addresses