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
  • 0
DexDeadly

Quick Up & Running OpenHAB

Question

If you are running OpenHAB you can easily integrate with a one line HTTP GET in an action file.  This is a very basic method but could get you up and running within a few mins.  Example:

Create a file named lights_before_trivia.txt

Place this line in the document and replace with the following information:

http://INSERT_LAN_IP:INSERT_PORT/CMD?NAME_OF_SW/GROUP=VALUE

INSERT_LAN_IP = The IP of your OpenHAB server
INSERT_PORT = The Port in which your OpenHAB server is on
NAME_OF_DIM/SW = Put the name of the Switch or Dimmer you want to send the command to Example: Light_HomeTheater_Back_Sw
VALUE = If your sending to a SWITCH use either ON or OFF, if you are sending to a DIMMER use any value between 0 - 100.

Example:

http://192.168.1.10:8080/CMD?Light_HomeTheater_Back_Sw=OFF

Save the file and place in your actions command folder on your Kodi system where you have the CinemaVision folders.  Then within the Sequence editor add the action.  In the example above I placed this right before the trivia slides start.  Once you place the action in, point it to your newly created .txt file.  Save your sequence and run it, your lights should now react within the sequence.

** NOTE: If you have security enabled within OpenHAB you will need to add an additional line to your action file.  The 2nd line in the action file will need to be the following:
HEADERS: {"Authorization": "Basic=XXXXX"}  - You can generate the Basic=XXXX by using the Postman plugin for Chrome. Using Postman you can place in your user credentials and the header line will generate for you.  You can than place this within the header line and you will than be able to send your JSON request lines with authorization turned on.  Here is an example of how the action file can look 

http://192.168.1.10:8080/CMD?Light_HomeTheater_Back_Sw=OFF
HEADERS: {"Authorization": "Basic=XXXXXX"}

** NOTE:Currently when sending a new brightness the dimmer will be a quick change and not a gradual.**  Currently working on a smoother dim which might be done using a rule, but if you want to be up and running with OpenHAB quick heres one way to do it.  I'll post my working example of a smoother dim once I have it.

Edited by DexDeadly
use the code button to avoid formatting

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

Thank you for posting this extremely helpful for the community. :)

Is there anyway to Edit?  I'd like to make a couple edits for clarification now that I reread what is in there.  

Share this post


Link to post
Share on other sites
  • 0

Hello if you could update it to this:

If you are running OpenHAB you can easily integrate with a one line HTTP GET in an action file.  This is a very basic method but could get you up and running within a few mins.  Example:

Create a file named lights_before_trivia.txt

Place this line in the document and replace with the following information:

http://INSERT_LAN_IP:INSERT_PORT/CMD?NAME_OF_SW/GROUP=VALUE

INSERT_LAN_IP = The IP of your OpenHAB server
INSERT_PORT = The Port in which your OpenHAB server is on
NAME_OF_DIM/SW = Put the name of the Switch or Dimmer you want to send the command to Example: Light_HomeTheater_Back_Sw
VALUE = If your sending to a SWITCH use either ON or OFF, if you are sending to a DIMMER use any value between 0 - 100.

Example:

http://192.168.1.10:8080/CMD?Light_HomeTheater_Back_Sw=OFF

Save the file and place in your actions command folder on your Kodi system where you have the CinemaVision folders.  Then within the Sequence editor add the action.  In the example above I placed this right before the trivia slides start.  Once you place the action in, point it to your newly created .txt file.  Save your sequence and run it, your lights should now react within the sequence.

** NOTE:Currently when sending a new brightness the dimmer will be a quick change and not a gradual.**  Currently working on a smoother dim which might be done using a rule, but if you want to be up and running with OpenHAB quick heres one way to do it.  I'll post my working example of a smoother dim once I have it.

Also GamePheonix, from what it looks like is your forum does not allow any post to be edited by users after someone has already replied.  Just noticed this.

Share this post


Link to post
Share on other sites
  • 0

Hi

i would like to turn off my light by action command.

Must be packed information always to a .txt file?

I control my light via Arduino. 
If I enter http://192.168.178.70/index.html?schalte&5 into my browser, 

he starts the light via radio-controlled socket.

Now I have just a HTTP GET command in CinemaVision register.

How does it work? Reads CinemaVision the text file?

Here are my current steps:

GET /index.html?schalte&5
Host: 192.168.178.70
Authorization: Basic *******

 

Thanks for your help =)

best regards

Nils

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.