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 'FHttp'.

  • 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

Found 2 results

  1. Hi there, my first time here, I am trying to capture a multipart XML-alertstream from a Hikvision IP camera, but since the stream never closes I never receive a response. The information within the stream, such as VMD, LINEDETECTION, FIELDDETECTION etc. will be used to trigger other scenes or VD's in my HC2 (v4.080). This is my test scene so far: fibaro:debug(tostring(fibaro:countScenes())) --to indicate how many instances are running local http = net.HTTPClient() http:request ('http://10.1.1.115/Event/notification/alertStream', { options = { method = "GET", headers = { ['Authorization'] = 'Basic XXXXXXXXXXXXXXXXXXXXX' } }, success = function (response) fibaro: debug (‘OK’) end, error = function (err) fibaro: debug (‘ERROR’) end }) fibaro: debug (‘End of Script’) When running the code, no OK or ERROR will show up, but immediately shows this: 1 End of Script Running the code again shows: 2 <-- is this an indication that the HTTP connection from instance 1 is still open? End of Script Additional info: The GET method works fine directly from my browser (http://<user>:<pwd>@10.1.1.115/Event/notification/alertStream), but the connection stays open while xml data is continuously being added. There’s no authorization issue since I am able to get a good response (single XML response) from a simple GET request. Final goal, of course, is to read response.data in order to do nice things with it. But since nothing shows up… Can someone point me in the right direction? Thanks in advance.
  2. Hi there. I am running 4.047 on my HC2. I am trying to use this command in LUA to see if there is rain forecast and if I have already set the rain delay to 24 hours then ignore the step. However it does not like the FHttp line.. What am I doing wrong?? The statement seems to work in a virtual device but not in a LUA scene. The error I get is [ERROR] 22:22:46: line 11: attempt to index global 'Net' (a nil value) --]] local sourceTrigger = fibaro:getSourceTrigger(); -- Set authentication HC2 = Net.FHttp("192.168.1.xxx",80) HC2:setBasicAuthentication("admin", "password") -- get data table from the Sprinklers Panel response ,status, errorCode = HC2:GET("/api/panels/drenchers"); jsonTable = json.decode(response); fibaro:debug('Rain Delay Value: ' ..jsonTable.rainDelay); I even tried the following. local HC2 = Net.FHttp("127.0.0.1", 11111); -- get data table from the Sprinklers Panel local response ,status, errorCode = HC2:GET("/api/panels/drenchers"); local jsonTable = json.decode(response); fibaro:debug('Rain Delay Value: ' ..jsonTable.rainDelay); still no joy. This is my entire code. ---------------------------------------------------------------- --[[ %% autostart %% properties 3 WeatherConditionConverted %% globals --]] local sourceTrigger = fibaro:getSourceTrigger(); -- Set authentication local HC2 = Net.FHttp("127.0.0.1", 11111); -- get data table from the Sprinklers Panel local response ,status, errorCode = HC2:GET("/api/panels/drenchers"); local jsonTable = json.decode(response); fibaro:debug('Rain Delay Value: ' ..jsonTable.rainDelay); function tempFunc() local currentDate = os.date("*t"); local startSource = fibaro:getSourceTrigger(); if ( ( fibaro:getValue(3, "WeatherConditionConverted") == "rain" ) or ( fibaro:getValue(3, "WeatherConditionConverted") == "storm" ) and (string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "12:01") and ( tonumber(jsonTable.rainDelay == 0 ) ) ) then fibaro:call(319, "pressButton", "2"); fibaro:call(tonumber(fibaro:getGlobalValue("RajIphone")), 'sendPush', 'Sprinkler Delayed by 24 hours'); fibaro:call(2, "sendEmail", "Sprinkler Delay", "Sprinkler Delay by 24 hours"); end setTimeout(tempFunc, 60*1000) end if (sourceTrigger["type"] == "autostart") then tempFunc() else local currentDate = os.date("*t"); local startSource = fibaro:getSourceTrigger(); if ( startSource["type"] == "other" and ( tonumber(jsonTable.rainDelay == 0 ) ) ) then fibaro:call(319, "pressButton", "2"); fibaro:call(tonumber(fibaro:getGlobalValue("RajIphone")), 'sendPush', 'Sprinkler Delayed by 24 hours'); fibaro:call(2, "sendEmail", "Sprinkler Delay", "Sprinkler Delay by 24 hours"); end end ----------------------------------------------------------------
×
×
  • Create New...