MWareman Posted March 11, 2016 Share Posted March 11, 2016 Well - as an Android user - I've been distressed by just how long it takes for Mobilinc to connect to the ISY in general - so I've been creating custom solutions (for myself - sorry!) in Tasker. I've written up the basics on the Wiki so others can create as well.... I've been further distressed by the lack of plugin support in Mobilinc on Android. IOS users have had a Elk module for years now - but module support is still completely absent on Android. Elk recently changed the crypto in firmware - this caused havoc in conjunction with Android dropping older crypto. This has led to connection problems... Finally, the ISY Portal has come along - meaning easier remote access... So - I've put together my Elk solution as a Tasker-produced app. Here is a teaser.... * Connects to the ISY API to control Elk - NOT to Elk directly. You don't have to expose Elk to the Internet. * Support to auto-detect your home network - and connect with HTTP for incredibly fast local connect and control. * Ability to connect remotely to ISY (if you have a trusted certificate installed). However, this is subject to the SSL negotiation - and there is a delay of 4-8 seconds. * Ability to work thru a reverse proxy but then direct to the ISY. This results in very fast remote access. * Ability to work thru the ISY Portal for remote access. * Auto-detection of network - auto-switching as you connect and disconnect from your home wifi network. * Supports multiple Elk zones - select the one you want to control in settings. Main Screen when connected locally and directly to ISY: Main Screen when connected via the ISY Portal: PIN entry for disarm: Settings showing the portal config: Settings showing the 'Forget this network' button: Limitations: * I'm *terrible* at UI/UX... I'll accept contributions of free-to-use graphics and design elements... * Does NOT support the situation where you must enter a code to arm your Elk.... I may add this later - but I have not configured this on my Elk - so I simply have not accounted for it. * Does not auto-refresh status. It's not subscribing (cannot do this with Tasker). Long-press the status display to refresh. A refresh also happens when the settings are saved, a command is sent - or the network connection changes. * I have a single ISY in my ISY Portal account. This means I have *not* tested against a portal account with more than one ISY - and confirmed that I'm selecting the 'Default' one for a given credential. Hopefully - if there is an issue here - I can work with someone to resolve it. However, it appears to work fine with a single ISY registered to the portal. If you find it useful - please feel free to PM me your email. I'll putting this on Google Play as a closed alpha for the time being and may open it up later. This is a hobby for me - not a business. Also please understand - this is a Tasker app. There are lots of limitations! Please also understand - I have exactly three devices to test on - a Nexus 9, Nexus 6 and Nexus 5. It's very likely that it won't work on most devices! You must accept this - I simply don't have the mechanism to make this work on every possible device... I hope it's useful to others.. Michael. Link to comment Share on other sites More sharing options...
DennisC Posted March 11, 2016 Share Posted March 11, 2016 Michael, This looks interesting. I didn't see armed vacation setting in your screen shots, is this something you supported? I'd like to try it on my S4. I will send you a PM. Thanks, Dennis Link to comment Share on other sites More sharing options...
Michel Kohanim Posted March 11, 2016 Share Posted March 11, 2016 Hi Michael, Thanks SO very much. This looks very promising! With kind regards, Michel Link to comment Share on other sites More sharing options...
jon102034050 Posted March 11, 2016 Share Posted March 11, 2016 Looks fun - I'll send a PM! Link to comment Share on other sites More sharing options...
MWareman Posted March 12, 2016 Author Share Posted March 12, 2016 Michael, This looks interesting. I didn't see armed vacation setting in your screen shots, is this something you supported? I'd like to try it on my S4. I will send you a PM. Thanks, Dennis So far, only the buttons I've used.... Accepting all feedback of course... I'll probably put the less used arming modes onto the activity bar menu - currently only populated with 'Settings'. At the moment, each arm mode is driven by a separate task. I'm going to bring it down to a single parameterized task to allow additional modes easily, and also to allow pin-on-arm as an option. I *really* need some graphic design lessons... Link to comment Share on other sites More sharing options...
MWareman Posted March 12, 2016 Author Share Posted March 12, 2016 Hi Michael, Thanks SO very much. This looks very promising! With kind regards, Michel No problem! Lots of work still to do. One question I had is this. When the 'Authorize' button is clicked - the app simply retrieves https://my.isy.io/api/isys (with basic auth - using the supplied username and password) and parses the JSON to retrieve the 'isykey' value. This, as you know, is the secret value that transforms the my.isy.io API into the same URL structure as a local ISY. My question is this - I only have a single ISY in my Portal account. If there is more than one, how is this represented in the JSON? I assume in the 'data' block there are multiple 'isy' blocks - are there more than one 'domain' blocks (within the 'data' block)? It seems odd - because at the root of the 'data' block is the uuid - and I would think that would be within the 'isy' block - and the 'alias' is in the 'domain' block - not the 'isy' block... How is the 'default' ISY represented? I know it's reverse engineered. Is there documentation for the API? I'm hoping that I can have the app list all connected ISYs and ask the user to select which one... Michael. Link to comment Share on other sites More sharing options...
DennisC Posted March 12, 2016 Share Posted March 12, 2016 Michael, The install went fine, no problems. I set up user name, password, and local http address and the app connected VERY quickly. One note on entering the above information - on the Galaxy S4 you are entering the information blind. Once the keyboard pops up you can not see the text you are entering. Not a big problem, just thought I would mention it. I tried the various arm up methods and disarm for each and they all worked fine. Next I entered remote https ip address and tried to connect with external direct. I could not connect to the controller. I then tried my ddns address and I still couldn't connect. I tried both address with wifi on and wifi off. Using external direct I get "cannot connect to controller". Using internal direct the connection works quickly every time. If you are considering requests, I would really like to have armed vacation as I use that frequently. Having an app to arm/disarm Elk is something I have been missing, thanks for taking the time to create the app and for sharing. Regards, Dennis PS: I also tried increasing the connect timeout to 10, but it didn't help. PSS: What is the triangle, circle, and square symbols for on your scree shot of the arm page? I don't see them on my phone. Link to comment Share on other sites More sharing options...
MWareman Posted March 12, 2016 Author Share Posted March 12, 2016 Is your certificate trusted on ISY? Currently, it must be. I've reproduce the blind input on a Nexus 5 - there is a way to make the scene scrollable I believe - I'll give it a try. I'm going to add an 'Arm Vacation' mode on the action bar menu I think - until I can manage a preferences screen to allow full customization of which arm modes are on the front screen. I'll also see about adding a 'trust insecure SSL' option - though it goes against everything I am... However, I do see that many people want to take the risk with a self-signed cert. I will add though - direct external access to ISY takes quite a while (4-10 seconds) due to how long ISY takes to calculate the crypto. Because the app is based on Tasker - it also cannot do session reuse - which means the crypto must be calculated for each command. If you have ISY Portal, simply click the button labeled 'Remote Direct' to switch to ISY Portal remote access - and its very speedy and secure . Link to comment Share on other sites More sharing options...
MWareman Posted March 13, 2016 Author Share Posted March 13, 2016 New alpha on it's way via Google Play alpha channel... Added ability to ignore SSL trust (on settings). Try this with a larger timeout if you use a self-signed cert on the ISY Internally - I've parameterized the 'arm' function - allowing all arm modes to be supported Added Arm Vacation / Arm Nigh and Arm Stay Instant to menu (to complement 'Arm Away', 'Arm Stay' and 'Arm Nigh Instant' which are the primary buttons) Added 'press-and-hold' the status text to refresh Changed portal button to say 'Switch to portal' or 'Switch to direct' - which I feel is less confusing than the prior text. >PSS: What is the triangle, circle, and square symbols for on your scree shot of the arm page? I don't see them on my phone. These are the soft buttons on stock Android... not part of the app. I don't think the S4 uses these. Link to comment Share on other sites More sharing options...
DennisC Posted March 13, 2016 Share Posted March 13, 2016 New alpha on it's way via Google Play alpha channel... Added ability to ignore SSL trust (on settings). Try this with a larger timeout if you use a self-signed cert on the ISY Internally - I've parameterized the 'arm' function - allowing all arm modes to be supported Added Arm Vacation / Arm Nigh and Arm Stay Instant to menu (to complement 'Arm Away', 'Arm Stay' and 'Arm Nigh Instant' which are the primary buttons) Added 'press-and-hold' the status text to refresh Changed portal button to say 'Switch to portal' or 'Switch to direct' - which I feel is less confusing than the prior text. >PSS: What is the triangle, circle, and square symbols for on your scree shot of the arm page? I don't see them on my phone. These are the soft buttons on stock Android... not part of the app. I don't think the S4 uses these. Thanks, Michael. I will try the new version. Just realized one other important (at least to me) requested feature - I am hoping it won't be too hard to implement....... I have an ISY and Elk installed at two different locations. Is there anyway to add a switch to change locations/accounts? Dennis Link to comment Share on other sites More sharing options...
DennisC Posted March 13, 2016 Share Posted March 13, 2016 All functions on the new version performed flawlessly. Great job and thank you! Dennis Link to comment Share on other sites More sharing options...
MWareman Posted March 13, 2016 Author Share Posted March 13, 2016 Just realized one other important (at least to me) requested feature - I am hoping it won't be too hard to implement....... I have an ISY and Elk installed at two different locations. Is there anyway to add a switch to change locations/accounts? Let me think about it some - and see what I can come up with. It's certainly easier for direct - and likely not trivial with the portal (only because I don't have access to a multi-ISY portal account). How do you think it should be represented in the UI though? Should I make the user go into settings to toggle between two sets of settings? Should there be a button on the main screen? That being said - I do sort of want to make it rock-solid single ISY/Elk first... Michael. Link to comment Share on other sites More sharing options...
DennisC Posted March 13, 2016 Share Posted March 13, 2016 Let me think about it some - and see what I can come up with. It's certainly easier for direct - and likely not trivial with the portal (only because I don't have access to a multi-ISY portal account). How do you think it should be represented in the UI though? Should I make the user go into settings to toggle between two sets of settings? Should there be a button on the main screen? That being said - I do sort of want to make it rock-solid single ISY/Elk first... Michael. Having a rock solid Elk app for ISY is something I have wanted for a long time. The lack of support for this from Mobilinc has been a tremendous disappointment. I have no problem waiting until you are comfortable and have the time - I just don't have the skills to do this myself. The features I would use the most is armed away, armed vacation, switching locations, and arm stay. The app responds so quickly that I don't have any issue going to the settings menu or maybe its own listing in the menu might be best. The more I think about it, a menu button to change locations would be fine. Even in Mobilinc you need to go to my settings to change profiles, so placing it on the menu would be quicker. On another note, I spent several hours today trying to install a trusted certificate from CACert on the ISY with no luck. This is the second time I have spent several hours on this. I understand the importance but the documentation is not very good for someone who doesn't know what they are doing. Once again, thanks for your consideration and the app. Regards, Dennis Link to comment Share on other sites More sharing options...
Michel Kohanim Posted March 13, 2016 Share Posted March 13, 2016 Hi Michael, I am going to let Benoit respond to your ISY Portal question. With kind regards, Michel Link to comment Share on other sites More sharing options...
bmercier Posted March 13, 2016 Share Posted March 13, 2016 No problem! Lots of work still to do. One question I had is this. When the 'Authorize' button is clicked - the app simply retrieves https://my.isy.io/api/isys (with basic auth - using the supplied username and password) and parses the JSON to retrieve the 'isykey' value. This, as you know, is the secret value that transforms the my.isy.io API into the same URL structure as a local ISY. My question is this - I only have a single ISY in my Portal account. If there is more than one, how is this represented in the JSON? I assume in the 'data' block there are multiple 'isy' blocks - are there more than one 'domain' blocks (within the 'data' block)? It seems odd - because at the root of the 'data' block is the uuid - and I would think that would be within the 'isy' block - and the 'alias' is in the 'domain' block - not the 'isy' block... How is the 'default' ISY represented? I know it's reverse engineered. Is there documentation for the API? I'm hoping that I can have the app list all connected ISYs and ask the user to select which one... Michael. Hi Michael, You can simulate an additionnal ISY; just add a dummy one to your account. They ISY you add does not have to be valid, you can try 11:22:33:44:55:66. The 'data' is actually an array of ISYs. 'domain' is just a reference yo your own account. There is no default ISY. You can however use the 'preferred ISY' on the user profile. I have not developed an API to lookup a specific user profile. However, you could use GET /users to retrieve all users of your account. Unfortunately, the APIs are not documented. Benoit. Link to comment Share on other sites More sharing options...
MWareman Posted March 13, 2016 Author Share Posted March 13, 2016 Thanks Benoit! I'll add a dummy ISY and figure things out from there... @Dennisc, I'm starting to formulate how I might support multiple 'profiles'. Swiping to the left on the status display will cause a popup... 'Do you want to add an additional profile?'. On yes, you'll be asked to name the current one first - and then give the new profile a name. Next step, the settings screen to enter connection details for the secondary profile. After definition - Swiping the display to switch profiles... This way, no additional menu needed - and easy switching. I'll have the currently selected profile persist. It's going to take a bit to implement - but I'm starting to lay the groundwork already.... Michael. Link to comment Share on other sites More sharing options...
DennisC Posted March 13, 2016 Share Posted March 13, 2016 Michael, Swiping sounds even simpler and a good idea. Dennis Link to comment Share on other sites More sharing options...
MWareman Posted March 14, 2016 Author Share Posted March 14, 2016 Benoit, I've added a dummy ISY - but on the /api/isys page the secondary ISY does not have a 'isykey' attribute. Is this because a real ISY have not activated to the account yet? Can I assume that if a second actual ISY was connected - the value would be populated? Also - if 'domain' is a reference to the account - and 'data' the array of ISYs - why is 'alias' subordinate to 'domain' instead of 'data'? It seems improperly placed. Same with 'iftttInKey' - it also occurs under 'domain' instead of directly under 'data'. Thanks! Michael. Link to comment Share on other sites More sharing options...
bmercier Posted March 14, 2016 Share Posted March 14, 2016 Benoit, I've added a dummy ISY - but on the /api/isys page the secondary ISY does not have a 'isykey' attribute. Is this because a real ISY have not activated to the account yet? Can I assume that if a second actual ISY was connected - the value would be populated? Also - if 'domain' is a reference to the account - and 'data' the array of ISYs - why is 'alias' subordinate to 'domain' instead of 'data'? It seems improperly placed. Same with 'iftttInKey' - it also occurs under 'domain' instead of directly under 'data'. Thanks! Michael. > Can I assume that if a second actual ISY was connected - the value would be populated? Exactly. It gets populated on the first connection. > Also - if 'domain' is a reference to the account - and 'data' the array of ISYs - why is 'alias' subordinate to 'domain' instead of 'data'? It seems improperly placed. Same with 'iftttInKey' - it also occurs under 'domain' instead of directly under 'data' Let's take this sample output: { "domain":{ "_id":"55be3d3c7628133635181zzz", "parent":"", "type":"1", "shortname":"BMercier", "description":"ISYPortal testing", "contactname":"Benoit Mercier", "contactphone":"", "contactemail":"", "address":"", "website":"" }, "data":[ { "_id":"54c0747b788561b0f3977999", "uuid":"11:22:33:44:55:66", "isy":{ "model":"ISY994i Series", "app":"Insteon_UD994_OADR", "platform":"ISY-C-994", "firmware":"4.3.26", "features":{ "oadr":true }, "updated":true, "securityEnabled":true, "isRegistered":true }, "online":true, "lastModified":"2016-03-13T16:12:00.901Z", "domain":[ { "id":"55be3d3c7628133635181999", "alias":"", "registered":1 } ], "ip":"192.222.139.000", "cipher":"AES256-SHA", "isyKey":"c92a77908bc6820a1249a7161407c98da167e30bf08a741f16008aaded34e999" }, { "_id":"54f377a3e17e56fee3039999", "uuid":"66:55:44:33:22:11", "domain":[ { "id":"55be3d3c7628133635181999", "alias":"", "registered":0 } ], "isy":{ "model":"ISY994i Series", "app":"Insteon_UD994", "platform":"ISY-C-994", "firmware":"4.3.10", "features":{ "oadr":true }, "updated":false, "securityEnabled":true, "isRegistered":true }, "online":false, "ip":"192.222.139.000", "cipher":"AES256-SHA256", "lastModified":"2015-12-10T01:27:43.659Z", "isyKey":"87152080ecde1724aaf15bc9b2e21a919725e69c1f0a5bc88d97ccf415bdf999" } ] } The first level domain object is the account information. data is the array of ISYs in your account. ISYs can belong to multiple accounts. So when this API return ISYs, it will return only the ISYs that belong to the account. Furthermore, within the ISY record, you see a domain array with a single object. This contains ISY informations that contains account specific data. In this API, the domain array will always contain only one object. For example, an ISY 11:22:33:44:55:66 in your account may have an alias of 'test'. But if lets say this same ISY also belongs to another account, for that second account, it may have an alias of 'test2'. In this record, you can also see the registered flag, which of course is also account specific. Here's the meaning of the registered flag 1 = registered 0 = pending approval -1 = revoked Benoit. Link to comment Share on other sites More sharing options...
MWareman Posted March 14, 2016 Author Share Posted March 14, 2016 Got it - Thanks Benoit! Totally forgot that an ISY can belong to different portal accounts - with different aliases (and keys!). I *think* I'm almost done with allowing a secondary profile... So multi-ISY in a Portal account are next! Thanks for the help.. Michael. Link to comment Share on other sites More sharing options...
MWareman Posted March 15, 2016 Author Share Posted March 15, 2016 I've just posted build 72 (identified as version 0.6). New: 2 profiles. Swipe left on the status display - give the initial profile a name, name the new profile - then make an changes to the settings. The initial settings are duplicated from the initial profile. Currently - no way to remove the second profile once created. Modified: Settings screen. I've made it an activity instead of a dialog. This should let it scroll. I've also rearranged some elements - and hidden more if not relevant - making for a smaller dialog (so more fits when the keyboard pops up). Background is now black, with white text - this appears to allow the cursor to appear. Hopefully, less typing blind! Please note, this required significant internal data structure changes... (all the config variables became arrays - and the remembered wifi networks became two-dimensional arrays. Fun!). I *think* I got everything - but it's likely there are still issues. If you start seeing strange config parameters - the easiest way to reset the app is to go into Androids App settings, and clear the storage for the app. Please let me know how it goes with 2 profiles.... hopefully it works as it should. Next: Selecting from multiple ISYs in a single portal account. This is also a good use case for profile switching... However, I'm going to let this version soak for a little first. Michael. Edit: Bumped to build 73 (still 0.6 version). I've changed the app icon to one that's allowed to be used commercially without attribution... and made it consistent between the app and Play store. Link to comment Share on other sites More sharing options...
DennisC Posted March 15, 2016 Share Posted March 15, 2016 Michael, I will download and test the second profile tonight. Thank you. Dennis Link to comment Share on other sites More sharing options...
DennisC Posted March 15, 2016 Share Posted March 15, 2016 I've just posted build 72 (identified as version 0.6). New: 2 profiles. Swipe left on the status display - give the initial profile a name, name the new profile - then make an changes to the settings. The initial settings are duplicated from the initial profile. Currently - no way to remove the second profile once created. Modified: Settings screen. I've made it an activity instead of a dialog. This should let it scroll. I've also rearranged some elements - and hidden more if not relevant - making for a smaller dialog (so more fits when the keyboard pops up). Background is now black, with white text - this appears to allow the cursor to appear. Hopefully, less typing blind! Please note, this required significant internal data structure changes... (all the config variables became arrays - and the remembered wifi networks became two-dimensional arrays. Fun!). I *think* I got everything - but it's likely there are still issues. If you start seeing strange config parameters - the easiest way to reset the app is to go into Androids App settings, and clear the storage for the app. Please let me know how it goes with 2 profiles.... hopefully it works as it should. Next: Selecting from multiple ISYs in a single portal account. This is also a good use case for profile switching... However, I'm going to let this version soak for a little first. Michael. Edit: Bumped to build 73 (still 0.6 version). I've changed the app icon to one that's allowed to be used commercially without attribution... and made it consistent between the app and Play store. Michael, The settings screen is definitely easier to read and it does scroll so that what you are typing is now visible. Big improvement! As for the 2nd profile, I'm afraid I see no reaction by swiping to the left (or any other direction for that matter). I can't seem to get to the 2nd profile page. Regards, Dennis PS: I am on a Galaxy S4. My wife also has a S4, and if you want I can load the app on her phone (fresh install) and see if it makes a difference. Link to comment Share on other sites More sharing options...
MWareman Posted March 15, 2016 Author Share Posted March 15, 2016 Michael, The settings screen is definitely easier to read and it does scroll so that what you are typing is now visible. Big improvement! As for the 2nd profile, I'm afraid I see no reaction by swiping to the left (or any other direction for that matter). I can't seem to get to the 2nd profile page. Regards, Dennis PS: I am on a Galaxy S4. My wife also has a S4, and if you want I can load the app on her phone (fresh install) and see if it makes a difference. Just to make sure I described the correct place to swipe - here is an image. Also, please ensure that '0.6' is in the lower-right corner... I tested on a Nexus 6P, Nexus 5 and a Nexus 9... and it appears to function there... Let me know if it still isn't working and I'll see if I can research possible causes. Michael. Link to comment Share on other sites More sharing options...
DennisC Posted March 16, 2016 Share Posted March 16, 2016 Just to make sure I described the correct place to swipe - here is an image. Also, please ensure that '0.6' is in the lower-right corner... I tested on a Nexus 6P, Nexus 5 and a Nexus 9... and it appears to function there... Let me know if it still isn't working and I'll see if I can research possible causes. app.png Michael. My bad, I thought I swiped over the status icon but I guess I didn't. I will set it up and test. Thanks for your patience. Dennis Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.