Dreamscreen 4K voice control - working
Apr 3, 2018 19:28:50 GMT
kyle, socrates, and 1 more like this
Post by sunny99 on Apr 3, 2018 19:28:50 GMT
Okay, so I know IFTTT is on the road map for dreamscreen, but I'm impatient and love to have a tinker.
I just want to share my workings and ideas so that people can recreate or upgrade if they wish.
So hardware requirements:
DS4K (no idea whether this works on HD)
Raspberry Pi (I'm using an old B+ (it will require internet connection))
DreamscreenComander.py created by genesisfactor - dreamscreen.boards.net/thread/380/screen-commander-python-script-automation (thanks)
The basic idea:
RPI running an apache2 webserver (with PHP enabled) - I used this because I was looking for a method to send WOL packets externally
www.jeremyblum.com/2013/07/14/rpi-wol-server/
I have also a Dynu account to create a domain name for my RPI webserver. I also installed the dynu RPI package to update my WAN IP address periodically.
I created a simple PHP script and dumped it into the Apache directory which handles parameters passed to it.
I created an IFTTT account and linked my Cortana account with it. Once setup, created custom applets which use Cortana specified words as triggers and then create Webhooks as actions e.g. https://mydomain/DS.php?mode=video
So when I say "Hey Cortana, video mode" it sends a request to the apache php page and within the PHP a system call runs genesisfactors python script and relevant parameters for it to action.
I admit its a little slow but it is less frustrating then getting my phone out everytime I want to change sources. I'm pretty sure this could be used for google home mini's and/or Amazon echo's etc just replace Cortana in IFTTT applet creation.
So I best post some useful stuff...
My control PHP was only thrown together to test functionality and when it worked I let out a little scream and decided to post my findings
This is not for the faint hearted and if you don't already have a spare raspberry pi knocking around I'd suggest just leaving the headache and waiting for the official IFTTT update from the DS team.
I'm not a master by any means so I'm apologising in advance for any troubleshooting queries anyone has.
Here is the finished product in action:
www.youtube.com/watch?v=qZyBB3H1Bfk
Best of luck!
I just want to share my workings and ideas so that people can recreate or upgrade if they wish.
So hardware requirements:
DS4K (no idea whether this works on HD)
Raspberry Pi (I'm using an old B+ (it will require internet connection))
DreamscreenComander.py created by genesisfactor - dreamscreen.boards.net/thread/380/screen-commander-python-script-automation (thanks)
The basic idea:
RPI running an apache2 webserver (with PHP enabled) - I used this because I was looking for a method to send WOL packets externally
www.jeremyblum.com/2013/07/14/rpi-wol-server/
I have also a Dynu account to create a domain name for my RPI webserver. I also installed the dynu RPI package to update my WAN IP address periodically.
I created a simple PHP script and dumped it into the Apache directory which handles parameters passed to it.
I created an IFTTT account and linked my Cortana account with it. Once setup, created custom applets which use Cortana specified words as triggers and then create Webhooks as actions e.g. https://mydomain/DS.php?mode=video
So when I say "Hey Cortana, video mode" it sends a request to the apache php page and within the PHP a system call runs genesisfactors python script and relevant parameters for it to action.
I admit its a little slow but it is less frustrating then getting my phone out everytime I want to change sources. I'm pretty sure this could be used for google home mini's and/or Amazon echo's etc just replace Cortana in IFTTT applet creation.
So I best post some useful stuff...
My control PHP was only thrown together to test functionality and when it worked I let out a little scream and decided to post my findings
<?php
$s = $_GET["source"];
$m = $_GET["mode"];
$b = $_GET["brightness"];
if($s != null) {
if($s === "CC") {
system('/home/pi/Documents/Scripts/DreamScreenComander.py -s 0');
} else if($s === "xbox") {
system('/home/pi/Documents/Scripts/DreamScreenComander.py -s 1');
} else {
system('/home/pi/Documents/Scripts/DreamScreenComander.py -s 2');
}
}
if($m != null) {
if($m === "video") {
system('/home/pi/Documents/Scripts/DreamScreenComander.py -m 0');
} else if($m === "audio") {
system('/home/pi/Documents/Scripts/DreamScreenComander.py -m 1');
} else {
system('/home/pi/Documents/Scripts/DreamScreenComander.py -m 2');
}
}
?>
This is not for the faint hearted and if you don't already have a spare raspberry pi knocking around I'd suggest just leaving the headache and waiting for the official IFTTT update from the DS team.
I'm not a master by any means so I'm apologising in advance for any troubleshooting queries anyone has.
Here is the finished product in action:
www.youtube.com/watch?v=qZyBB3H1Bfk
Best of luck!