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
Guest deraaij
  • Inquirer
  • Posted
    Not works

    Please login or register to see this image.

    /emoticons/default_icon_curve.gif" alt=":-/" />

    The url works but the value are unchanged

    Hi, in the first post you can find an example, it is only possible by using "PUT" instead of GET.

    • 0
    Posted

    Any Ideas in c#?

    Trying it through;

    Please login or register to see this code.

    Where uri is:

    Please login or register to see this link.

    and json is the json string of a variable.

    But I am getting a targetinvocationException. With an inner exception about reflection so something not right...[/code]

    • 0
    Posted

    I don't know C# but I think POST and PUT is different.

    • 0
    Posted

    Yeah I tried both... but same result

    • 0
    Posted
    Not works

    Please login or register to see this image.

    /emoticons/default_icon_curve.gif" alt=":-/" />

    The url works but the value are unchanged

    Hi, in the first post you can find an example, it is only possible by using "PUT" instead of GET.

    Yes i see it, but i have some difficul to make a PUT request with Python code with authentification, It is more easy for me with the GET method

    • 0
    Posted

    Haha same thing in C#

    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" />

    • 0
    Guest deraaij
  • Inquirer
  • Posted

    mhhhm i have certainly done it in python, unfortunately I cannot find the code (I am now not using it anymore as the API does not invoke a trigger currently, logged bug).

    • 0
    Posted

    I find it ! in Python

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    Good luck for C# !

    • 0
    Guest deraaij
  • Inquirer
  • Posted
    I find it ! in Python

    Please login or register to see this image.

    /emoticons/default_icon_biggrin.gif" alt=":-D" />

    Good luck for C# !

    Please post it, so others can benefit

    Please login or register to see this image.

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

    • 0
    Posted

    Yes, no problem

    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" />

    This is 3 request (Get, Post and Put) in python who works with the HC2 API.

    Please login or register to see this code.

    • 0
    Posted

    Virtual Device

    set a label value with ID Status

    Please login or register to see this code.

    set the icon

    Please login or register to see this code.

    • 0
    Posted

    If I understand, you say we can change icon status on virtual device???

    • 0
    Posted

    you can control

    the icon

    send text to labels

    in addition to slider and button

    Will there be a new version of xbmc plugin that pushes status and icon?

    • 0
    Posted

    Why not, I can check to do that as soon as I understand that virtual device.

    I will check tonight.

    [ Added: 2013-08-28, 11:03 ]

    If somebody have some good icon for xbmc on and off would be great.

    • 0
    Guest merylion
  • Inquirer
  • Posted

    Hi,

    Seems like setting of global variable is not so easy.

    I would like to have some BAT file or something like icons on my WIndows desktop

    where each one is setting different value to one global variable.

    Then in Lua itself I will be handling this propertly

    I know that easier is to start scene but then I will have to create dozen of scenes as I am planning to have many shortcuts.

    Main problem is how to create any BAT file or any other application which can send HTTP request towards FIbaro

    Thank in advance

    Marcin

    • 0
    Posted

    Does anyone know the http command for the roller shutter module, to stop? I am using up and down command just like dimmers with %. I want to stop it, not in any particular position.

    • 0
    Posted

    This should do it:

    http:///api/callAction?deviceID=&name=stop

    • 0
    Posted

    What about thermostats and the time they should be active?

    • 0
    Posted
    What about thermostats and the time they should be active?

    to find the action names use the web api

    Please login or register to see this code.

    and you will get the settings of the device and the actions supported

    Please login or register to see this code.

    "actions":{"pollingTimeSec":1,"requestNodeNeighborUpdate":0,"setTargetLevel":0,"setTime":1}

    • 0
    Guest Charly86
  • Inquirer
  • Posted

    Ok, this documentation is fine and help a lot.

    Unfortunatly I'am trying to "set" a value for a property of a device (a everspring st814), but it does not work, if anyone has a idea, I would appreciate. Id 27 = temperature sensor

    What I'm trying :

    curl -X GET "http://admin:[email protected]/api/callAction?deviceid=27&name=setProperty&name=userDescription&value=test"

    doest not work, neither

    curl -X GET "http://admin:[email protected]/api/callAction?deviceid=27&name=setProperty&arg1=userDescription&arg2=test"

    If you know how to do it in LUA I will take also, it drive me mad !!!

    Thanks,

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