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,

 

Is there a command to retrieve a value for a variable? For instance temperature?

  • 0
Posted

is there an api function to turnon for example all the  light on a section ?

  • 0
Posted
On 7/26/2018 at 4:05 PM, Rikbast said:

Hi,

 

Is there a command to retrieve a value for a variable? For instance temperature?

 

Figured it out.

 

However, it seems that calling the motionsensor does not work. I use this (118 is the motionsensor) in a webbrowser:

http://username:[email protected]:80/api/devices/118

I don't get any result.

 

If I use http://192.168.0.33/docs/#!/devices/getDevice and fill in 118 I do get respons. What am I missing?

 

  • 0
Posted
2 hours ago, Rikbast said:

 

Figured it out.

 

However, it seems that calling the motionsensor does not work. I use this (118 is the motionsensor) in a webbrowser:

http://username:[email protected]:80/api/devices/118

I don't get any result.

 

If I use http://192.168.0.33/docs/#!/devices/getDevice and fill in 118 I do get respons. What am I missing?

 

 

are you really still on firmware 3.341??? 

  • 0
Posted
1 hour ago, tinman said:

 

are you really still on firmware 3.341??? 

 

No, 4.170. Why?

  • 0
Posted

Hi guys, sorry maybe is somewhere answered, but I tried control from my iOS app control lights and blinds, but I need make API call, which can on one button open all blinds in room or in section (I have two sections with 3 rooms) and if I call link with action turnOn / turnOff and put it one by one for each device (6 device for light) it will disconnect me as too many attempts.

Is any way how to call multiple devices in one call? or maybe I should make virtual device as a switch for all lights in room and one for all lighs in section and one for all lights in home and same for blinds? if yes how could I make virtual switch where could be linked multiple devices?

 

Thank you very much in advance

Jozef

  • 0
Posted
On 1/13/2013 at 4:33 PM, Guest deraaij said:

devices?id=316

 

  • 0
Posted

Hi

I am trying to send notification to my HC3L with http request 

http://IPaddress/api/callAction?deviceID=148&name=sendDefinedPushNotification&arg1=1

with this i receive notification with [push(HC3L)] only 

Can i control in notification i send to my HC i want to write title and message to receive it?

How can i do this is there something i write with arg1 or can i change it to something else to control title and message  

  • 0
Posted
7 hours ago, ABDULLAH258 said:

I am trying to send notification to my HC3L with http request   

 

use forum search again, this is very old thread, it is as if you would ask why icons on iphone 2G are not same as on iphone 13

  • 0
Posted

hi, i don't know if it's the right post, 

i'm going crazy with this,

 

i have to send this string to LAN

 

http://192.168.1.30:69/ZONES/22/ALARM

 

i'm new to both LUA and API, can someone tell me what have i to write in the Action part of a lua scenario to send this command?

 

have i to use api.post?

 

something like this?

 

api.post("http://192.168.1.30:69/ZONES/22/ALARM", {0})
 
what is the exact way to write it?
 
thank you very much
  • 0
Posted (edited)

What you are trying to do? To arm alarm?

Please got to HC3 Swagger and see how to do it.

http://HC3-IP/swagger?urls.primaryName=alarms%2Fpartitions

Let me know if you need further assistance

Edited by cag014
  • 0
Posted
4 hours ago, MarcoSmartForYou said:

hi, i don't know if it's the right post, 

i'm going crazy with this,

 

i have to send this string to LAN

 

http://192.168.1.30:69/ZONES/22/ALARM

 

i'm new to both LUA and API, can someone tell me what have i to write in the Action part of a lua scenario to send this command?

 

have i to use api.post?

 

something like this?

 

api.post("http://192.168.1.30:69/ZONES/22/ALARM", {0})
 
what is the exact way to write it?
 
thank you very much

 

This is not the HC3 api, this is some other device you try to interact with?

You need to do an http request. It depends on what method (get, post,put) you have to do, if you need to do something with the result, and if you need to provide credentials to access the device.

Ex. if it's a plain get request it looks like this

 

Please login or register to see this code.

 

  • Like 2
  • 0
Posted

hi, @jgab

 

thank you for the fast reponse,

 

this is a Lares 4.0 api, made by Ksenia security.

 

this is an italian alarm sysem, the first one i see that have Virtual IP zone.

 

i attach you a part of the menu to understand what i see,

 

this virtual IP zona have 2 state "open" with the green state, and "closed" with red state.

 

this zone is "normally open" and you can "close" it via this command "http://192.168.1.30:69/ZONES/22/ALARM"

 

without username and password, 

 

this string is composed by: http://"IPaddress of alarm system":"port"/ZONES/"number of the zone"/"alarm type(tamper-alarm ecc..)

 

 

if i open a web browser like crome, IE, or what you use, and type "http://192.168.1.30:69/ZONES/22/ALARM" in the web, you will get the screen i attach you, and the feedback "ok" or "not ok"

 

as you get the feedback "ok" you will see in the "real time zone status" the state changing.

 

 

so, i think i'll neet to lunch a "POST" command from fibaro to my LAN (bot HC3 and Lares are on the same network 192.168.1.xxx)

 

i tryed to change like this but obviusly it's not enought ?

 

i tought it was easier hehe

if you need more information just tell me, 

 

THANK YOU!!!!!

 

 

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

  • 0
Posted
20.10.2021 в 05:09, jgab сказал:

Please login or register to see this code.

 

Good afternoon. Please help! -)
I want to press the ON switch from Fibaro HC 3. But I've been fighting the code for three weeks now-)
Here's what I can do now:

net.HTTPClient (): request ("http://xxx.xxx.xxx.xxx:8123/api/states/light.detsk_695", {
      options = {
        headers = {
            ['Content-Type'] = 'application / json',
            [ 'Authorization'] = 'Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxx,
        },
        method = "GET"
        },
      success = function (response)
        self: debug ("Result:", json.encode (response))
      end,
      error = function (message)
        self: error (message)
      end
    })
end
I get an answer and see a lot of things, but how to work with it - ((

  • 0
Posted

can someone please close that thread? 

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