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

Beta API - http Commands (3.341)


Question

Guest deraaij
Posted

Hi all,

Just to share for those who did not figure it out already, the following http commands work with the beta version:

Devices:

ID = device ID

name = action

arg1 = (e.g. value dimmer)

http:///api/callAction?deviceID=4&name=turnOff

http:///api/callAction?deviceID=7&name=setValue&arg1=39

Virtual Devices

ID = device ID

arg1 = button ID

arg2 = slider value (only for slider)

http:///api/callAction?deviceID=15&name=pressButton&arg1=2

http:///api/callAction?deviceID=51&name=setSlider&arg1=8&arg2=30

Notification

ID = Device (Iphone, e-mail et cetera)

arg1 = Notification template

http:///api/callActiondeviceID=9&name=sendDefinedPushNotification&arg1=1

Arm/Disarm devices

arg1 = 1 - Armed

arg1 = 0 - Disarmed

http:///api/callAction?deviceID=51&&name=setArmed&arg1=0

Scene

ID = SceneID

http:///api/sceneControl?id=14&action=start

http:///api/sceneControl?id=14&action=stop

Get json status from api:

http:///api/rooms

http:///api/scenes

http:///api/devices

http:///api/devices?id=316 # Specific value of a device

http:///api/virtualDevices

http:///api/globalVariables

http:///api/weather

http:///api/sections

http:///api/users

http:///api/energy/now-3600/now/single/devices/power/58

Updates used by mobile:

http:///api/mobile/interface/refreshStates?last=3058

Reboot:

Post --> http:///api/settings/reboot

etc.

change variabele example:

Unfortunately will not trigger scene (yet):

Please login or register to see this code.

Regards,

Mark

Recommended Posts

  • 0
Posted

jcs10,

in LUA:

Local temp = fibaro:getValue(28, "Value")

  • 0
Posted

richo, fibaro:getType(); is fixed in next version for scenes

  • 0
Guest jcs10
  • Inquirer
  • Posted

    Thanx for the answers, but... it's to create some graphs from my temp sensor.

    • 0
    Guest deraaij
  • Inquirer
  • Posted

    Added example api to device enrgy panel (http:///api/energy/now-3600/now/single/devices/power/58)

    • 0
    Posted

    I try to integrate new API HC2 in a IOS remote application called Roomie for lightning control witin the Roomie app. In the old API there were no problem with the http commands, i just added the correct IP address and used port 80. But now with the new API and new commands i only get HTTP/1.1 401 Unauthorized. What am i missing? is there an other port that needs to be used?

    Any help appreciated!

    • 0
    Guest deraaij
  • Inquirer
  • Posted
    I try to integrate new API HC2 in a IOS remote application called Roomie for lightning control witin the Roomie app. In the old API there were no problem with the http commands, i just added the correct IP address and used port 80. But now with the new API and new commands i only get HTTP/1.1 401 Unauthorized. What am i missing? is there an other port that needs to be used?

    Any help appreciated!

    You have to use the user and password in the url, like this:

    Please login or register to see this link.

    • 0
    Posted

    Thank you Mark!! Now it works perfectly!

    • 0
    Posted

    curl -X PUT -d '{"name": "Test", "value": "122"}'

    Please login or register to see this link.

    Does that working ???

    Edit: Yes it is working ^^

    • 0
    Guest deraaij
  • Inquirer
  • Posted

    curl -X PUT -d '{"name": "Test", "value": "122"}'

    Please login or register to see this link.

    Does that working ???

    Edit: Yes it is working ^^

    There is only a bug (logged in bugzilla) that a scene will not be triggered by a value change, it will however work in scene's where it is not used as a trigger.

    • 0
    Posted

    I know, I only want to update the value for xbmc, to have the ID off the movie we are watching.

    • 0
    Guest thales almeida
  • Inquirer
  • Posted

    Hi guys, on the 1.xx firmware, I used to send commands to Fibaro, via Redeye (IR controller), but on the redeye interface we need to inform the IP in one box, and the message on another one, and we are not able to put user:password@ip on the IP box, so the authentication never work. Is there another way to send this authentication? tks

    • 0
    Posted

    thales almeida, give more details what you can send

    can you send GET url?

    • 0
    Posted

    Fibaro, is the Virtual device also available through a json request?

    *UPDATE: already got it

    Please login or register to see this image.

    /emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    @Adv.Usr.deraaij could you update your first post with:

    http:///api/virtualDevices

    • 0
    Guest Martial25
  • Inquirer
  • Posted

    Hello,

    Do you have examples of API with the energy panel.

    I would like to retrieve the set of values ​​to graphs (live, day, month, year)

    Thank you in advance

    Regards

    Martial

    • 0
    Guest deraaij
  • Inquirer
  • Posted
    Fibaro, is the Virtual device also available through a json request?

    *UPDATE: already got it

    Please login or register to see this image.

    /emoticons/default_wink.png" alt=";)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

    @Adv.Usr.deraaij could you update your first post with:

    http:///api/virtualDevices

    Done.

    [ Added: 2013-03-29, 21:25 ]

    Hello,

    Do you have examples of API with the energy panel.

    I would like to retrieve the set of values ​​to graphs (live, day, month, year)

    Thank you in advance

    Regards

    Martial

    I will have a look for you, unfortunately I have some issues now which prevent me from checking it directly ....

    • 0
    Posted

    In virtual devices only the first 4 buttons will send http commands.

    This command will work in button 1 not in 5 and up

    -- Setting up the connection data

    domation = Net.FHttp("192.168.1.41", 80)

    response = domation:GET("/index.php?color=red")

    fibaro:log(response);

    Button numbers will count further even when an earlier number is deleted.

    I have now button 1-4 and then 9 and 10.

    • 0
    Guest thales almeida
  • Inquirer
  • Posted
    thales almeida, give more details what you can send

    can you send GET url?

    Ex: We put the fibaro IP on a box and the command on a script page:

    IP: 192.168.1.180 (Our HC2 IP)

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

    But now, we need to put that header on the message, and there isn’t a place to put it.

    What we need to know is if there is another way to send this authorization, maybe on the message, but not on the header. Something like this…

    Ex:

    IP:192.168.1.180

    Scripting.SendHttpMessage("api/callAction?deviceID=7&name=setValue&arg1=39user:password”)

    Thank you for your attention .

    • 0
    Posted

    Update:

    Problem is only when buttons are removed.

    New created virtual devices will work fine also for button's 5 and Up

    • 0
    Posted

    Is it possible to access all events through the HTTP API (from the Event Panel)?

    • 0
    Posted

    dvalfrid, yes

    date as timestamp

    example

    Please login or register to see this link.

    Guest
    This topic is now closed to further replies.
    ×
    ×
    • Create New...