Page 1 of 1

Triggering via IFTTT service?

Posted: Sat Aug 12, 2017 1:49 am
by jarrodfactor
Has anyone worked out a way of triggering a button or scene using IFTTT?

My ultimate plan is to be able to use IFTTT to link voice prompts via Google Assistant (for Google Home) or Alexa (for an Echo or equivalent) to change lighting states.

Once it's working with IFTTT, then the options are limitless - ie you could change lighting states by sending an email, or by where you are in the world, etc.

The sticking point appears to be the use of websockets as the Web API - there doesn't seem to be a way of sending that via IFTTT - the closest it has is a WebHooks service, but I think it's limited to standard http GET and POST instructions, albeit with JSON options.
https://ifttt.com/maker_webhooks

I was trying to think of alternatives, but there also doesn't seem to be support for sending OSC or Artnet data either. The idea would be for QLC+ to be running on a Raspberry Pi, so adding a third program to intermediate like NodeRed isn't really an option.

Re: Triggering via IFTTT service?

Posted: Mon Aug 21, 2017 8:09 am
by jarrodfactor
Really? I'm surprised there is nobody interested in this?

Re: Triggering via IFTTT service?

Posted: Mon Aug 21, 2017 10:59 am
by GGGss
If you'd had a look in the home automation world - you'd surely would have found 3 / 4 solutions out of the box... I'd recommend ip-symcon to you. A German product.

Re: Triggering via IFTTT service?

Posted: Mon Oct 09, 2017 10:28 am
by lightarea
Hey,
here is my solution for IFTTT-Support.

First of all go to http://www.qlcplus.org/Test_Web_API.html an checkout what commands are used to controll your QLC+
Then:

1. Activate port-forwarding for port 9999 in your router and chose as target the computer-ip where your QLC+ is running
(BUT BE CAREFULL! EVERYONE IN THE WEB CAN CONTROLL YOUR QLC+ or PC)
2. Get a webspace with php-support or run ab webserver at home (for example with a raspberry)
3. Push this PHP-File to your webspace / -server:
[See text-file attached]
4. Register to ITFFF
5. in ITFFF: "My Applets" -> "New Applets" -> for "this" make whatever you want (For example trigger Google Assistant) -> for "that" use "webhooks" -> "Make a web request"
6. Into "url" copy your url to the php-file on your webserver
Method "get"
7. Finish

If you don't want to have one php for every command i recommend to use instead of $data ="2|255"; this "$data = $_GET["id"]."|".$_GET["value"}. Then you have to add to your url this: ?id=2&value=255 For example www.myserver.com/myphpfile.php?id=2&value=255
The best way is to Google for PHP Rest-API and learn how to create a secure PHP-Service with an authentication.

If you are connected to the internet with a dynamic ip-adress, I would recommend to register to a Dynamic DNS Service and use that adress from the service instead of your IP.

Hope this helps you a little bit ;-)

Re: Triggering via IFTTT service?

Posted: Mon Oct 09, 2017 1:53 pm
by mcallegari
Please paste the PHP code into a text file and attach it to the post, instead of pasting code into a post

Re: Triggering via IFTTT service?

Posted: Mon Jul 20, 2020 4:04 am
by Moshfet
lightarea wrote: Mon Oct 09, 2017 10:28 am Hey,
here is my solution for IFTTT-Support.

First of all go to http://www.qlcplus.org/Test_Web_API.html an checkout what commands are used to controll your QLC+
Then:

1. Activate port-forwarding for port 9999 in your router and chose as target the computer-ip where your QLC+ is running
(BUT BE CAREFULL! EVERYONE IN THE WEB CAN CONTROLL YOUR QLC+ or PC)
2. Get a webspace with php-support or run ab webserver at home (for example with a raspberry)
3. Push this PHP-File to your webspace / -server:
[See text-file attached]
4. Register to ITFFF
5. in ITFFF: "My Applets" -> "New Applets" -> for "this" make whatever you want (For example trigger Google Assistant) -> for "that" use "webhooks" -> "Make a web request"
6. Into "url" copy your url to the php-file on your webserver
Method "get"
7. Finish

If you don't want to have one php for every command i recommend to use instead of $data ="2|255"; this "$data = $_GET["id"]."|".$_GET["value"}. Then you have to add to your url this: ?id=2&value=255 For example www.myserver.com/myphpfile.php?id=2&value=255
The best way is to Google for PHP Rest-API and learn how to create a secure PHP-Service with an authentication.

If you are connected to the internet with a dynamic ip-adress, I would recommend to register to a Dynamic DNS Service and use that adress from the service instead of your IP.

Hope this helps you a little bit ;-)
Theres either something wrong with my version of QLC+ but the PHP file spits out errors in apche web server and refuses to execute any commands. I keep getting script errors with the security keys telling me to define them. I know this is old but the help would be much appreciated!

Re: Triggering via IFTTT service?

Posted: Tue Jul 21, 2020 2:44 pm
by lightarea
Hey,
it's long time aqo. Not sure if I can help you. But whats the errormessage exactly? Can you copy it?

Best regards.

Re: Triggering via IFTTT service?

Posted: Wed Jul 22, 2020 1:10 am
by Moshfet
I did as instructed and added your PHP file into my apache webserver. Running in on the same computer I have the QLC+ web server running and functioning outside my network. When I manually load the PHP file it gives me this:

key: S21wS2NVPWZFJDZdMmR6Jg==


Notice: Undefined variable: head in C:\xampp\htdocs\php-sourcecode.php on line 21


handshake finished


Notice: Undefined index: Sec-WebSocket-Accept in C:\xampp\htdocs\php-sourcecode.php on line 40

Notice: Undefined index: Sec-WebSocket-Accept in C:\xampp\htdocs\php-sourcecode.php on line 43
Step 1 - Connection succefull. Server sent valid upgrade response.
keyAccept:


Notice: Undefined variable: expectedResponse in C:\xampp\htdocs\php-sourcecode.php on line 49
Step 2 - Server sent correct key.

sending data: 0|255

closing...



I don't know much PHP but looking through the file it seems that some lines are mispeled but I might be wrong. As said I don't know very much PHP but I was wondering if you could help fixing it.

Ports are open on the router, QLC+ is running, apache seems to be working, I've double and tripled checked my setup and it seems fine. I Keep getting stuck when the file doesn't do anything when executed on my server. lots of help would be appreciated!

Re: Triggering via IFTTT service?

Posted: Sun Jul 26, 2020 8:09 am
by lightarea
I really don't know if I can help. Im to far a way from the topic now. Maybe I have an idea:
It seems that your webserver doesn't support websocket or it's deactivated. My suggestion is to search on google for activate php websocket or to try another webserver-tool.