Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Run HC2 device commands or scene from external devices (API)


Question

Posted

Hi,

To control my media center equipment, I am currently using a RedEye remote from Thinkflood.

This device is capable of sending outgoing HTTP requests or any information over a TCP socket (by using LuaSocket scripting).

Currently, my RedEye remote correctly enables all the necessary devices without any problems. However, my projector screen is being switched by a Fibaro shutter switch (attached to my HC2).

Are there any options to send an HTTP request directly to the HC2 controller, telling it to lower the projector screen?

Any help would be much appreciated.

Best regards,

BAS

13 answers to this question

Recommended Posts

  • 0
Guest deraaij
Posted
Hi,

To control my media center equipment, I am currently using a RedEye remote from Thinkflood.

This device is capable of sending outgoing HTTP requests or any information over a TCP socket (by using LuaSocket scripting).

Currently, my RedEye remote correctly enables all the necessary devices without any problems. However, my projector screen is being switched by a Fibaro shutter switch (attached to my HC2).

Are there any options to send an HTTP request directly to the HC2 controller, telling it to lower the projector screen?

Any help would be much appreciated.

Best regards,

BAS

Make a virtual device with the correct IP address and Port.

In string to send:

Please login or register to see this code.

where the path is the part of the string after the ip address (and port).

Regards,

Mark

EDIT:

Sorry didn't read you message corect. As long as there is no API you can have a look at:

Hi Marcel,

you may have check this out.

Please login or register to see this link.

I haven't got any feedback if this works for other users. I've done some reverse engineering and it works for my setup. Not sure if there aren't any device/home network specific codes that I potentially missed.

Cheers,

Klaudiusz

  • 0
  • Inquirer
  • Posted

    Hi Mark,

    Thanks for your feedback. I have checked the API page you quoted previously, however this does not seem to work on the latest beta version (2.138) anymore.

    TCP port 4420, which the API would use to communicate with the FibaroServer process is not listening anymore in this firmware.

    Hopefully Fibaro will implement such a feature in a future release...

    Regards,

    BAS

    • 0
    Guest deraaij
    Posted
    Hi Mark,

    Thanks for your feedback. I have checked the API page you quoted previously, however this does not seem to work on the latest beta version (2.138) anymore.

    TCP port 4420, which the API would use to communicate with the FibaroServer process is not listening anymore in this firmware.

    Hopefully Fibaro will implement such a feature in a future release...

    Regards,

    BAS

    No problem. Ok good to know. The latest beta is meant for migrating to a full API, so it will come..... I need it to

    Please login or register to see this image.

    /emoticons/default_icon_smile.gif" alt=":-)" />

    Regards,

    Mark

    • 0
    Guest Eduardo
    Posted

    Hi,

    when I was using the 1.44 version I integrated redeye to send http commands with the HC2, using this string

    Scripting.SendHttpMessage("fibaro/externalRequest.php?id=setDimmableLight&deviceID=xx&value=xx")

    With the new version how do I do that?

    at the webrowser now I use: http:///api/callAction?deviceID=xx&name=setValue&arg1=xx, and the command works, but at the redeye controller don't!

    I also tried with the user when i'm not logged into HC2:

    admin:admin@http:///api/callAction?deviceID=xx&name=setValue&arg1=xx, again works in browser and not in the redeye!

    Any Ideas??

    Regards

    Eduardo

    • 0
  • Inquirer
  • Posted
    Hi,

    when I was using the 1.44 version I integrated redeye to send http commands with the HC2, using this string

    Scripting.SendHttpMessage("fibaro/externalRequest.php?id=setDimmableLight&deviceID=xx&value=xx")

    With the new version how do I do that?

    at the webrowser now I use: http:///api/callAction?deviceID=xx&name=setValue&arg1=xx, and the command works, but at the redeye controller don't!

    I also tried with the user when i'm not logged into HC2:

    admin:admin@http:///api/callAction?deviceID=xx&name=setValue&arg1=xx, again works in browser and not in the redeye!

    Any Ideas??

    Regards

    Eduardo

    Hi Eduardo,

    Add a new device with a new IP port:

    - Protocol: HTTP

    - Hostname: IP address of your HC2

    - Port number: 80

    Then add a new command, using the following script:

    Please login or register to see this code.

    The included Base64 encoded part stands for admin:admin

    Hope this helps.

    Good luck!

    BAS

    • 0
    Guest thales almeida
    Posted

    yeah, it helped us a lot. Thank you so much BAS

    • 0
    Guest Eduardo
    Posted

    Thanks BAS, this was very helpfulll!!!!!

    • 0
    Posted

    Hi,

    I just can't get it to work.

    Have added new device and new IP port to Redeye.

    - Protocol: HTTP

    - Hostname: IP address of your HC2

    - Port number: 80

    Then copy code from this page to script window.

    require "systemScript"

    local headers = {

    ["Accept"] = "text/plain",

    ["Accept-Charset"] = "utf-8",

    ["Authorization"] = "Basic YWRtaW46YWRtaW4=" -- Base64 encoded username:password (admin:admin)

    }

    Scripting.SendHttpMessage("api/callAction?deviceID=60&name=setValue&arg1=100", nil, nil, headers)

    My dimmer id is 60, username and password admin.

    Home Center software 3.550.

    This is driving me crazy.

    Regards

    Mitam

    • 0
    Posted

    try first that

    Please login or register to see this code.

    • 0
    Guest Eduardo
    Posted

    Hello have a new problem again!!

    Have a redeye integrated with a somfy controller via rs232. At the redeye script I send these commands using Lua:

    down

    require "systemScript"

    Scripting.SendMessage("\127\242\250\001\000\000\224\111\250\255\253\006\177")

    stop

    require "systemScript"

    Scripting.SendMessage("\127\242\250\001\000\000\224\111\250\255\252\006\176")

    up

    require "systemScript"

    Scripting.SendMessage("\127\242\250\001\000\000\224\111\250\255\254\006\178")

    I would like to know how can I send thse commands using the virtual device in Fibaro! Any ideas!!

    Regards

    Eduardo

    • 0
    Posted

    Eduardo,

    If your commands works fine as a LUA scene, then you can create virtual device with LUA option, and specyfic button will run your code.

    • 0
    Guest Eduardo
    Posted

    Krystian,

    I´ve already tried that and did´n get any response....

    [ Added: 2014-03-24, 16:19 ]

    Doesn´t work as a Lua scene, the script that i postedis from the redeye.

    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.

    ×
    ×
    • Create New...