Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - garagevibes

Pages: [1] 2 3
1
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: January 27, 2018, 04:27:23 pm »
Many apologies I've been off the scene for a long while with work commitments and also my old system died a few months back, but I've now begun to start back up.
Ive got a nice fast new server now up and running with multiple vmware virtual machines, I have a few bugs one with passing through my zwave dongle and the other with the dhcp server not giving out addresses which is weird but anyway I'm getting there.

So anyway before I left I had Alexa controlling my lights as well as scenarios/scenes and devices like my boiler for heating and hot water, it was fairly reliable and the Oauth2 part is simple to use once setup and not an issue using just plan old PHP it just needs a few tables set up in the database and the code pushed in to the web admin pages.
The main problem was that it wasn't really usable for end users as Amazon requires Oauth2 handshaking with a server in order to use the home skill kit and Amazon are very picky on the SSL certificates that you can use, I brought 4 from various budget companies like godaddy and none of them would work, so in the end I had to route the requests through a web server I have access to at work which has a high end corporate certificate.

You don't need oAuth with a custom skill however and i actually did a presentation with work before xmas where I created a custom skill to ask for company information and send the latest reports to users and things just as a sort of demo of whats possible so I may look at going down this route next.
The down side though is you would then have to use an activation word each time like "ask Linuxmce to set living room lights to 30%" but the up side is we should be able to do something like "ask Linuxmce to play Xmen in Living room" and control media which would be cool.

Anyway as soon as i get my lights working again through the normal means ill get back on the Alexa piece and see if i can help out :) 

2
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: January 11, 2017, 03:52:48 pm »
Hi phenigma,

Hope you had a merry xmas and a good new year, sorry I've left this for a few weeks over christmas and things.

Im now all up on git and ready to post some initial code but if I'm honest I've never used it before and i have no clue what I'm doing.

I'm assuming I have to clone the current code, add my amendments and adjustments and add in any new files then submit to have it added in to the live repository but I really cant figure it out. I'm probably just being stupid but I seem to be able to create my own projects and add issues into Linuxmce's repo but I don't know if I'm missing something.

Do we have a guide anywhere?

Cheers
 

3
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: December 07, 2016, 11:00:52 am »
Hi phenigma,

Ive removed the parts I've added and now installed the new built in OAuth2 server, it all went through fine but it doesn't look to have created the database? hunting through the code I can see there should now be a database called lmce_oauth2_db but I don't seem too be able to find it in my system? I can manually create it for the time being but just to give you a heads up.

Also in the 'oauth2-server.php' file there needs to be the following line added to the bottom otherwise you wont get refresh tokens given and that will be really rubbish if we have to relink our systems every hour when the token expires :) I set the refresh expiration to 14 days here this means that you will have to relink if no commands are sent for more that 14 days? This may want to be extended or made indefinitely.

Code: [Select]
// Add the "Refresh Token" grant type
$server->addGrantType(new OAuth2\GrantType\RefreshToken($storage, array(
    'always_issue_new_refresh_token' => true,
'refresh_token_lifetime'         => 2419200
)));

Whats the best way of going about this just make all the changes need to make this work on these scripts and then upload then to git or zip them and post them? Or am I better just sending you each amendment, I don't think there are that many?

4
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: December 06, 2016, 08:48:19 pm »
Haha hilarious it just so happens thats the exact oauth2 server scripts I've been using anyway so should be quite simple to change over to this and my steps to add in the database tables wont be needed either.

I'll just have to change some of the required paths, Ill give this a go and see how i get on once thats done ill upload all the code. I haven't contacted polly yet for a git account ill do that in a min.

cheers all.

5
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: December 06, 2016, 05:32:36 pm »
Thanks guys for getting back to me, Yes phenigma if you could send over the details of the LMCE oauth2 server details ill get it integrated into that and ill ask polly for some git login details so I can store the code there.

I've created an interface for a central web api portal which is used an intermediate for web services to connect to so for the moment the system works a bit like the quick diagram I've attached.

So there are basically 2 Oauth2 servers in use 1 on the core and 1 one this new web portal the idea being that a number of different web services can connect through the same web portal and it will route the messages to the correct users core and a user can break the chain at either end at any point if they ever need to, this means also that any app we produce can hopefully be released in to the public store's.

Looking on the amazon developer console I believe i can add people as developers to my account if I have there email address so they can add the skill for testing and view the code behind it, the web portal site is simply a router I wanted to keep all the api itself on each users core so that updates and things will stay as they are and hopefully the site will never have to change.

Ive had the idea of including alexa as a voice service as well but thats another task once I have this one solved :)
                                 

6
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: December 06, 2016, 11:28:15 am »
So last night the magic happened 8)
I had Alexa discovering all my lighting devices from my core, added them to the Alexa app and more importantly spent the night pissing off my family by repeatedly requesting Alexa to turn my living room lights on, off and up and down. It was amazing.

Now i need to tidy up my code mess along the way and strengthen the oauth2 server I added to my core as at the moment for testing there is no password or anything to authorise which kind of defeats the point but I note phenigma that you said we now have one already on LinuxMCE? I've updated and I cant see any sign of one? I'm happy to use the one built in one though I mean who whats 2? :) its a basic web standard so should require no more than a url change in my code to switch anyway.

At the moment I've only linked in lights but over the next few days ill try and add thermostats and scenarios although I only have a z-wave boiler control not a thermostat so may be in the dark a bit there so may need some help to test.

I'm excited about scenarios but I've read that amazon will only allow up to 12 "scenes" as they call them to be discovered which may be a pain.

Ive tried my best to make the api as simple and flexible as possible and not have it only for Alexa but indeed any web service its a bit rough at the moment so will probably no doubt need changes and tweaks that I'm sure all you guys on here can offer advice and assistance on.

At the moment because I'm using my own oauth2 server on the core the interface requires the following:
  • A small folder of web pages to be placed in the  /var/www/lmce-admin folder on your core.
  • The creation of 7 small mySQL tables to handle the access tokens ect.
  • A SSL cert but it can be self signed we just want an encrypted connection for security - I think this is now done by default anyway.?
  • Allow remote access to the web admin via https on the standard port and ensure you can then access your web admin from the web.
  • An Alexa enabled product and the Alexa app
Note also that the intermediate site I've built will store your cores IP address and the required access tokens there is no way around this as I said before this site should i believe be stored on this linuxmce.org domain securely but for the moment I have it on a test site I can promise you Im not interested in accessing your core, but at the moment this is the only way I can see it being possible, you still have full control of the outh server on your core and revoke all access at any point.

So anyway I guess the fun question is once I've ironed out the few bits today who has a system they don't mind playing with that wants to test this?

7
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: November 29, 2016, 11:44:57 am »
Hi all,

Sorry this has taken me a while to get going but it is still on my radar, I've got an oauth2 server running now on my core and looks to be working fine and issuing out tokens and all that nice stuff. I've brought a cheap domain name in the black friday sales and linked that into my core and installed an SSL certificate as well which is also working fine however after 2 days of pulling my hair out trying to get amazon to accept and link my skill to my core it seems that amazon are extremely picky on what SSL certs they will accept from what i can see it has to come from either, digicert, versign, twane or one of the other over overpriced big players you cant use just any old cheap certificate that you can get nowadays I got mine from godaddy but i tried a trial for geotrust as well and that also wouldn't work.

To verify that it was a certificate issue I copied my code over from my core on to one of the web servers at my work which has an enhanced certificate from digicert and it linked fine so this leads me to a problem either we all have to buy a £250+ a year SSL certificate and link an amazon skill to each of our cores so that there is no concern in security or the other option I'm looking at is develop a web interface on a server with an expensive certificate and then use this as a middle man to receive the commands from amazon or any other similar service link them to a user in a DB which has that persons core IP address or domain name and then route the command to there core.

To keep this as secure as possible ill still use Oauth2 on the core to link to this intermediate site but be a little more lenient on the certificate type allowing like a selfsigned one the good thing about this as well will be that the skill I produce should be allowed to be published publicly as its linking to a single secured service and although there will be concerns maybe with a third party site holding core details by using oauth2 a user can revoke access at any point.

To test this approach I'm making the intermediate site on a server i have access to at work where I'm currently building an internal web application, This will be fine to test but it cant obviously stay there for all to connect to I cant see my manager being to impressed but if I can get this working and others find it useful then perhaps we can group fund a certificate for the linuxmce.org domain and move the page built over to this server I think people would full more secure that way as well.

But anyway just thought id give an update and let people know its not been forgotten about.

Cheers

8
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: November 02, 2016, 09:42:25 am »
Ok so after some more digging to secure our API we need to use something like OAuth2 and in fact to use it with alexa you can only use OAuth2. There are a number of ways of doing this as I'm quite fluent in php id probably prefer to go down that route. I haven't used cakePHP before but I've heard of it and ill gladly take a look especially if it simplifies the DB connections, I'm still getting my head round the changes in the depreciated mysql php functions which I've become accustomed to for years :).

There is a nice example and demo of implementing an OAuth2 server over on this site: https://bshaffer.github.io/oauth2-server-php-docs/ I don't think it would be to much work to implement this on to the core.

In terms of security I believe keys are stored encrypted anyway so a person with access to the Linuxmce DB wouldnt get simple access to peoples accounts but if it really is an issue I guess a new schema just for this could be created with a password or something? But this is about giving an application like Alexa access to LinuxMCE not google giving LinuxMCE access to google if that makes sense.

Another option would be to implement a framework like this: https://apigility.org designed to help create api's and offers a few different security options for securing them, this would give better flexibility and future proof with regular updates but there are obviously disadvantages as well relying on yet another 3rd party piece of software.

Im confident i can implement any one of these on to the core to secure our apis the next stage would then i guess be what do we want our api to look like what commands would we send and what would our structured responses look like to give the best usability and flexibility with multiple services?

Ill continue digging and see if i can implement something on my core here just as a test and come back to you all. Cheers for the help and advice as well, I will be back I'm sure  ;)

9
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: October 27, 2016, 11:19:48 am »
Im still playing around with this, from a lot of reading up on the amazon developer site i think I've now created a basic skill that I can enable and send and receive requests from but the responses are NULL as I haven't actually done any linking to linuxmce yet thats the next step.

Did i see once on this forum that someone had created a JSON dcedevice before? I don't seem to be able to find it or any documentation on the api for it, just thought it might be an easy way to plug in.

Otherwise ill probably need to create my own scripts, but unfortunately my only coding skills are in php, javascript and html so id probably write an interface in php using a connection to the mysql db to get the details of controllable devices and there device ids etc and then use the same script to fire off exec commands to send the required dcemessages as they are received from amazon.

Obviously i need to add in a secure connection between the core and the amazon web service as well.

Does this seem the right approach or at last a workable approach?

10
Feature requests & roadmap / Re: Alexa and amazon echo skill
« on: October 24, 2016, 10:58:58 am »
Hey sorry for the delay had a few family issues, my echo arrived yesterday though so really keen to have a go at setting this up, my skill set is in web design really so I'm sure i could help at least with the http interface and designing of the api. my main struggle would probably be with the actual connecting up to the dcerouter, how to announce available devices ect.

You mentioned you found some nice code from google that would handle this don't suppose you could send a link  and ill see if I can get this intergraded as a starting point maybe?

cheers

11
Feature requests & roadmap / Alexa and amazon echo skill
« on: October 14, 2016, 05:37:36 pm »
Hi all,

The amazon echo has final made it way to the UK and I'm excited to get my hands on one, just wondering if anyone had looked in to adding a Linuxmce skill to control basic home automation like lights and heating ect, it seems like someone has created a skill for our slightly common sister vera but it annoyingly connects via there in house web interface so even though the code has familiar terminology like Device Ids ect it just wont simply port over.

the amazon alexa system looks simple enough at creating a skill using node.js the issue i have is just trying to think of the best way of implementing a secure external api type interface so that the external amazon alexa voice service can send and receive commands to our internal DCErouter.

Just thought id put it out there and see if anyone had looked into this or had any ideas of the best way of implementing a solution.

cheers

12
Users / Re: Joggler setup lmce-disked-mid-joggler
« on: October 30, 2015, 01:36:23 pm »
Hi Phenigma,

sorry it took so long but I'm all setup now and I've created a ticket for this issue #2517

cheers again

13
Users / Re: Joggler setup lmce-disked-mid-joggler
« on: October 20, 2015, 04:09:48 pm »
Thanks for getting back to us,

I know the whole joggler MAC address thing is crazy I have no idea what O2's motive was when they made it duplicate the wifi adapter address and leave the network cards mac address blank, seems a bit crazy to me.

But anyway thanks for looking into it I even tried with another joggler that I flashed the eeprom on the network card with a real mac address previously and it has the same issue so its creating a fake address ok its just not saving it for the next boot.

I'm really sorry I've tried to create a ticket for this but I don't seem to have a log in for trac that or Im going mad and just cant log on :-[

14
Users / Re: Joggler setup lmce-disked-mid-joggler
« on: October 18, 2015, 02:56:31 pm »
Thanks you so much for the quick and detailed reply.

I've noticed all the work you've put in over the last few months the install process seems to be far easier now which is a great help as I had to reinstall my core last week.

Unfortunately this jogger booting still isn't working, it's a shame as I got really excited when I saw the wiki updated to allow a full stack to be installed something I've tried to do manually before but with a lot of effort.

I can always use the old manual orbiter instructions so please don't put to much work in to this I'm sure it will fix itself down the line when you get to it but to help with debugging I'll try and walk trough the issue now.

So your recommendation to change the source worked a treat and I had no dependancy issues installing the packages this time. The steps I took were flash a usb stick with squeeze os 303-trusty, then first I tried using wifi so I set this up in squeeze os, then rebooted and ssh to the joggler so I knew the networking was all set up fine, I then changed the source, updated and then installed the lmce-disked-mid-joggler package all went through fine and rebooted.

It then just hang on the squeeze os splash but by pressing esc I could see there was an error mounting so I skipped through these errors and got to the announced ourselves to the router message but looking at the string sent to the core the IP address was just that of an internal address so obviously the wifi connection hadn't connected so then I tried the above again but this time I used an Ethernet connection to set up squeezeos then installed the lmce-disked-mid-joggler package again with no errors and rebooted. This time the mounts still failed so I pressed s to skip through them again and got to the announced ourselves to the router message. The string that was sent to the core then had an IP address and my other orbiters then show a message about a joggler being discovered. I select the room the joggler is in and the joggler then runs some scripts and reboots.

Now though I again get it hanging at the splash screen due to mount errors so I skip through them and it goes back to the announced ourselves to the router message and another joggler gets added to the system and this goes in a loop, looking at the string sent to the core the MAC address is randomising each item and not holding like it should.

This is strange though as it worked fine in squeeze os, so any ideas would be greatful.

Many thanks again for everything

15
Users / Joggler setup lmce-disked-mid-joggler
« on: October 16, 2015, 08:45:01 pm »
Im having a few issues setting up a new joggler.
 I noticed the wiki has changed stating that a full stack can be installed with the following package: lmce-disked-mid-joggler but I get a dependancy error when I try to install this package on the latest squeezeos image of trusty.

I traced the dependancy issue to a Deb called lmce-core-locator so I checked the Deb.linuxmce.org source and found this package missing in the trusty image but I did see it in the precise image so I manually installed it from there instead.

The whole lmce-disked-mid-joggler Deb seemed to then install fine but when I try to boot the joggler it hangs at the squeeze is splash.
If I press esc it shows mounting errors but if I press S multiple times to skip this I eventually get to the announced ourselves to the router message but nothing seems to happen from there.

I can't see any new devices created in my core and the joggler will just sit there for hours.

Does anyone know of a fix for this? I'm currently running 12.04 on my core but the joggler is 14.04 not sure if this could be the issue.

Any help would be greatful cheers.

Pages: [1] 2 3