Jump to content

Welcome, Guest!

Be a part of CinemaVision today! Once registered and logged in, you will have access to public chat and your own private messenger, you can view and contribute guides, collaborate on the forums, review downloads, give reputation to your fellow members, contribute content and so much more. Registering is quick and completely free, so what are you waiting for?
   Sign In    Sign Up

Become a RedCarpet Club Member Today!

   Join Now

Question

Hello,

I am new to this site and this forum. So new in fact, I have not even installed this add-on yet. This will be my weekend play chore.

I wonder if there is any support yet for Insteon or is it in the works/planning? If it is not, can you add it to the list of upcoming features please?

In my current setup with CinemaExperience, as you may know, that add-on communicates with the ISY Browser add-on I believe, via the Home Automation menu.

So when the Trailers or Movie starts, the lights dim to 25% and when paused or stopped, they come on again to 85% per my scene setting.

Since I have everything setup and working, I'd be more than happy to be a beta tester for the feature. Just let me know.

Thanks!

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Hey there! Looking at the Insteon API Documentation, it will work in the next beta release. You'll have to put some work in putting together CVACTION files to talk to your Insteon system, but all the commands you need should be in that API documentation. CVACTION files are pretty simple to script, so you shouldn't have any trouble with it. Check out this post for a quick and dirty example. Once you get them up and working, I'd love to see the finished CVACTION files and a walk through for how to configure it on the Insteon side. We're working on planning a guide section, and I'm sure your examples and walk through will help other users in the community out!

Share this post


Link to post
Share on other sites
  • 0

Wonderful! Thanks a lot. I can definitively do this work and report back.

One thing to keep in mind though, not knowing how familiar you are the Insteon but, there may be two interfaces. The old ISY Insteon, which is where the biggest user base is, and the new Insteon Hub. I am not sure they changed APIs but as long as both are REST based, you should be OK.

Thanks again. Looking forward to the next beta release.

Share this post


Link to post
Share on other sites
  • 0

OK guys, I have put considerable time on this. But before I get there let me please commend you on the efforts thus far. What a great add-on! Really.  It far surpassed my expectations. So, thanks to all of you for all your hard work. I can hardly wait for it to go mainstream.

So, on the automation with the Insteon devices. Here is where I am at.

I was able to control individual devices and even programmed scenes within the action just fine. They are all REST calls so it really a cinch. However, the Insteon modules require Basic HTTP authentication prior to every call.

This line works well from the command line:

curl -D- -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" http://192.168.1.30:80/rest/time

The Basic HTTP Auth is my admin user Base64 encrypted. I thought it would be great if I did not have to show the username and password in clear text while talking to the module.

However, within the cvaction. I can't seem to be able to set the header for this type of authorization. Here is what the action looks like.

HEADER: {"Content-Type": "application/json", "Authorization:": "Basic YWRtaW46YWRtaW4="}
http://192.168.1.30:80/rest/time

The above does not work nor it logs any errors, which really means I am not authenticated. But if I remove the header and add the username and password to the URL, it works just fine. Like this:

http://user:password@192.168.1.30:80/rest/time

Any ideas? Is there a debug mode I can set CV to so I can tell what the action is doing low level. I rely on kodi.log to tell me and there ain't much going there.

 

Share this post


Link to post
Share on other sites
  • 0

Try this:

{"Content-Type": "application/json", "Authorization": "Basic YWRtaW46YWRtaW4="}

There was an extra colon in there. :)

If this works, I'm charging you with putting together example action files for Insteon!

Share this post


Link to post
Share on other sites
  • 0

:) No worries Ragnarok, I'd still like to get examples to share with everyone either way as soon as I get it working properly.

Unfortunately, I had already seen the extra colon and I had removed it in my code. I just happened to grab and post the previous version. It made no difference.

I am not sure the HEADER: parameter is working right. When I have it in there I get this:

20:32:11 T:2124303168  NOTICE: [- CinemaVison -] (API): [!] /home/me/.kodi/CinemaVision/Actions/ISY_994i.cvaction
20:32:11 T:2124303168   ERROR: Traceback (most recent call last):
20:32:11 T:2124303168   ERROR:   File "/home/me/.kodi/addons/script.cinemavision/lib/cinemavision/actions.py", line 128, in init
20:32:11 T:2124303168   ERROR:     self._loadCommands()
20:32:11 T:2124303168   ERROR:   File "/home/me/.kodi/addons/script.cinemavision/lib/cinemavision/actions.py", line 153, in _loadCommands
20:32:11 T:2124303168   ERROR:     name, data = line.split('://', 1)
20:32:11 T:2124303168   ERROR: ValueError: need more than 1 value to unpack
20:32:11 T:2124303168  NOTICE: [- CinemaVison -] (API): Sequence processing finished
20:32:11 T:2124303168  NOTICE: [- CinemaVison -]: Experience: Playing next item: ACTION: /home/me/.kodi/CinemaVision/Actions/ISY_994i.cvaction - AFP ()
20:32:11 T:2124303168  NOTICE: [- CinemaVison -]: Experience: [ -- Finished -------------------------------------------------------------- ]

If I take the header out and add username and password to the URL, I get the full XML response with the output of the time command.

I can keep doing this and finish the action showing ON, OFF and DIMMING but I don't think is the right way. I should be able to set the encoded header just like in the curl command above and perform a get with the REST call.

Share this post


Link to post
Share on other sites
  • 0

Figured it out! I'm an idiot. The header line has an S on it. Should be HEADERS:, plural. That's my fault. I wrote out the documentation wrong. Our developer corrected me.

Share this post


Link to post
Share on other sites
  • 0

No worries Ragnarok. Happens in the best of families... :)

However, even with the S added, still not working. I still think there is something seriously wrong with the HEADERS: call.  Is this scripting language Kodi's or CV's?  I have been trying to find more info about it with no avail.

I ran a few more tests today. I was making a hole in my head scratching it, so I decided to break out my WireShark. I can see clearly that when the HEADERS: is added, there is not even a GET being performed at all. It just blows up behind the scenes with nothing logged other than that parsing error I posted above. But when I use the username:password in the URL I can see the proper Header formed and a successful response.

 

CVactionWireShark.png

Share this post


Link to post
Share on other sites
  • 0

No worries Ragnarok. Happens in the best of families... :)

However, even with the S added, still not working. I still think there is something seriously wrong with the HEADERS: call.  Is this scripting language Kodi's or CV's?  I have been trying to find more info about it with no avail.

I ran a few more tests today. I was making a hole in my head scratching it, so I decided to break out my WireShark. I can see clearly that when the HEADERS: is added, there is not even a GET being performed at all. It just blows up behind the scenes with nothing logged other than that parsing error I posted above. But when I use the username:password in the URL I can see the proper Header formed and a successful response.

 

CVactionWireShark.png

Give the new version a shot. Also, read through the Home Automation section in the Kodi thread, as I kinda screwed up the order in the documentation. That's been corrected. :)

Share this post


Link to post
Share on other sites
  • 0

Thanks. Well... 0.42 does not seem to be working well right now. It could not find any of my sequences and other issues but...

I was able to load my action and now I am seeing a whole new error, so I now code is morphing

07:57:11 T:2326645568  NOTICE: [- CinemaVision -] (API):     -| 'HEADERS:{"Authorization": "Basic YWRtaW46YWRtaW4="}'
07:57:11 T:2326645568  NOTICE: [- CinemaVision -] (API):     -| First action line must have the form: protocol://whateve

So, I need to research this for  a bit to see what changed and how I need to code it now.

Share this post


Link to post
Share on other sites
  • 0

Hey there! So the error would suggest that the HEADERS: line needs to come after the Protocol line. If you move the HEADERS: line under the http:// line, it will work. Take another look at the home automation section in the Kodi thread for examples.

Share this post


Link to post
Share on other sites
  • 0

Thanks Ragnarok. But, no, that was the first thing I tried and still didn't work.

But matters not. I have gone around the ACTION scripts, sort of, and created a module that I load before each call to handle the HTTP Basic authentication.  That seems to be working well.

I have 95% of the write up completed. What is the proper way to share this with others here? I have 2 example files with instructions I'd like to share.

Share this post


Link to post
Share on other sites
  • 0

Excellent! Sorry I wasn't of more help. It's a bit odd being the middle man most days. :) We're working on publishing a Guides section for everyone to contribute to and use for various things, home automation included. If you want, you can post it here, or you can wait and post up a guide as soon as we go live with that section. I'll leave it up to you. If you post it here, I'll move it into the Guides section as soon as it's up.

Share this post


Link to post
Share on other sites
  • 0

I know its been a while... but did this ever go anywhere?  I am thinking of using Insteon switches in my theater and would love to be able to control them with CV.

  • Upvote 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines and Terms of Use.