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

hi, are there some api commands to query the fibaro alarm panel?

i see i can query the alarm panel but no idea of the syntax...

i.d like to be able to get the fibaro alarm status ( armed, partially armed) to trigger some scenes when i arm/ disarm using the alarm panel feature .

  • 0
Posted
hi, are there some api commands to query the fibaro alarm panel?

i see i can query the alarm panel but no idea of the syntax...

i.d like to be able to get the fibaro alarm status ( armed, partially armed) to trigger some scenes when i arm/ disarm using the alarm panel feature .

http:///api/panels/fibaroAlarm looks like it gives you what you want.

Should be added to the first page.

  • 0
Posted

hey thanks, that is a good start, but, correct me if I'm wrong, it only returns the latest breach, and the alarm config (ie what scene will be triggered if alarm is breach + fast accesactors)

I don't seem to find any notion of armed/partially armed, nor the list of sensors it armed (i know i can get that list by other ways, but the goal is to stop maintaining "lists of ids" that should be queried directly to alarm panel)

  • 0
Posted

The alarm panel doesn't contain that information on the webpage so you can't expect it to be there in the API either. The individual device decides whether it reacts to the global arming command.

To simulate that you would need to run through all devices and scan for armed status. So no shortcuts unfortunately that I know of.

  • 0
Posted

I agree with that, anyway, the resulting state(armed/disarmed/partially armed) appears and could be exposed, and could trigger custom things.

The problem underneath that is to be able to trigger actions when you arm the alarm through the alarm panel , and when you disarm normally or under breach (emit a message to confirm alarm is armed, properly finish scenes triggered by alarm breach)

So far i need some additional scenes to arm/disarm, and iphone ipad alarm panel becomes useless

  • 0
Posted

I need to read the value of temperature and luminosity(LUX) of fibaro motion sensor with http commands for building 2 "virtual" sensors in another server.Does anybody know hot to be done?

  • 0
Posted

any of you guys having some expiriance with the api and different users.

you have the default Admin user and i created a second user 'web'.

for scenes everything looks fine

http ://web:web@<%IP%>/api/sceneControl?id=2&action=start

or

http ://admin:admin@<%IP%>/api/sceneControl?id=2&action=start

have the same result. the scene starts fine.

But switching a single device wont work.

Admin works fine

http ://admin:admin@<%IP%>/api/callAction?deviceID=9&name=turnOff

but

http ://web:web@<%IP%>/api/callAction?deviceID=9&name=turnOff

is a no go.

  • 0
Posted

Is it possible to get an icon through the api?

  • 0
Posted

Anyone knows if fibaro hc2 has a get variable instead of a set?

  • 0
Posted
Anyone knows if fibaro hc2 has a get variable instead of a set?

DESCRIPTION

Fibaro: getGlobalValue (varName)

Retrieve information (only the value) of the global variable.

PARAMETERS

varName: the name of the global variable

RETURN VALUES

a string containing the current value of the global variable

more functions:

Please login or register to see this link.

  • 0
Posted
Anyone knows if fibaro hc2 has a get variable instead of a set?

DESCRIPTION

Fibaro: getGlobalValue (varName)

Retrieve information (only the value) of the global variable.

PARAMETERS

varName: the name of the global variable

RETURN VALUES

a string containing the current value of the global variable

more functions:

Please login or register to see this link.

Hi Thanks for the reply.

I was actually looking the the get method on the http api part. I can set a certain value change using http. But now I want to get a value for example the value of a lamp to see if its on or off. But now http only returns the json format.

  • 0
Posted
Anyone knows if fibaro hc2 has a get variable instead of a set?

DESCRIPTION

Fibaro: getGlobalValue (varName)

Retrieve information (only the value) of the global variable.

PARAMETERS

varName: the name of the global variable

RETURN VALUES

a string containing the current value of the global variable

more functions:

Please login or register to see this link.

Hi Thanks for the reply.

I was actually looking the the get method on the http api part. I can set a certain value change using http. But now I want to get a value for example the value of a lamp to see if its on or off. But now http only returns the json format.

ah! Sorry.

You should convert json to a lua table and read it, very easily. You mind find several examples in this forum. This is just one partial example to read from drenchers:

Please login or register to see this code.

  • 0
Posted
Anyone knows if fibaro hc2 has a get variable instead of a set?

DESCRIPTION

Fibaro: getGlobalValue (varName)

Retrieve information (only the value) of the global variable.

PARAMETERS

varName: the name of the global variable

RETURN VALUES

a string containing the current value of the global variable

more functions:

Please login or register to see this link.

Hi Thanks for the reply.

I was actually looking the the get method on the http api part. I can set a certain value change using http. But now I want to get a value for example the value of a lamp to see if its on or off. But now http only returns the json format.

ah! Sorry.

You should convert json to a lua table and read it, very easily. You mind find several examples in this forum. This is just one partial example to read from drenchers:

Please login or register to see this code.

omg very sorry if i didnt get my question straight and clear to you. what i meant was currently im able to control the lighting via http link like http:///api/callAction?deviceID=4&name=turnOff and to change the value for example

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

But there is no api for getting a certain value in json format.

  • 0
Guest merylion
  • Inquirer
  • Posted

    Hi,

    Anyone knows API command to set Danfoss temperature?

    Was trying few things but with no luck

    Thanks

    Marcin

    • 0
    Posted
    Hi,

    Anyone knows API command to set Danfoss temperature?

    Was trying few things but with no luck

    Thanks

    Marcin

    /api/callAction?deviceID=[idOfThermostat]&name=setTargetLevel&arg1=[setpoint]

    The setpoint must be a decimal number rounded off to nearest 0,5, so:

    20,5 is good

    21,0 is good

    21,4 is bad and won't be accepted.

    The temperature will be set at next wake up of the thermostat.

    • 0
    Posted

    Dalle1985,

    21,4 is bad and won't be accepted.

    that depend from thermostat some will reject other can set 21 and other will set 21.5

    • 0
    Posted
    Dalle1985,
    21,4 is bad and won't be accepted.

    that depend from thermostat some will reject other can set 21 and other will set 21.5

    Fair enough - then I learned something new today as well! Thanks for that. I've set my script up to do a calculation which ensures that it always hits the right number by:

    $sp = (Int(($target*2)+0,5))/2

    This will return the temperature to 0,5 degree accuracy always. The reason for adding 0,5 is because an Int function takes the integer part of a number, it doesn't round up. By adding 0.5, it will always return the correct integer. Then dividing it by two will bring it back to 0,5 degree resolution.

    • 0
    Posted

    Hello,

     

    We are trying to do a simple switch on/off using jQuery AJAX / XMLHTTPRequest and being a cross domain request, we are facing issues with retrieving the response values.

     

    The calls are as below:-

     

    Please login or register to see this link.


    Please login or register to see this link.


     

    Using a GET method with "jsonp" executes the request, but since the response returned is "application/json", we are unable to read the response values.

    If we did try to send "json", it returns a "405 method not allowed/found error" as it seems to go through Options/Prefetch. We've tried using CORS too without much success.

     

    Has anyone been able to use a client request with jQuery/Javascript AJAX to execute the REQUEST and also read the RESPONSE? If so, could you post sample code here? We've been able to do it with PHP server-side code, Java application on Windows, node.js, etc but not with an XMLHTTPRequest. Or is this a limitation of HC2?

     

    Thanks much,

    Techteam

    • 0
    Posted

    Hello,

     

    is there command to turn off HC2?

     

    Thanks.

    • 0
    Posted

    Sorry for bring up this "old" post again.

     

    I could not get the suggested curl format from Mark (topic starter) to work.

    Please login or register to see this code.

    It was giving me the following error:

    Please login or register to see this code.

     

    Not sure if it's a curl version thing, or more an OS problem!

    The curl version I'm using is:

    Please login or register to see this code.

     

    Anyway. I got it working the following way:

    Please login or register to see this code.

     

     

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