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. Hey Guys, Trying to send a HTTP String from my HCL VD but it's not working.. anyone see what I'm doing wrong, String I'm trying to send is: GET https://api.thingspeak.com/update?api_key=MYKEY&field1=
  2. Hi, Simple Control (Roomie) is a great iOS app to integrate Audio/Video in your smart home. Simple Hub supports starting activities and executing device commands over a standard HTTP interface made available on port 47147 (HTTPS is available on port 47148). The HTTP interface sends and receives JSON payloads for each API. More information: https://www.simplecontrol.com/wp-conten ... erface.pdf I would like to create a Virtual Device in HC2 for the Simple Control scenes. Is this possible? How? Thank you in advance
  3. robd

    http module

    to make a connection between the HC2 and other IP base units like a raspberry PI you need to use the LUA code local name = Net.FHttp("IP adress", port) in my case this leads to a error message telling me that I am trying to index or assign a nil value to the variable "Net". some investigation leads to the assumption that my HC2 is missing a HTTP module. to test this I used the lines if Net == nil then fibaro:debug("no net") end alternatively if Net ~= nil then fibaro:debug("net") end I get "no net" as result. then I read that I should install the network module with local name require ("socket.http") see http://w3.impa.br/~diego/software/luasocket/http.html the require function should take care of all the dependencies and install the network module. unfortunately this also leads to a error saying that I am trying to assign a nil value to a variable. where am I going wrong? HC2 with latest software version
  4. Morning all! i am looking to send a plain text command from Fibaro into other systems; however I am struggling getting the command to send. From my understanding you cannot put the username/password in the string that is inside the 'Virtual Device' button. The command I want to send from a VD button is - http://Username:[email protected]:50000/dev/sps/HallLight/Pulse It works using web browsers and applications like Postman. Any ideas?
  5. ZXT-120 is an IR extender for air conditioners, but it can be learned up to 20 defferent ir code for multimedia. The process of learning of zxt-120 is written in its manual, but i want to show a way to use that codes in fibaro HC. For this purpose we have to make a virtual device, and fill its IP Address with your HC ip, and write 80 in TCP port box: Then make buttons according to your multimedia device: Now you have to write commands for corresponding buttons. For example for first button: We can learn up to 20 code according to this list: Use this command for changing mode : /api/callAction?deviceID=107&name=setMode&arg1=0 For setting temperature (in cooling mode): /api/callAction?deviceID=107&name=setThermostatSetpoint&arg1=2&arg2=23 For setting temperature (in heating mode): /api/callAction?deviceID=107&name=setThermostatSetpoint&arg1=1&arg2=21
  6. Hi, I am looking for help in decode a http success message If I issue the following through a browser it works.... http://192.168.1.89:5005/bed5_office/say/Hello/Amy/30 and the response in the browser is {"status":"success"} now, if I run this in a scene http = net.HTTPClient({ timeout = 3000 }) url = 'http://192.168.1.89:5005/bed5_office/say/Hello/Amy/30' controlHeaders = {['content-type'] = 'application/json; charset=utf-8'} http:request(url, { options = { headers = controlHeaders, method = 'GET', }, success = function(param) if param.status == 200 then print('Success STATUS: ', param.status) print('Param Data: ', param.data) else print('STATUS: ', param.status) end end, }) It also works but I cannot find way to display the success message ( I want to trigger another action if not successful) I tried removing the " ==200 " if-then loop as I can't see any 200 or 201 result. Could somebody explain what the success = function(param) is doing and I may be able to figure out why I may not be seeing the success message Thanks -f
  7. 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
  8. Hi, I have two functions in a scene that I call one after the other function1 - create global variable if it doesn't exist (through the api) function2 - write some data to the global variable the second function will fail as the 'create variable' hasn't been completed by the time I try to write to it. I can add a delay or a check that the 'variable is not nill' (ie it exists) in function2 but it still fails to execute correctly I think I recall seeing that a http request in a scene will not always run in the order of the scene ? is this correct or something else here at play. If so has anybody found a way within a single scene to create a variable on the fly and then save data to it successfully. As a last resort I was thinking about having the scene run once to create the table, call a second instance of itself and kill the first instance. I'm not sure if this would even work but it seemed like a very inefficient workaround even if possible I have seen many virtual device examples of creating a variable on the fly and saving data to it but none from a scene Thanks -f @jompa68, @petergebruers, @Sankotronic
  9. 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
  10. Hi, Trying to create a VD button to set my alarm. I already have it in a scene but am trying to clean things up.. I'm getting an error as I think the virtual device syntax is incorrect Working Scene function function tempFunc() fibaro:debug("setting night mode") http = net.HTTPClient({timeout=2000}) local controlUrl = 'https://192.168.XX.XX:XXXX/XXX/XXX/XXX/set' http:request(controlUrl, { options = { method = 'PUT', timeout = 5000 }, success = function(status) local result = json.decode(status.data) if result and result.status == 'success' then print ("Request OK: " .. status.data) else print ("Error ") if (result) then print(result.data) end end end, error = function(error) print "ERROR" print(error) end }) end Virtual device code that is not working http = Net.FHttp({timeout=2000}) local controlUrl = 'https://192.168.XX.XX:XXXX/XXX/XXX/XXX/set' http:request(controlUrl, { options = { method = 'PUT', timeout = 5000 }, success = function(status) local result = json.decode(status.data) if result and result.status == 'success' then print ("Request OK: " .. status.data) else print ("Error ") if (result) then print(result.data) end end end, error = function(error) print "ERROR" print(error) end }) or is it that https requests are not permitted in a virtual device any help appreciated Thanks -frank
  11. Hi all, I am looking to build out my understanding of the HC2 Rest API. Specifically its capacity to execute a lot of calls (as opposed to what functions are available) and what else leverages the API and battles for capacity. I have two reasons for posting the topic - (a) I may be having an issue and am trying to debug and (b) increasing my systems knowledge. My understand is that the API is used the following... If an http request is made to the HC2 from an external system If a http request is made from a browser to the HC2 .. but is it used for ... The android app I run on my tablets/phones ( yes ? ) The iOS app running on some ipads/phones ( yes ? ) If the HC2 scene makes a http request to an external system ( assume no ? ) Does the HC2 FW itself leverage the API in anyway ( assume not ?) If a scene executes a http request to localhost / 127.0.0.1 (assume yes ?) .. what else uses it ? now if I send a lot of API calls.. What would people expect to be a resonable number before thresholds are hit (100 per second, 400 per second, 1000 per second ?) ----- assuming the are basic calls, (ie return a sensor state, true-false, return, global variable value,etc What starts to happen to system resources ? ---- Do I start to run out of memory ----- Do I see my CPU utilisation start to peak close to 100% ------ or does the system stay stable and the eveything start to slow down ? Thanks Frank
  12. CANCEL THIS - I SOLVED IT WITH A VD USING THE MAIN LOOP Hi, This is prob not a huge mystery and something basic I'm missing. If I remove the While true do loop from the code below and execute it manually it works okay but once I add the while loop to get it check all the time the scene doesn't run Could somebody take a look and tell me where I'm being stupid Thanks -F --[[ %% autostart %% properties %% events %% globals --]] -- Configuration - Scene Info sceneName = "Sonos State tracker" sceneVersion = "1.0.1" -- Scene Description -- Track and stores the state of three of the sonos -- zones so the respective amp can be switched on -- Configuration - Device IDs -- none for this scene -- Validate Number of Scene Instance if (fibaro:countScenes()>1) then --fibaro:debug("stop scene") fibaro:abort() end -- read playroom state function StateFunc() while true do fibaro:sleep(2000) -- execute this every 2 seconds if fibaro:getGlobal("G_SPC_AREA_STATUS_1") == "UNSET" then -- don't check if we are not at home http = net.HTTPClient({ timeout = 3000 }) url = 'http://192.168.1.89:5005/Playroom/state' controlHeaders = {['content-type'] = 'application/json; charset=utf-8'} http:request(url, { options = { headers = controlHeaders, method = 'GET', }, success = function(response) if response.status == 200 then local responds = json.decode(response.data) local zPRState = responds.zoneState fibaro:debug(zPRState) fibaro:setGlobal("Sonos_PRState", zPRState); end end, }) -- read living room state http = net.HTTPClient({ timeout = 3000 }) url = 'http://192.168.1.89:5005/Living_Room/state' controlHeaders = {['content-type'] = 'application/json; charset=utf-8'} http:request(url, { options = { headers = controlHeaders, method = 'GET', }, success = function(response) if response.status == 200 then local responds = json.decode(response.data) local zLRState = responds.zoneState fibaro:debug(zLRState) fibaro:setGlobal("Sonos_LRState", zLRState); end end, }) -- read dining room state http = net.HTTPClient({ timeout = 3000 }) url = 'http://192.168.1.89:5005/Dining_Room/state' controlHeaders = {['content-type'] = 'application/json; charset=utf-8'} http:request(url, { options = { headers = controlHeaders, method = 'GET', }, success = function(response) if response.status == 200 then local responds = json.decode(response.data) local zDRState = responds.zoneState fibaro:debug(zDRState) fibaro:setGlobal("Sonos_DRState", zDRState); end end, }) end -- end if statement end -- end while loop end -- end function -- Main Scene execution code StateFunc()
  13. Hi, I was wondering if anybody had tried this before. I am looking to ping a device on my home network to see if it is 'online' and then store something like an online/offline in a variable that I can display. I use static IP's for all the devices I am looking to monitor I was thinking about using the arp approach and see if the device is returned as part of the list Has anybody tried this before .. or do people think it may be possible or is there another route ? Thoughts appreciated Thanks Frank
  14. hi I thought I read somewhere that multiple http commands are not executed in the order that they are listed in the scene. I have a scene and it doesn't work 100% of the time and I think this may be the issue I tried grouping 3 or 4 commands into one http request and added a few sleep but with limited success sample script... function tempFunc() -- music on local http1 = net.HTTPClient() -- ungroup bed lauren-ethan from other rooms http1:request('http://192.168.1.89:5005/Landing/ungroup/Bed_LE') http1:request('http://192.168.1.89:5005/Bed_MasterR/ungroup/Bed_LE') http1:request('http://192.168.1.89:5005/Bed_MasterL/ungroup/Bed_LE') http1:request('http://192.168.1.89:5005/Bed_Guests/ungroup/Bed_LE') http1:request('http://192.168.1.89:5005/Bed5_Office/ungroup/Bed_LE') fibaro:sleep(200) local http2 = net.HTTPClient() -- ungroup bed frank from other rooms http2:request('http://192.168.1.89:5005/Landing/ungroup/Bed_Frank') http2:request('http://192.168.1.89:5005/Bed_MasterR/ungroup/Bed_Frank') http2:request('http://192.168.1.89:5005/Bed_MasterL/ungroup/Bed_Frank') http2:request('http://192.168.1.89:5005/Bed_Guests/ungroup/Bed_Frank') http2:request('http://192.168.1.89:5005/Bed5_Office/ungroup/Bed_Frank') fibaro:sleep(200) -- select radio favourite local http3 = net.HTTPClient() http3:request('http://192.168.1.89:5005/BED_FRANK/Favorite/Calm%20Radio') http3:request('http://192.168.1.89:5005/BED_LE/join/BED_FRANK') fibaro:sleep(1000) -- clean up to make sure master room spaekers remain joined and volume is correct local http4 = net.HTTPClient() http4:request('http://192.168.1.89:5005/BED_MASTERL/join/BED_MASTERR') http4:request('http://1922168.1.89:5005/BED_FRANK/Volume/14') http4:request('http://192.168.1.89:5005/BED_LE/Volume/14') fibaro:sleep(1000) -- setup music for kids at night local http5 = net.HTTPClient() http5:request('http://192.168.1.89:5005/BED_FRANK/Favorite/Calm%20Radio') http5:request('http://192.168.1.89:5005/BED_LE/join/BED_FRANK') fibaro:sleep(1000) -- clean up to make sure master room speakers remain joined and volume is correct local http6 = net.HTTPClient() http6:request('http://192.168.1.89:5005/BED_MASTERL/join/BED_MASTERR') http6:request('http://1922168.1.89:5005/BED_FRANK/Volume/14') http6:request('http://192.168.1.89:5005/BED_LE/Volume/14') end BACKGROUND I am using the nodejs sonos bridge and need to be to execute http commands in a certain sequence of commands ie ungroup RoomA, RoomB, RoomC Group Room B with RoomZ Set station to Fav1 and play Adjust volume to 18% Complications arise when they are executed out of sequence Has anybody experienced this and have a solution...
  15. Hi, I am leveraging a bridge to interact with my sonos systems The command to invoke is simple.... http://192.168.1.89:5005/Bed5_Office/SAY/Hi but if I want to have more than one word i need to separate them with a %20 in the url ..like http://192.168.1.89:5005/Bed5_Office/SAY/Hi%20there Now if I drop the following url into a browser (note space between 'hi' and 'there') http://192.168.1.89:5005/Bed5_Office/SAY/Hi there It works !!!... ..but if i use it in a scene it doesn't I had this working from a scene before so I asked the developer of the sonos bridge and he said .. the last part is the important bit.....so my question is how can I get the http request in the scene to invoke the url so I don't have to add the %20 as spaces I tried a number of options but can only seem to find a way to encode headers or data but not the url I am 99% sure I had this working but in a recent overzealous clean up of my code I must have deleted the sample code that worked for me. Could anybody help ? Thanks -Frank
  16. Hi Folks, I have just started to use openremote and cant even get a simple switch to work. It seem to required the following Power On command - http://192.168.1.90/api/callAction?deviceID=720&name=turnOn Power Off command - http://192.168.1.90/api/callAction?deviceID=720&name=turnOff Sensor Does anybody know what the sensor http request should be This is what is required Thanks Frank
  17. I'm guessing it's not currently possible to set a virtual device icon to a url as of 4.082? Gave it a shot and was a little amazed this isn't possible. Since custom plugins have been disabled, I guess it leaves virtual devices as the only method for controlling 3rd party systems and devices. Not very easy to work with FIbaro. Making a nice Squeezebox remote has been a headache and looks pretty nasty. Was hoping to at least use the cover art for the icon. Is there any other workarounds? (or a way to "inject" custom plugins? )
  18. Hi Trying to learn a little more about http requests and api. I'm looking for a little help here and sorry if it's a rookie question.... I have the following code (thanks peterb) local zoneID = 5 function call(api) local HC2 = net.HTTPClient() HC2:request("https://192.168.1.95:8088"..api, { success = function(status) local result = status.data fibaro:debug("Re: " .. result) end, error = function(err) fibaro:debug("HTTP call error: " .. err) end, options = {method = "GET" } }) end call('/spc/zone/'..zoneID) it creates the following output [DEBUG] 20:57:12: table: 0x8ac1c78 [DEBUG] 20:57:12: Re: {"status":"success","data":{"zone":{"id":"5","type":"0","zone_name":"Landing PIR","area":"1","area_name":"Home","input":"0","logic_input":"0","status":"0","proc_state":"0","inhibit_allowed":"1","isolate_allowed":"1"}}} I am trying to display the zone data in the array such as id, type I thought it should be something like fibaro:debug("zone.type: " .. result.zone.type) but I don't know enough about how to extract the various parts from an array I tried to find a good post on the forum but couldn't but if there is one I don't mind picking my way through it. any help (including an explanation) would be really appreciated... Thanks -F
  19. Hi folks, I'm trying to read the value of a temp sensor and display in a webpage I was trying to use a http call (the device is is 871) If I drop the following into a browser I get all the data back http://HC2IP/api/871 but I want to just display the 'value' field which contains the actual temp value I tried the following and some versions http://HC2IP/api/871?field=value but it didn't seem to work Alternatively if somebody has some webpage code that reads some value thought the API and displays it, I could work with that as well Any suggestions ? Thanks -F
  20. Hi folks, I'm looking for some help or some directing. I've searched the forum but can't find what I'm looking for even though it has to be there and tried before. I am trying to create a scene to read and adjust my heating system through the API The steps would be - login over http passing username and password. (this would activate a session) - read back the authentication code to use in next step - issue a post to the API to read or adjust the heating (over http) any help or pointing me to other forum posts would be appreciated Thanks Frank Edit: I've attached a wireshark trace export of the transaction requesting a 1 deg decrease. I blanked out some email addresses and site specific information for privacy. This is essentially what I am trying to replicate through a scene if it's possible. ws trace export.txt
  21. I wonder if there is any plans on expanding the functionality of the virtual device in Fibaro HC2. As it works now it´s most suitable to use for controlling some other device with buttons, slider etc, and if you want to display data from another device all you can use is the label. My wish is that you should be able to choose the type of the virtual device. For example, if you want it to appear as a thermometer or humidity device, and be able to set the value of this device via http api and lua. This would open up the possibility to add virtual devices that gets updated via for example node-red or http from other sources. And in the user interface they will show up as a "common" sensor. That would be really nice. I think this functionality would make the platform more attractive for many people, and open up the integration between different protocols and vendors. Is it just me or is anybody else missing this functionality?
  22. Im trying to control my foscam IP camera (PTZ and other) over the http commands. From any regular browser its a pice of cake. I would like to create virtual device where each button will represent specific command for camera control. I succeeded to create a scene with LUA to execute the commands: --[[ %% properties %% globals --]] local httpClient = net.HTTPClient(); httpClient:request('http://192.168.1.51:88/cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=Vchod&usr=AAA&pwd=BBB') However when I use the same code in VD with LUA, it doesn't work. I would like to avoid creating 10 scenes and call the scenes from VD, I would like to execute the code directly from VD. Is it possible? Thanx for any advice.
  23. Hello, I'm trying to get the PushOver-scene working. But i get error "[ERROR] 20:55:45: line 11: attempt to index global 'net' (a nil value) at the line 'local selfhttp = net.HTTPClient({timeout=2000}) " My HC2 is running at version 3.590. Can some tell me what is wrong here? Thnx! John
  24. Hi All, I am seeing a fair few posts mentioning HTTP commands. Is it possible to control any Fibaro device outside of the Iphone apps, using browser http:// commands? If so what is the syntax please? Will it work from all browsers? ie Chrome, Firefox, etc Thanks
×
×
  • Create New...