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)


Guest deraaij

Question

Guest deraaij

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

Link to comment
Share on other sites

Recommended Posts

  • 0
Guest deraaij
  • Inquirer
  • del

    Sorry, I don't get what you mean?

    Link to comment
    Share on other sites

    • 0
    Guest sztywniak
  • Inquirer
  • I don't delete my post

    Please login or register to see this image.

    /emoticons/default_icon_wink.gif" alt=";-)" />

    Link to comment
    Share on other sites

    • 0
    Guest deraaij
  • Inquirer
  • hahahah, sorry....

    Link to comment
    Share on other sites

    • 0

    Is it possible to set variable value with json instead of curl like you did describe?

    I have search on doc.fibaro.com but i could not find anything.

    Link to comment
    Share on other sites

    • 0
    Guest deraaij
  • Inquirer
  • Is it possible to set variable value with json instead of curl like you did describe?

    I have search on doc.fibaro.com but i could not find anything.

    I don't get exactly what you mean, the payload is json encoded. With which language do you want to do it?

    Regards,

    Mark

    Link to comment
    Share on other sites

    • 0
    Is it possible to set variable value with json instead of curl like you did describe?

    I have search on doc.fibaro.com but i could not find anything.

    I don't get exactly what you mean, the payload is json encoded. With which language do you want to do it?

    Regards,

    Mark

    if it is possible to set a globalvariable in HC2 with a

    Please login or register to see this link.

    command

    I working with siriproxy

    Please login or register to see this image.

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

    Link to comment
    Share on other sites

    • 0
    Guest deraaij
  • Inquirer
  • Is it possible to set variable value with json instead of curl like you did describe?

    I have search on doc.fibaro.com but i could not find anything.

    I don't get exactly what you mean, the payload is json encoded. With which language do you want to do it?

    Regards,

    Mark

    if it is possible to set a globalvariable in HC2 with a

    Please login or register to see this link.

    command

    I working with siriproxy

    Please login or register to see this image.

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

    In siriproxy you could use httparty.put. You could also kick of a scene which updates the value, in that case you can use a normal get.

    Regards,

    Mark

    Link to comment
    Share on other sites

    • 0
    Is it possible to set variable value with json instead of curl like you did describe?

    I have search on doc.fibaro.com but i could not find anything.

    I don't get exactly what you mean, the payload is json encoded. With which language do you want to do it?

    Regards,

    Mark

    if it is possible to set a globalvariable in HC2 with a

    Please login or register to see this link.

    command

    I working with siriproxy

    Please login or register to see this image.

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

    In siriproxy you could use httparty.put. You could also kick of a scene which updates the value, in that case you can use a normal get.

    Regards,

    Mark

    Scene that updates the variable did the trick

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Thanks Mark!

    Link to comment
    Share on other sites

    • 0
    Guest deraaij
  • Inquirer
  • Scene that updates the variable did the trick

    Please login or register to see this image.

    /emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />

    Thanks Mark!

    You are welcome! If you have anything to share with regard to siriproxy, please do!

    Regards,

    Mark

    Link to comment
    Share on other sites

    • 0
    Guest Kuuno
  • Inquirer
  • is tehre a way to turn on holiday mode through lua?

    thanks

    Link to comment
    Share on other sites

    • 0

    Kod:

    --[[

    %% properties

    %% globals

    --]]

    local status = fibaro:getValue(371, "dead");

    fibaro:log(status);

    Doesn't work, get an error message for my devices ID's:

    [ERROR] 20:55:47: line 6: attempt to call method 'log' (a nil value)

    Can you use a http command to get just a list of dead devices?

    Link to comment
    Share on other sites

    • 0

    richo, that LUA script was for virtual device, in scenes in 4.424 you don't have fibaro:log

    Link to comment
    Share on other sites

    • 0

    ok I have used fibaro:debug

    [ Dodano: 2013-02-27, 22:52 ]

    and why this code is not working ??

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0
    Is it possible to set variable value with json instead of curl like you did describe?

    I have search on doc.fibaro.com but i could not find anything.

    I don't get exactly what you mean, the payload is json encoded. With which language do you want to do it?

    Regards,

    Mark

    if it is possible to set a globalvariable in HC2 with a

    Please login or register to see this link.

    command

    I working with siriproxy

    Please login or register to see this image.

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

    Just a quick response - I am working on exactly that.

    Got it working last night, although it is far ready from release.

    Further more, it requires PHP+MySQL+Apache besides Siriproxy.

    Essentially what I am doing is this:

    Siri -> Web API -> Fibaro Home Center

    The reason for that Web API in the middle is the following:

    1. I am doing this for myself, and I do not plan to only use this for controlling Fibaro

    2. Siri is a horrible listener. "Toggle" can become "Call go", and "Dim" usually becomes "DM" or something other ridiculous. What I do in that Web API is doing soundex matches, essentially using PHP algorithms to match devices/rooms/sections to words that sound alike. Three and Tree and tea.

    If there's interest I could try to expidite an alpha-release.

    • Thanks 1
    Link to comment
    Share on other sites

    • 0
    Guest jcs10
  • Inquirer
  • I'm trying to get the value of my Temp sensor... but how can I do this in the beta ?

    Sorry, I was misreading :

    I suppose the value in bold is the good one ??

    {"id":28,"name":"Sonde sdb","roomID":1,"type":"temperature_sensor","properties":{"UIMessageSendTime":"0","classConfigure":"1","classGeneric":"49","classSupport":"49","classVersion":"1","dead":"0","deviceControlType":"0",

    "deviceIcon":"0","disabled":"0","emailNotificationID":"0","emailNotificationType":"0","endPoint":"3","isBatteryOperated":"0","needConfigure":"5","type":"temperature_sensor","nodeID":"6","parametersTemplate":"0","parentID":"25",

    "pollingRetryError":"0","pollingTime":"1362324085","pollingTimeNext":"1362325281","pollingTimeSec":"0","productInfo":"","pushNotificationID":"0","pushNotificationType":"0","requestNodeNeighborState":"0","requestNodeNeighborStateTimeStemp":"0",

    "showChildren":"0","smsNotificationID":"0","smsNotificationType":"0","sortOrder":"999","unit":"C","userDescription":"",

    "value":"20.25","zwaveInfo":"","parameters":[],"associationView":[],"associationSet":[]},"actions":{"pollingTimeSec":1,"requestNodeNeighborUpdate":0},"created":1362324087,"modified":1362324087}

    Link to comment
    Share on other sites

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