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


Search the Community

Showing results for tags 'http'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

  1. Hi guys! I would like to say that I am a beginner on Fibaro. I would like to integrate my LED strip on HC3. I have the API Key, I downloaded the fqa file (from here https://marketplace.fibaro.com/items/govee-colorled-controller-qa) but I don't know how to proceed. I have created the Quick App, but I don't know what I have to do to configure it. Can anyone help me?
  2. I am new with Fibaro, but worked earlier with Popp controler. I want to switch on and off the alarm of the camera by a http command (http://IPcamera/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=0&usr=xxx&pw=yyy). What is the best way to do it? Please provide details (I really don't know much about programming in LUA). Thanks for your help!
  3. http://admin:[email protected]/api/devices/15/action/pressButton=1 http://admin:[email protected]/api/callAction?deviceID=15&name=pressButton&arg1=Button11 I tried a lot of links like these and got only {} response. Please can anyone write how to trigger VD button with http? VD with ID : 15 Button ID : Button11 +also tried with postman basic auth didnt work.
  4. HTTP request crashes frequently on HC3L showing below message: Unknown error occurred: LuaEnvironment: /data/vendor/avhttp/avhttp/impl/http_stream.ipp:2312: void avhttp::http_stream::handle_skip_crlf(const MutableBufferSequence&, Handler, boost::shared_array, const boost::system::error_code&, std::size_t) [with MutableBufferSequence = boost::asio::mutable_buffers_1; Handler = boost::function; std::size_t = unsigned int]: Assertion `crlf[0] == '\r' && crlf[1] == '\n'' failed. Have tried many options to catch what exactly is the problem, without success. Is anyone having same problem?
  5. When the success() function is executed after an http request, are there any constraints on what can be done within that function? I am not thinking about starting another http request, instead I wonder if I try to update my child devices as part of the function would be a problem. One thing that could happen (rarely, I hope, but still a possibility): if the child device had been deleted between iterations, my child device update procedure would create a new child device. So there is a minimal amount of overhead with simply updating the child device but probably twice as much overhead involved in the creation process. It strikes me that many of the examples of success() functions are short, sweet, and to the point. Currenty my development stores that data and deals with it on the next polling loop (about every ten seconds). But it also means that the device data is already ten seconds old when it gets updated. For my current devices the request/response time is short because it is on the same home network. I have another device I want to create that I am forced to go out to the cloud to control. That is not ideal but it is what it is. Thank you for any assistance. Peter
  6. Using code from other posts I am trying to invoke an external URL: for the time being I'm interacting with a simple RequestBin that is working perfectly fine. The following code is always returning 400 in the success and never reaches the endpoint. function call(url) net.HTTPClient():request(url, { options={ method = 'GET', }, success = function(response) print(response.status) print(response.data) end, error = function(message) print("error:", message) end }) end call("https://someurl.net?heater=0&setpoint=169&thermostat=0") The output I see from the console is the following: [20.08.2022] [18:27:15] [DEBUG] [SCENE5]: 400 [20.08.2022] [18:27:15] [DEBUG] [SCENE5]: 400 Bad Request 400 Bad Request For context, I am able to connect locally and remotely to the HC3L and I can invoke RequestBin from the same network the HC3L is on. After looking for solutions in other threads I think I am missing somethign very silly but also important. Thanks in advance!
  7. My goal is to send device changes from +- 20 fibaro devices to another api system. My devices are motion sensors, door sensors, smoke sensors and wallplugs. I started to make a lua script: { operator = "any", conditions = { { type = "device", id = 21, property = "value", operator = "anyValue", isTrigger = true }, { type = "device", id = 24, property = "value", operator = "anyValue", isTrigger = true } } } How to make this script more generic, for example a script that triggers on every change in a range of devices? is that possible. For example for device 1, 2, 7 and 10 a http request must be send when data changed for motion, light or temperature? In the action i started a Quickapp, because i can't find a way to send direct http commands here: fibaro.call(25, "turnOn") How to get the ID and the VALUE this scripts is triggered from? After that i make a Quickapp: function QuickApp:turnOn() self:debug("binary switch turned on") self:updateProperty("value", true) self:fcCommands("true") end function QuickApp:turnOff() self:debug("binary switch turned off") self:updateProperty("value", false) self:fcCommands("false") end function QuickApp:fcCommands(cmd) local address = "http://USER:PWD@IP/scada-remote/request.cgi?m=json&r=grp&fn=write&alias=KNXGROUP&value=" ..cmd self.http:request(address, { options={ headers = { Accept = "application/json" }, checkCertificate = true, method = 'GET' }, success = function(response) self:debug("response status:", response.status) self:debug("headers:", response.headers["Content-Type"]) local data = json.decode(response.data) end, error = function(error) self:debug('error: ' .. json.encode(error)) end }) end function QuickApp:onInit() self:debug("onInit") self.http = net.HTTPClient({timeout=3000}) end But now i get a http 401, how to solve this? Anyone a better or more generic way to send data to another system with a api request?
  8. I have a sliding gate, which can send http commands when its state is opened or closed. Is it possible, that the HC2 can receive such a command, so that I can trigger for example a scene?
  9. Introduction to API and http requests Like the other 'Introduction to' posts I'm h0ping this may help some of the people begining their HC2 and lua journey Corrections and suggestions to improve always welcome. What is an API An API can be used to execute commands but the majority are used to request a response or status. Most API’s are interrogated through a http or https request. Some API’s require authentication in the form of a username or a password or an API key. There are public API’s and private API’s. There are a number of API types and the one of the most widely used is a called RESTAPI. This type of API is supported by the HC2 but there are others such MQTT, SOAP, etc The following are API’s that you may have come across in this forum and there are many others Home Center 2 : http://<hc2-ip>/docs (where hc2-ip is the ipaddress of your hc2 192.168.x.x OWN : open weather map ( https://openweathermap.org/api ) Sonos-http-api : ( https://github.com/jishi/node-sonos-http-api ) AWS Polly: used for TTS (http://docs.aws.amazon.com/polly/latest/dg/API_Reference.html ) VoiceRSS : used for TTS (http://www.voicerss.org/api/documentation.aspx ) Some organisations like AWS or Google have multiple API’s that are used for different purposes Structure All API’s has a set of web methods with a set structure. An API call or request can be either a GET, DELETE, POST, PUT and for this introduction we will focus on the GET This means that the data format is predictable and as such is easy to traverse and extract responses. Most RESTAPI responses have a format that conforms to json standard. Json is a way to store information in an organized, easy-to-access manner. It gives us a human-readable collection of data that we can access in a really logical manner. All public API’s are documented like the ones outlined above so a under will know what to expect when they issue a http request. A simple json example would be something like local jStr = {"age" : "24", “hometown" : "Missoula, MT", "gender" : "male" }; A slightly more complicated json string could be be {"coord":{"lon":15.98,"lat":45.81},"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"base":"stations","main" :{"temp":10.86,"pressure":1018.82, "humidity":66,"temp_min":10.86,"temp_max":10.86,"sea_level":1035.43,"grnd_level":1018.82},"wind":{"speed":1.06,"deg":281.501},"clouds":{"all":32},"dt":1487346966,"sys":{"message":0.0038,"country":"HR","sunrise":1487310847,"sunset":1487348795},"id":6618983,"name":"Zagreb - Centar","cod":200} This could also be referreed to as a tbale because of it's structured format. Fortunately there are websites like http://jsonprettyprint.com/ that make these json strings easier to read { "coord": { "lon": 15.98, "lat": 45.81 }, "weather": [ { "id": 802, "main": "Clouds", "description": "scattered clouds", "icon": "03d" } ], "base": "stations", "main": { "temp": 10.86, "pressure": 1018.82, "humidity": 66, "temp_min": 10.86, "temp_max": 10.86, "sea_level": 1035.43, "grnd_level": 1018.82 }, "wind": { "speed": 1.06, "deg": 281.501 }, "clouds": { "all": 32 }, "dt": 1487346966, "sys": { "message": 0.0038, "country": "HR", "sunrise": 1487310847, "sunset": 1487348795 }, "id": 6618983, "name": "Zagreb - Centar", "cod": 200 } To access an api you need 2 things ip address, port, etc to make the http/https request Structure/format of the response so you know how to traverse it and extract what you want The easiest way to explain and learn is by example. As it is highly likely that everybody reading this will have a HC2 we can use to demonstrate the principles. The HC2 RESTAPI is documented on the Fibaro developer site at https://developer.fibaro.com/docs/fghc-restapi The one we will look at is devices. This the first one under the General category at the developers website above. The developer website shows the various parameters that are returned with this call. The API can be used to request information or complete an action. We will look at the request for information If you go to http://,hc2-ip./docs you will see the interactive or inline documentation for web API Go to the section on devices and select deviceid enter a device number ( I selected device 176 which is a dimmer module ) and click Try It. You will see the json formatted or encoded response for that API call. You will also see the full url for the call. If you copy the url and paste it into a browser you will get the same thing (except as one long string) {"id":176,"name":"kitchenPendant","roomID":7,"type":"com.fibaro.multilevelSwitch","baseType":"com.fibaro.binarySwitch","enabled":true,"visible":true,"isPlugin":false,"parentId":175,"remoteGatewayId":0,"interfaces":["deviceGrouping","fibaroFirmwareUpdate","levelChange","light","power","zwave","zwaveConfiguration","zwaveSceneActivation"],"properties":{"parameters":[{"id":1,"lastReportedValue":255,"lastSetValue":255,"size":1,"value":255},{"id":6,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":7,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":8,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":9,"lastReportedValue":5,"lastSetValue":5,"size":1,"value":5},{"id":10,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":11,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":12,"lastReportedValue":99,"lastSetValue":99,"size":1,"value":99},{"id":13,"lastReportedValue":2,"lastSetValue":2,"size":1,"value":2},{"id":14,"lastReportedValue":2,"lastSetValue":2,"size":1,"value":2},{"id":15,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":16,"lastReportedValue":1,"lastSetValue":1,"size":1,"value":1},{"id":17,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":18,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":19,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0},{"id":20,"lastReportedValue":110,"lastSetValue":110,"size":1,"value":110},{"id":30,"lastReportedValue":3,"lastSetValue":3,"size":1,"value":3},{"id":39,"lastReportedValue":600,"lastSetValue":600,"size":2,"value":600},{"id":41,"lastReportedValue":0,"lastSetValue":0,"size":1,"value":0}],"pollingTimeSec":0,"zwaveCompany":"Fibargroup","zwaveInfo":"3,3,52","zwaveVersion":"2.2","configured":"true","dead":"false","deviceControlType":"23","deviceGroup":"[]","deviceGroupMaster":"0","deviceIcon":"15","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","firmwareUpdate":"{\"info\":\"\",\"progress\":0,\"status\":\"UpToDate\",\"updateVersion\":\"2.2\"}","isLight":"true","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"false","model":"","nodeId":"49","parametersTemplate":"235","power":"0.00","powerConsumption":"42","productInfo":"1,15,1,0,16,10,2,2","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","sceneActivation":"0","serialNumber":"","showEnergy":"true","smsNotificationID":"0","smsNotificationType":"0","updateVersion":"","useTemplate":"true","userDescription":"","value":"0"},"actions":{"associationGet":1,"associationSet":2,"getParameter":1,"reconfigure":0,"setParameter":2,"setValue":1,"startLevelDecrease":0,"startLevelIncrease":0,"stopLevelChange":0,"turnOff":0,"turnOn":0,"updateFirmware":1},"created":1486747960,"modified":1486747960,"sortOrder":13} EXAMPLE - API Call from a Virtual Device The following is a http request to the HC2 api. Copy the following in a button or main loop in a virtual device local device = fibaro:getSelfId() localhost = '127.0.0.1' local port = 11111 diag = Net.FHttp(localhost, port); response = diag:GET("/api/devices/176") result = json.decode(response); fibaro:debug("name: "..result.name) fibaro:debug("properties.value: "..result.properties.value) run the vd and open the debug window You’ll see the name and value of the device you selected. If you look through the json response from further up in the tutorial you’ll see the correlation between the results and the json There are some examples of how to iterate through an array in another one of the tutorials I posted. Please see my signature… One last one in case you have difficulty sleeping and the if the above was too simple This function iterates through all the virtual devices on your HC2 and looks for one called 'LAN Network 2.0' The 'LAN Network 2.0' virtual device has multiple labels The function iterates through the virtual device and counts all the labels ( in the json for the virtual device these are called rows) For each row above it looks for an element type ‘Label’ It then iterates through all the labels checking that they match the default format of Label1, Lable2, etc. string.match(jT[i].properties.rows[r].elements[e].name, "Label")) == "Label" The result is a loop inside a loop inside another loop, iterating and checking at each step full code for function to pick through when you have some time. function labelCheck() fibaro:log("vdCheck mode enabled") local device, localhost, port = fibaro:getSelfId(), '127.0.0.1', 11111; diag = Net.FHttp(localhost, port); response = diag:GET("/api/virtualDevices") jT = json.decode(response); for i = 1, #jT do if jT[i].name == "LAN Monitor 2.0" then if #jT[i].properties.rows == #jN then labelCount = "true" else labelCount = "false" end for r = 1, #jT[i].properties.rows do for e = 1, #jT[i].properties.rows[r].elements do if (string.match(jT[i].properties.rows[r].elements[e].name, "Label")) == "Label" then labelMatch = labelMatch else labelMatch = "false" end end end end end if labelCount == "true" and labelMatch ~= "false" then fibaro:debug("Quantity and format of labels is correct") else if labelCount == "false" then fibaro:debug("Quantity of labels incorrect") fibaro:log("Quantity of labels incorrect") end fibaro:sleep(3000) if labelMatch == "false" then fibaro:debug("Label format is incorrect") fibaro:log("Label format is incorrect") end end end Happy coding and suggestions to improve/correct always welcome -f
  10. hi, i need to send this command "https://IP/api/callAction?deviceID=136&name=pressButton&arg1=1" to HC3 but the answer is "Class does not have pressButton function defined - action ignored". To do this I created a quick app of the type "remote controller" but i think is not the same as a "virtual device" https://forum.fibaro.com/topic/12399-beta-api-http-commands-3341/page/5/ so I would like to know how to create a virtual device who responds to the action call. thanks
  11. Hello Forum members, I am a Newbie on Fibaro HC2 / LUA and struggling with my next project: I have a Hydrawise Irrigation Controller (sister company of Hunter). This controller is already smart and adjusting the irrigation schedule based on weather data via WUnderground. My plan is to track the status of each zone in HC2 and switch the pump (wall plug) on and off. API key is available and the connection is working on browser and in LUA code. I can run and stop specific irrigation zones via code but I do not know how to get the datastring into HC2 variables. start relay 485761 / zone 3 for 600 seconds: local http = net.HTTPClient() http:request('https://api.hydrawise.com/api/v1/setzone.php?action=run&api_key=XXXXXX&period_id=999&relay_id=485761&custom=600') stop same relay: http:request('https://api.hydrawise.com/api/v1/setzone.php?action=stop&api_key=XXXXXXX&relay_id=485761') Both is working and I can see the effect on the Hydrawise controller. code for the statusschedule: https://api.hydrawise.com/api/v1/statusschedule.php?api_key=XXXXXXXXX I receive following string in the browser: {"time":1613911956,"nextpoll":60,"message":"","simRelays":1,"options":17,"master":12,"master_timer":0,"master_post_timer":0,"expanders":[],"sensors":[{"input":0,"type":1,"mode":1,"timer":0,"offtimer":0, "relays":[{"id":485761},{"id":488979},{"id":488980},{"id":488981}]}], "relays":[{"relay_id":488979,"time":1576800000,"type":110,"run":0,"relay":1,"name":"Rasen Terrasse","period":259200,"timestr":""}, {"relay_id":488980,"time":1576800000,"type":110,"run":0,"relay":2,"name":"Beete Eingang","period":259200,"timestr":""}, {"relay_id":485761,"time":1576800000,"type":110,"run":0,"relay":3,"name":"Rasen Erker","period":259200,"timestr":""}, {"relay_id":488981,"time":1576800000,"type":110,"run":0,"relay":4,"name":"Hochbeet","period":259200,"timestr":""}] Hopefully somebody can support in this topic. Hydrawise REST API.pdf
  12. Hello, I'm trying to modify a already define global variable using the REST API for the HC2. This is done from a ESP2866 (nodeMCU-isch) board. I can do a http.get towards the HC" and I get the correct JSON information. When I do http.put I seem not to be able to set the variable. My message headers contains a basic auth, and I have payload that looks like this {"value":"On"} The address looks like this http://1.2.3.4/api/globalVariables/thevariable According to the httpclient i'm using i seem to get return code 200 but no result and the variable is not changed. Using the hc2ip/docs link I can test this out with the correct payload and it works fine. However I'm logged in as an Admin then. Trying to change the user from my ESP2866 I just got that the HC" banned me for 30 min. So is there a problem using normal users when trying to modify a global variable ? Do I need to be admin ? Or is there something else I need to check ? Regards P
  13. Hi all, I am trying to create a virtual light switch which will fire out an on and off command to a network interface from a third party. I already have a server on the network listening for the commands for example the on command is http://(server ip address:port)/commands for on off command is http://(server ip address:port) commands for off Can it be done? any help would be super appreciated
  14. I need to control a Daikin VRV multi-split HVAC system which has their intelligent touch controller with the HTTP interface option installed. To control each individual indoor unit I need to send an HTTP POST. Below is an example of the information the controller is expecting the HTTP POST to contain... Here is an example to get A/C "1:1-02" current status. HTTP Request POST /cmd/ HTTP/1.1 ¥r¥n Content-Length: 32¥r¥n Content-Type: application/octet-stream¥r¥n ¥r¥n 20 000000 {Command Size;32} 74 110100 {Command ID;70004} 00 000000 {Reserved 1} 00 000000 {Reserved 2} 04 {A/C Address to get status; 1:1-00 to 1:1-07 (1:1-02 is enable)} ------- 00 {A/C Address to get status; 1:1-08 to 1:1-15} 00 {A/C Address to get status; 1:2-00 to 1:2-07} 00 {A/C Address to get status; 1:2-08 to 1:2-15} 00 {A/C Address to get status; 1:3-00 to 1:3-07} 00 {A/C Address to get status; 1:3-08 to 1:3-15} 00 {A/C Address to get status; 1:4-00 to 1:4-07} 00 {A/C Address to get status; 1:4-08 to 1:4-15} Request Command (hexadecimal) 00 {A/C Address to get status; 2:1-00 to 2:1-07} 00 {A/C Address to get status; 2:1-08 to 2:1-15} 00 {A/C Address to get status; 2:2-00 to 2:2-07} 00 {A/C Address to get status; 2:2-08 to 2:2-15} 00 {A/C Address to get status; 2:3-00 to 2:3-07} 00 {A/C Address to get status; 2:3-08 to 2:3-15} 00 {A/C Address to get status; 2:4-00 to 2:4-07} 00 {A/C Address to get status; 2:4-08 to 2:4-15} --------- I am trying to create a virtual device for each indoor unit (room) and have looked at a lot of posts and tutorials and can’t find anything similar to point me in the right direction, so any ideas how to get this up and running appreciated...
  15. I am building a small app (in Flutter) that needs to get data from the API of my HC3. I am not quite sure how to log in programmatically from within this app. Does the API provide a token to use with all requests, or do I need to provide username and password with each request? An how do the header have to look? Many thanks!
  16. Can someone help me with Node-Red? I need to tell node-Red to change a global value in HC2. Thanks for the Help
  17. Guys, i simple need to send this command using a VD: Button1: PUT http://admin:[email protected]/ISAPI/ContentMgmt/record/control/manual/start/tracks/101 Button2:PUT http://admin:[email protected]/ISAPI/ContentMgmt/record/control/manual/stop/tracks/101 How can i do? Do u have some example? There ia also a way to check the status of the command? Regards Gianluca
  18. Dear forum readers, I wanted to make HTTP request to an IP device of mine. to make it possible to send a body to a Url so that the variables wil change. i have 4 buttons in my virual device and each have to send its one variables to the ip device the Data of the body has to go to this link and de body variables are : <"eec0c0b41b4c43119d33e2bdafe1fc08"><name>Woonkamer</name><type>livingroom</type><preset>asleep</preset></location></locations> I know that i have to use the put command but i don't know how i exactly will put all the variables in the body. plugwise = Net.FHttp("ip", 80) plugwise:setBasicAuthentication("Username", "pass") fibaro:log(response) Can someone help me. on how i can do this on the best way.
  19. Hi all, I have an issue trying to make and HTTPS POST request from my LUA scnene in Fibaro HC. I am getting "short read" error with the URL "https://api2.magicair.tion.ru/idsrv/oauth2/token" This is my scene: ============================================= --[[ %% properties %% events %% globals --]] local authData = "username=XXX&password=YYY" function doTest() print('Test!') local requestUrl = "https://api2.magicair.tion.ru/idsrv/oauth2/token" local httpClient = net.HTTPClient() httpClient:request(requestUrl, { options = { method = "POST", headers = { ["Content-Type"] = "application/x-www-form-urlencoded", ["Content-Length"] = tostring(authData:len()) }, data = authData, timeout = 5000 }, success = function (response) fibaro:debug (response.data) end, error = function (err) fibaro:debug ("Error: " .. err) end }) setTimeout(doTest, 5*1000) end print('Script start...') doTest() ============================================= I am getting the following in my log: [DEBUG] 15:16:52: Script start... [DEBUG] 15:16:52: Test! [DEBUG] 15:16:52: Error: short read I have been trying to play with headers, data format, timeouts and all parameters I could find, however I always get the same error with the provided URL. Other HTTPS URLS I tried with GET method works just fine. Also I have been trying to do the same with cURL and it works fine with the exact same set of headers and payload (with full credentials string, of course). So the issue is somehow connected with this specific URL: "https://api2.magicair.tion.ru/idsrv/oauth2/token" The Internet is saying that short read problem in HTTPClient request might be related to ciphering protocols mismatch between the client and server. So there could be some parameter regulating this? 2 main versions, which I see: 1. Some tricky param is required to form the correct HTTPS request. 2. Some bug / missing feature in HTTPClient implementation in HC2. Anyway I am stuck and need the help from the community and HC developers. Has anyone seen something similar? Any clues? Please help! Many thanks in advance. PS Using the latest FW 4.51 of Fibaro Come Center 2
  20. Hello, I've recently moved to the ZWave world when I bought a HC2 and some devices. But I still have some i Nexa and Telldus switch devices I can use outside and have not found any suitable ZWave ones. Therefore the idea to control the Nexa/Telldus devices using HTTP requests to the API of Telldus Live. Just simple things like turn on and turn off the switches. The IDs of the switches I thought I could input into the LUA code of each Virtual Device to keep it simple. What I don't seem to find any good information about is the whole Oauth thing with authorization requests, access tokens and stuff until I can finally to the request regarding the switches. Has anybody any clues or hopefully already has done this successfully? I found some documentation on the APIs at Telldus: http://api.telldus.com/documentation/phpLive (only PHP examples I don't really understand, strange language PHP) and then some more 3rd party doc at https://market.mashape.com/warting/telldus Need help/directions both on how to do the http-requests in LUA and the more Telldus API specifics. Once I understand those important things I'm sure I can get rest of the VD to work, it should be little more than on/off buttons and maybe some status message... We'll see once I get there. Look forward to some input and/or experience in the matter... Kind regards Bjorn
  21. I have an issue trying to make and HTTPS POST request. I am getting "short read" error with the URL "https://api2.magicair.tion.ru/idsrv/oauth2/token" This is my scene: ============================================= --[[ %% properties %% events %% globals --]] local authData = "username=XXX&password=YYY" function doTest() print('Test!') local requestUrl = "https://api2.magicair.tion.ru/idsrv/oauth2/token" local httpClient = net.HTTPClient() httpClient:request(requestUrl, { options = { method = "POST", headers = { ["Content-Type"] = "application/x-www-form-urlencoded", ["Content-Length"] = tostring(authData:len()) }, data = authData, timeout = 5000 }, success = function (response) fibaro:debug (response.data) end, error = function (err) fibaro:debug ("Error: " .. err) end }) setTimeout(doTest, 5*1000) end print('Script start...') doTest() ============================================= I am getting the following in my log: [DEBUG] 15:16:52: Script start... [DEBUG] 15:16:52: Test! [DEBUG] 15:16:52: Error: short read I have been trying to play with headers, data format, timeouts and all parameters I could find, however I always get the same error with the provided URL. Other HTTPS URLS I tried with GET method works just fine. Also I have been trying to do the same with cURL and it works fine with the exact same set of headers and payload (with full credentials string, of course). So the issue is somehow connected with this specific URL: "https://api2.magicair.tion.ru/idsrv/oauth2/token" The Internet is saying that short read problem in HTTPClient request might be related to ciphering protocols mismatch between the client and server. So there could be some parameter regulating this? 2 main versions, which I see: 1. Some tricky param is required to form the correct HTTPS request. 2. Some bug / missing feature in HTTPClient implementation in HC2. Anyway I am stuck and need the help from the community and HC developers. Help!
  22. Hello Fibaro team, Internet as we speak is transforming towards more and more use of HTTPS and TSL. My question is simply, is there a timeplan for HC2 to transfer from HTTP to HTTPS also on the local site access solution? I understand there can be difficulties with the certificates...... For example, I would prefer to send an HTTPS request to HC2 for starting scenes or altering status on a device, where username and password are protected with TSL transmission. Kindly, DrPepper
  23. DonZap

    IFTTT HC2

    Hi I am new here, so sorry if I post this at the wrong forum I'm using fibaro HC2 together with google home by ifttt. I have created a user who only has access to a virtual device that I send the http command to. It works fine when I using device ID directly: http://User:Password@/api/callAction?deviceID=93&name=turnOn but when i usen the button indside the virtual device, it dose not work at all: http://User:Password@/api/callAction?deviceID=201&name=pressButton&arg1=button0 and I am getting the virtual device ID from the http link: /fibaro/en/devices/virtual_edit.html?id=201 I have no idea why it dose not work, its pretty Straight froward? thanks in advance for your inputs
  24. Hi all, I have an Itho Eco RFT ventilation box, wich can be controlled by a wifi interface. You can make api requests, wich work fine i.e. a browser. Here are te requests that are available: http://192.168.x.x/api?action=Low http://192.168.x.x/api?action=Medium http://192.168.x.x/api?action=High http://192.168.x.x/api?action=Timer http://192.168.x.x/api?action=Learn http://192.168.x.x/api?action=reset&value=true I want to put this in a VD. 3 buttons for "Low, medium and high". How can I put these URL's under the buttons? Thanks!
  25. Hi, i got a HCL a few hours ago. I added a VD with 2 buttons. 1-on 2-off First button "on": GET /0/true HTTP/1.1 Second button "off": GET /0/false HTTP/1.10x0D0x0A0x0D0x0A Do i have to add Host:xxx.xxx.xxx.xxx because it works fine without Host Buttons work with this hex "0x0D0x0A0x0D0x0A" and without hex... How to get status of device? Normally when i wrote http://ip/0/status response is : {"id":0,"state":1} I want to set VD on-off position from this response any help please?
×
×
  • Create New...