IFTTT triggering Domoticz actions

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!
Post Reply
Vlayke
Posts: 3
Joined: Tuesday 12 June 2018 12:23
Target OS: Raspberry Pi
Domoticz version:
Contact:

IFTTT triggering Domoticz actions

Post by Vlayke » Tuesday 12 June 2018 12:47

Hi,

I'm in a similar situation like what Whatisk has described in his post. I have a Sonoff switch, that I would like to trigger from Domoticz with the help of IFTTT. I managed to get that to work. But now I would like to take it a step further

The question I have is, how could I get IFTTT to send information back to Domoticz that the Sonoff switch is On or Off? I have tried using Blockly, but I cannot seem to find an option to accept an incoming information into Blockly script from IFTTT. I can only seem to be able to send a message out. :?:

Why would I like to do this?
Current situation only works as long as Domoticz is the only controlling element of the Sonoff switch. If I use manual controll on the switch, then Domoticz is not aware of the state change and reality can become out of sync with Domoticz awareness. So I want to build a feedback loop back into Domoticz that would let Domoticz know the state of the Sonoff switch, even if the state of the switch changes because of the outside influences.

Ideas? :) :?:

Rob78
Posts: 2
Joined: Tuesday 12 June 2018 13:19
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Sweden
Contact:

Re: IFTTT triggering Domoticz actions

Post by Rob78 » Tuesday 12 June 2018 13:28

HI Vlayke.

The answer to you question have to be RestAPI, which you are able to use both from you LAN and externally depending on you setup. And to get IFTTT to be able to change things in your Domoticz you need to allow access from outside of you LAN (read: the Internet) since that is where IFTTT lives.

A better solution would be to flash your Sonoffs with Tasmota. That software have builtin support for Domoticz and you only need to set up a virtual switch and enter the idx into Tasmota web-GUI. That way your switch will always be up-to-date.
More info on Tasmota is to be found here: https://github.com/arendst/Sonoff-Tasmota/wiki


Regards.
Robert

Vlayke
Posts: 3
Joined: Tuesday 12 June 2018 12:23
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: IFTTT triggering Domoticz actions

Post by Vlayke » Tuesday 12 June 2018 14:27

Hey Robert,

Thanks for your answer. My switch (model S26) unfortunately is not supported by Tasmota, so that avenue is not available to me. I was looking into it before.

Regarding Rest API and IFTTT I would appreciate a pointer to a proper wiki article, that would help me out. I was following instructions from here. However when I get into Blockly I seem to be able to compose an event that sends a command out of Domoticz, but not one that can receive command into Domoticz.

I'm attaching a screenshot regarding the only IFTTT action I can find in Blockly here.

By the way, I've got no problem opening Domoticz to the outside world on the router.

Thanks,
Vlayke

Rob78
Posts: 2
Joined: Tuesday 12 June 2018 13:19
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Sweden
Contact:

Re: IFTTT triggering Domoticz actions

Post by Rob78 » Tuesday 12 June 2018 16:22

Actually there is support in Tasmota, according to this page it's basically the same as S20, but redesigned and smaller (and by that harder to solder).

Info regarding the API/JSON can be found here: https://www.domoticz.com/wiki/Domoticz_API/JSON_URL's
I have not tried the IFTTT support in the built-in software since I flashed my Sonoff's as 1st thing, but it would of course need to send some sort of trigger from the Sonoff to IFTTT whenever the state change. If that trigger works, then it's just a matter of using a webhook to connect to the external URL with the right options like this one:

https://"my external IP/url:my external port"/json.htm?username="base 64 encoded userid"&password="base 64 encoded password"&type=command&param=switchscene&idx=10&switchcmd=on

This is actually from one of my webhooks that trigger a scene (idx 10) by a IFTTT widget.

Vlayke
Posts: 3
Joined: Tuesday 12 June 2018 12:23
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: IFTTT triggering Domoticz actions

Post by Vlayke » Tuesday 12 June 2018 17:55

Hey Rob78,

OK, thanks for Tasmota info. Seems I might have to break out my solder iron in the near future. For now I'll check out the other info you've provided, though. I got the Sonoff-IFTTT trigger working already. So I just need to check out the guidance you've provided.

I'll see what I can do.

Cheers,
Vlayke

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests