Jeedom interface – eWelink via IFTTT

JeedomeWelink

 

You can flash most Sonoff equipment, several tutorials are present on this site.

If you don't want to flash or can't (depending on the equipment), you can interconnect Jeedom to IFTTT and IFTTT to eWelink.

All prerequisites

Prerequisite: Create an IFTTT account and an eWelink account

  1. Create an account on IFTTT on the official website
  2. Create an eWelink account on the app (android or ios)

Prerequisite: Enter your eWelink account on IFTTT to interconnect them

Once the interconnection is completed, your eWelink equipment will automatically be offered on IFTTT.

Prerequisite: Retrieve the WebHooks key from the IFTTT site

Explanation of principle

You will need 4 IFTTT Applets:

  • An ON order that asks the equipment to switch to ON (Circuit Breaker ControlDIN-ON in the example)
  • An OFF command that asks the equipment to switch to OFF (Control Circuit BreakerDIN-OFF in the example)
  • An ON trigger that will inform Jeedom that the equipment has switched to ON (Circuit breaker Din goes to ON in the example)
  • An OFF trigger that will inform Jeedom that the equipment has switched to OFF (Circuit breaker Din switches to OFF in the example)

In Jeedom, we'll use a Virtual which will symbolize the equipment which:

  • receive IFTTT commands to report status changes (both triggers)
  • send commands to IFTTT to request status changes (both commands)

The link Jeedom => IFTTT => eWelink

Create two Applet WebHooks => eWelink on the IFTTT website

iftttewelink5

Here I will only detail the ON command because the off command is based on the same principle:

ifttt1

 

ifttt2

 

ifttt3

 

iftttewelink6

==> The name you give to the event is very important, keep it, it is he who ensures the link between Jeedom and IFTTT

ifttt1

 

iftttewelink1

 You have several options, for this tutorial, I take a simple example, I order equipment on/off:

iftttewelink2

 In the list appear the devices of the eWelink account configured in IFTTT. (DIN circuit breaker in my example), we therefore choose the device and the action to be taken.

iftttewelink3

And we validate the creation of the applet

 Create the command in Jeedom thanks to the IFTTT plugin

  • First, install the Jeddom IFTTT plugin, configure it and go create a new IFTTT by clicking Add
  • When creating a new ‘IFTTT’, he will inform you of the WebHook key, if you can't find it, read Retrieve the WebHooks key from the IFTTT site
  • In the command you create, specify the same event name as the name given in the IFTTT applet (here _on Circuit Breaker), so you need to create the command on and ordering off

 

iftttewelink7

 

Creation of a Virtual in Jeedom representing the equipment

It is necessary (thanks to the Virtual plugin) to create a virtual that will take two states ON or OFF.

  • So we go to plugin/Programming/Virtual
  • Add
  • Two actions (i.e. two commands) are added to the onhglet Orders one We're and one Off and each changes the value of ‘take’ in the example:

takeonoff

In the command/display configuration, you can set the ‘Socket’ widget to On and Off and then uncheck ‘Show’ Socket to have a nice Widget:

taketest

For the rest, we can note the direct url link that sends the command On and the link of the command Off, this is on the link "URL"

url

I note in my example:

  • Order ON : http://xxx:100/core/api/jeeApi.php?apikey=xxx&type=cmd&id=2687
  • Order OFF : http://xxx:100/core/api/jeeApi.php?apikey=xxx&type=cmd&id=2688

 

The link eWelink => IFTTT => Jeedom

Principle : When the eWelink equipment changes state, it must inform IFTTT and IFTTT sends a message to Jeedom

Create two Applet EWelink => WebHooks (=> Jeedom) on the IFTTT website

iftttewelink8

ifttt1

 

  • Take the service Ewelink
iftttewelink

 

  • Choose the right service for your equipment:
iftttewelinks2

 

  • Choose the equipment and then the command to be used as a trigger, ON in the example:
iftttewelinks3

 

  • When the trigger is created, IFTTT will be asked to send a message to Jeedom via Webhook
iftttewelings4
iftttewelinks5
  • Take Make a web request
  • In URL, put the url of the command, in this example it is the ON, so it is for example: http://xxx:100/core/api/jeeApi.php?apikey=xxx&type=cmd&id=2687
  • Leave everything else by default and press Create action
  • Give the Applet a name and it is over.

This means that when the equipment moves to ON, the eWelink service will inform IFTTT who will send a request via a URL to Jeedom.

  • Do the same for the Trigger OFF with the URL that corresponds to OFF.

Manually change the status of your equipment (or via the eWelink mobile app) and you must have your Virtual Equipment changing status on Jeedom.

Ask the Virtual to send status change commands via IFTTT

Now that the Virtual is created and they receive the status changes well, one last step is to ask them to send the status change commands to eWelink via IFTTT.

For this, we go to the Virtual, click on the tab “ Orders, on the command line ON, click on the notched wheel on the right, then tab configuration

iftttewelink9

And we add in " Action before execution of the order, commands the IFTTT plugin that sends the ON of this equipment.

We do the same for OFF

 

Conclusion

This is obviously not the easiest way to order a plug because there are a lot of middlemen, but it works.

We find eWelink sockets for less than 10 €, it allows to tinker and do simple things without investing fortunes.

It is a nice exercise of interconnecting devices that talk to each other by http queries.

Leave a Reply