Orvibo S20


You will need:

  • A web server with PHP enabled within the same network as your S20 Sockets (e.g. a NAS with web server features, Raspberry Pi, Always on PC) with port forwarding setup
  • External Static IP Address
  • S20 Sockets already configured who also have static IP addresses assigned to them by the router, make note of the IP and MAC addresses for each plug as you will need them
  • Amazon Developer Account (they are free!): https://developer.amazon.com
  • Amazon AWS Account (asks for credit card but also free!): https://console.aws.amazon.com

Setting up web service to turn plugs on/off remotely (Credit to Antikton)

  • Download the zip file in this post: https://www.domoticz.com/forum/viewtopic.php?t=8212#p56838
  • Unzip them to your web server (making note of where they are)
  • Using a web browser, go to the s20.php page with the following switches: ip=YOUR.IP.ADDRESS mac=YOUMACADDRESS accion=on/off,
    e.g. to turn on http://YOURIP/s20/s20.php?ip=192.168.1.119&mac=XXXXXXXXXXXX&accion=on
    to turn off http://YOURIP/s20/s20.php?ip=192.168.1.119&mac=XXXXXXXXXXXX&accion=off
    Note, if you use a port other than 80 make you sure you update the address, e.g. http://YOURIP:YOURPORT/s20/….

Create Alexa Skill Files

  • In the Amazon Developer Console goto Alexa Skills Kit (https://developer.amazon.com/edw/home.html#/skills/list)
  • Add New Skill
    Set the language to your own (I couldnt figure out why it wasnt working, turns out I live in the UK and didnt change the drop down to UK)
    Skill Type = Custom Interaction Model
    Name = Plugs
    Invocation Name = plugs
    Next
  • Go back to the Skill Information and make note of the Application ID as you will need this later
  • Download and extract this Zip: Alexa Skills S20 Files
  • Edit index.php
    var local_ip is your Local IP or Dynamic DNS name
    var local_port is the port your web server is using (normally 80)
    var APP_ID is your Application ID from Above
    Further down you will see a list of examples for turning TV on and Off, you can add more by copy and pasting the existing ensuring it ends with break;
    Make note of all the “case” ‘s as you will need them later,
    Save and Close
  • Make a new zip file containing index and AlexaSkill files (only those 2 files)

Setting up Alexa Skill

  • In the Amazon Developer Console goto Alexa Skills Kit (https://developer.amazon.com/edw/home.html#/skills/list)
  • Add New Skill
    Set the language to your own (I couldnt figure out why it wasnt working, turns out I live in the UK and didnt change the drop down to UK)
    Skill Type = Custom Interaction Model
    Name = Plugs
    Invocation Name = plugs
    Next
  • Go back to the Skill Information and make note of the Application ID as you will need this later
  • Go to https://console.aws.amazon.com/console/home?region=us-east-1
    Top right make sure US East (N. Virginia) is selected
  • Select Lambda under Compute
  • Create a Lambda function
    Skip Select Blueprint
    Click on empty box and select Alexa Skills Kit
    Next
    Name = plugs
    Code entry type = Upload a .ZIP file
    Upload newly created zip file of the 2 files
    Role = Create a custom role (then allow on the popup)
    Next
    Create Function
    Make note of ARN code in the top right as this will be needed later
  • Go back to the Amazon Developer Console and select Interaction Model section
    In Intent Schema, copy and past the code from “IntentSchema” file which was downloaded earlier
    Under Custom Slot Types, add a new one with Enter Type as “Control_List” and Values as a list of “Case” ‘s which are in the index file
    In Sample Utterances, copy and paste them from SampleUtterances file which was downloaded earlier and feel free to add your own
    Next
  • Select AWS Lambda ARN
    Tick North America
    Paste in ARN code from earlier
    Next
  • Under Serivce Simulator, enter “tell plugs to turn tv on” and click Ask Plugs, this will execute the command and bring back the result,
  • This should now list in your Alexa App under Skills>Your Skills
  • You should now be ready to try on your Amazon Echo

Common issues i came across

  • the “case” is case sensitive, e.g. Television wouldn’t work but television would, if in doubt add both
  • Make sure whats in the index file as a case is listed in the Custom Slot Types lists
  • Make sure you can trigger the on/off via a web browser inside and outside of your home network (e.g. trigger on mobile phone with wifi off), if this doesnt work it will need fixing first (port forwarding etc)

Attached files: orvibo-s20-domoticz.zip

Last update:
28-11-2016 09:53
Author:
Karl Hudgell
Revision:
1.2
Average rating:0 (0 Votes)

You cannot comment on this entry

Chuck Norris has counted to infinity. Twice.

Latest FAQs RSS

  1. Dockerized Download VM (30-01-2019 20:26)
  2. Jmeter + Performance Plugin + Jenkins Pipeline (16-02-2018 12:49)
  3. MySQL DB Backup Script (04-09-2017 10:16)
  4. Replace Cabin Filter (20-02-2017 13:45)
  5. Replace Nexus 6 Glass (15-02-2017 15:11)