Announcement

Collapse
No announcement yet.

XML HTTP RESTful API for HS3 - Discussion Thread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mark_anderson_us
    replied
    Any plans to support JSON? Not sure if it's a big effort. (in CherryPy web server--for example--its a simple switch to enable it (alongside XML))
    Last edited by mark_anderson_us; June 17, 2014, 03:35 PM.

    Leave a comment:


  • mark_anderson_us
    replied
    Hi Guys

    Did some playing on my proof of concept. Posted message here: http://board.homeseer.com/showpost.p...08&postcount=1

    Basically the layout is responsive, icons are vector, can be colored with CSS and reflections are done with CSS too

    Regards

    Mark

    Leave a comment:


  • mark_anderson_us
    replied
    Originally posted by Phaeton View Post
    Hi mark.

    What i did do with hs2 is using the ultralog plugin with MySQL. Used that in combination with the plugin hstenserver. I used mysql to get status (ajax did the refreshing of divs containing info). I used hstenserver for toggling etc.

    What I want to do is use the sqlite database from hs3 in combination with this very nice rest api. Because my gut says sending commands won't cause a great lag.(not sure)

    I made a panel with the bootstrap framework so its responsive. I had zero to none experience with php, JavaScript, mysql and a little experience with HTML and CSS.

    It was fun to do. Maybe a option for you?

    Verstuurd vanaf mijn Nexus 5 met Tapatalk
    I didn't use mySQl. I uses SQL Server and produced reports using SSRS

    Would be interested to see what you've done BUT not remotely interested in PHP. Gave that up years ago. Been using ASP.NET a lot since, but now trying to stick to as much JavaScript and MV* frameworks as possible

    Leave a comment:


  • Phaeton
    replied
    Hi mark.

    What i did do with hs2 is using the ultralog plugin with MySQL. Used that in combination with the plugin hstenserver. I used mysql to get status (ajax did the refreshing of divs containing info). I used hstenserver for toggling etc.

    What I want to do is use the sqlite database from hs3 in combination with this very nice rest api. Because my gut says sending commands won't cause a great lag.(not sure)

    I made a panel with the bootstrap framework so its responsive. I had zero to none experience with php, JavaScript, mysql and a little experience with HTML and CSS.

    It was fun to do. Maybe a option for you?

    Verstuurd vanaf mijn Nexus 5 met Tapatalk

    Leave a comment:


  • mark_anderson_us
    replied
    Originally posted by RedTechie View Post
    First let me apologize. For some reason the HS forums don't always send me email updates to my topics. I will double check my settings.





    Count me interested! I have known about HomeSeer for a long time now. I recently switched to it from Vera about 6 or so months ago. That is when I wrote this REST API because I was completely shocked that HS *still* didn't have a native REST API when most of its competitors did.

    I would love to see more modern apps built using angular, MVC methodology and bootstrap!

    In terms of the API's functionality, let me start with support; I offer what support I can (I built it in my spare time) but I still try to answer questions and when I get time, upgrade it with feature requests. I also encourage others to post updates to it as well.

    In terms of the features you mentioned. It should be able to do most of what you want to do besides news/weather. When I built it I built it with controlling lights in mind. So it can dim, turn them on/off, execute events and get status info. Other features would need to be added.

    The one thing I noticed while using it myself in a Adobe Air application running on my desktop is if you send to many requests to it over a long period of time it lags a bit. I dont believe this is a problem with the REST API but more of a problem with the backend HomeSeer control APIs.

    Let me know how you make out!
    I'm just learning Angular and MVC fairly new to (*real* JavaScript: IIFE's, Closures, Higher order functions, etc.) if I embark on this project, it's as much and exercise for my new skills as anything else. I just don't want to wait for a new version of HS3 and very close to switching to Indigo.

    Does sound like we have similar issue with lags. If I leave my server on for several days events are delayed from a few seconds on day 1 to, sometimes, several minutes by day 4 or 5. I used to have a scheduled reboot every week, but it still unusable, so now I'm down to once a day. Real tired of all the error messages about z-wave stats when i don;t even had one: removed it 2 years ago.

    The only things that are stopping me moving to Indigo immediately are:
    • Python scripting. I'm sure it's not hard to learn, but already working with C#, SQL, JavaScript, etc. would prefer not to have to learn another language (unless it's something cool). Would much rather invest my time learning more MV* frameworks, Node.js, front-end dev tools, other ORM's, etc.
    • Indigo Touch (what I would start with) doesn't handle screen swapping based on rotations and there doesn't seem to be a way to restrict layouts to specific devices: so, (it seems) that an iPad retina layout is available to an iPhone and just scaled. While I don't like the idea of scaling, having to maintain 4 different projects for 4 different screen resolutions in HS is a real pain too. Not sure which is worse. (Of course, with a web client, I can deal with all this myself.)
    • I have to build an interface for RS232 message reception so my URC integration works. Couldn't live without that - can't beat setting lighting scenes, etc. from AV remote.


    Indigo is a grand total of 2 people (not sure how many are at HS) but they seem very responsive on forums.

    Will keep you posted

    Regards

    Mark

    Leave a comment:


  • mark_anderson_us
    replied
    Originally posted by gear View Post
    Mark, you should be able to do most of what you want without any trouble.

    I ran into a bit of trouble with authentication and security. Were you thinking of using HTTPS?
    I was thinking about HTTP to start and maybe adding HTTPS if it's not too difficult

    Leave a comment:


  • gear
    replied
    Originally posted by mark_anderson_us View Post
    Hi All

    My goal would be to develop a single client using a mobile-first, responsive design (probabl, bootstrap3), that would intelligently "scale" from phone to tablet to desktop (altering layout, adding detail--e.g. more news/weather content--higher quality images as the resolution gets higher).

    How far have any of you got with this REST interface? Is it possible to build a somewhat fully featured client?
    Mark, you should be able to do most of what you want without any trouble.

    I ran into a bit of trouble with authentication and security. Were you thinking of using HTTPS?

    I haven't had the server side issues that you mention with HSTouch, but my client takes a long time to reconnect whenever network routing changes. This is a problem for me when I come home and transfer to home WiFi.

    In my current setup I essentially proxy the RESTful API and this makes the control chain quite long.

    I go Tasker -> SSH plugin -> bash (curl) -> HTML.

    Gear

    Leave a comment:


  • RedTechie
    replied
    Originally posted by JohnneyBoy View Post
    Firstly great extension.. works very good..

    I was surprised at the ordering of the Location parameters, in both the set and get functionality.

    I would have expected
    Floor Room Device

    However it seems to be
    Room Floor Device

    Was this intentional?

    John
    I believe this is due to the way you have rooms displayed or set in your HS environment. I know in HS settings you can change the order they are displayed. But if I remember correctly that doesn't effect the order they are referenced in the code. So if you had the setting set to reverse them and started naming your locations a certain way that would be why you are seeing that sort of behavior.

    Leave a comment:


  • RedTechie
    replied
    Originally posted by NicolaiL View Post
    Very cool code!

    I'm wanting to update the device string for an HS3 device based on a parameter passed across and then also update the Last Change date.

    I can't see a call for this? Would you be able to add this to the script if it doesn't already exist?
    I will keep these features in mind and do some research on if they are possible from HS3 API calls.

    Leave a comment:


  • RedTechie
    replied
    Originally posted by surovich View Post
    Hoping someone has an idea - I can use a URL to unlock a door on my computer - but if I try it in Android, the unlock fails and returns an Indeterminate on the browser? (I did have this working for weeks and lost my Tasker setup.... Now, No luck...)
    There has been no changes recently to the REST API code? Did something change with your z-wave setup? Granted none of the commands I created have been tested with door locks so I can't say for certain how reliable it is when used with that sort of device.

    Leave a comment:


  • RedTechie
    replied
    Originally posted by gear View Post
    RedTechie,

    I also had a bit of trouble interfacing initially - so I made some logging changes and also added an additional command.

    Please take a look a couple edits I made here:
    https://www.dropbox.com/s/c5hyel6r01..._REST_API.aspx

    The commands "GetDeviceStatusValueByName" and "GetDeviceStatusValueByID" should now allow getting and setting of the status of a device which doesn't have defined controls.
    Added the command "setdevicevaluebyid". The arguments are &param1="deviceId as int32"&param2="device value as double".

    Errors now show up for those commands in the HS logging. They are tagged with "RESTful-API".

    Thanks, Geer
    Great! Thanks for digging into the code! I will take a look and add them in the next week or so!

    Leave a comment:


  • RedTechie
    replied
    First let me apologize. For some reason the HS forums don't always send me email updates to my topics. I will double check my settings.


    Originally posted by mark_anderson_us View Post
    Hi All

    I'm about done with HSTouch, between the bugs, lack of upgrade for HS3, and the resource leaks that causes my server to crawl to a halt every few days (consensus seems to be this happens when you have several HS clients: I only have 2 permanently on Android devices).

    How feasible is it to built a reasonably rich 100% HTML client for HS. I'm starting to do a lot more with Javascript, bootstraps, etc, and just examining backbone, ember, angular, etc. Ideally, I'd start with this REST api, and if necessary write a new back-end eventually and use an MV* framework.

    My goal would be to develop a single client using a mobile-first, responsive design (probabl, bootstrap3), that would intelligently "scale" from phone to tablet to desktop (altering layout, adding detail--e.g. more news/weather content--higher quality images as the resolution gets higher).

    How far have any of you got with this REST interface? Is it possible to build a somewhat fully featured client? I basically want:
    1. Buttons that will trigger events
    2. Change device status (e.g. dim a light)
    3. Display news/weather and status.
    4. Would be nice to have real-time device status, but I could live with periodic updates for the currently visible pages.


    I need to make a decision within the next few weeks weather to stay with HS or move to Indigo.

    Regards

    Mark

    Count me interested! I have known about HomeSeer for a long time now. I recently switched to it from Vera about 6 or so months ago. That is when I wrote this REST API because I was completely shocked that HS *still* didn't have a native REST API when most of its competitors did.

    I would love to see more modern apps built using angular, MVC methodology and bootstrap!

    In terms of the API's functionality, let me start with support; I offer what support I can (I built it in my spare time) but I still try to answer questions and when I get time, upgrade it with feature requests. I also encourage others to post updates to it as well.

    In terms of the features you mentioned. It should be able to do most of what you want to do besides news/weather. When I built it I built it with controlling lights in mind. So it can dim, turn them on/off, execute events and get status info. Other features would need to be added.

    The one thing I noticed while using it myself in a Adobe Air application running on my desktop is if you send to many requests to it over a long period of time it lags a bit. I dont believe this is a problem with the REST API but more of a problem with the backend HomeSeer control APIs.

    Let me know how you make out!

    Leave a comment:


  • mark_anderson_us
    replied
    Hi All

    I'm about done with HSTouch, between the bugs, lack of upgrade for HS3, and the resource leaks that causes my server to crawl to a halt every few days (consensus seems to be this happens when you have several HS clients: I only have 2 permanently on Android devices).

    How feasible is it to built a reasonably rich 100% HTML client for HS. I'm starting to do a lot more with Javascript, bootstraps, etc, and just examining backbone, ember, angular, etc. Ideally, I'd start with this REST api, and if necessary write a new back-end eventually and use an MV* framework.

    My goal would be to develop a single client using a mobile-first, responsive design (probabl, bootstrap3), that would intelligently "scale" from phone to tablet to desktop (altering layout, adding detail--e.g. more news/weather content--higher quality images as the resolution gets higher).

    How far have any of you got with this REST interface? Is it possible to build a somewhat fully featured client? I basically want:
    1. Buttons that will trigger events
    2. Change device status (e.g. dim a light)
    3. Display news/weather and status.
    4. Would be nice to have real-time device status, but I could live with periodic updates for the currently visible pages.


    I need to make a decision within the next few weeks weather to stay with HS or move to Indigo.

    Regards

    Mark

    Leave a comment:


  • JohnneyBoy
    replied
    Firstly great extension.. works very good..

    I was surprised at the ordering of the Location parameters, in both the set and get functionality.

    I would have expected
    Floor Room Device

    However it seems to be
    Room Floor Device

    Was this intentional?

    John

    Leave a comment:


  • rjdevries
    replied
    RedTechie

    Thanks for this, I was really frustrated when upgrading to HS3 broke my own scripts, but yours is exactly what I needed to get my Roomie working again.
    Noticing that you have the 'get' functionality in there also, I'll try and see if my roomie setup can now poll light status as well. If successful, I'll be sure to post it here.

    Thanks again!

    Leave a comment:

Working...
X