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

  • 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 All, This Lua Script does exaclty what I am looking for to use the rain delay in the Sprinkler Panel for what would be a more automated method instead of the built in functionality which is pretty manual (so much for "smart" home) Problem is I have an HCL, so I would need to understand how I program this virtual device without LUA Thanks to Vesternet for the original LUA script http://www.vesternet.com/resources/application-notes/apnt-78#.VgRbcrTJ8UW Any help "translating" please. Thanks
  2. hello i'm stuck i have a raspberry pi that is reading the smart meter and i send the values to a text file the output of that file is shown in a php file like this [{ daldag: 3218, piekdag: 2165, vermogen: 497, gas: 1799.421}] the thing that i want is to read the value with lua into a virtual device to show the power consumption daldag : 3218 = 3218 KWH power consumption on low cost total meter readout piekdag : 2165 = 2165 KWH power consumption on high cost total meter readout vermogen : 497 = 497 Watt current power consumption live reading 10 sec interval refresh gas: 1799.421 = 1799.421 M3 gas meter total readout so the question is how to read the different values with lua many thanks Rex
  3. 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 ----------------------------------------------------------------
  4. I have enabled scene activation on my blind modules and I have a scene that triggers as expected when I click once to open my window and again when I click on the same button to stop it from opening any further; the same happens when I click on the right gang to close and pause. The problem is that I need a different outcome when I click once on the left gang to open vs the second time when it pauses the window; similarly for closing and pausing. I can't seem to find a way to determine that the blind has just started opening or whether it has just paused. I have tried value and value2 but they always show as 0. Does anyone have any ideas? PS: positioning does not work as I am controlling windows not blinds and they work differently ;(
  5. Hello, I would download a CSV file with Lua but I can't because HTTP response is application/octet-stream Content-Type. So when I parse the content is zero. I want to address one by one the lines of that file. --[[ %% properties %% globals --]] -- Replace the value with ID of this virtual module selfId=fibaro:getSelfId(); ip = fibaro:get(selfId, 'IPAddress'); ECO = Net.FHttp(ip) local response, status, errorCode = ECO:GET("/protect/download/xdata.csv") fibaro:debug(response) If I take a network trace, although we note that the content is a Content-Type: application / octet-stream GET /protect/download/xdata.csv HTTP/1.1 Host: 192.168.1.10 Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36 Accept-Encoding: gzip, deflate, sdch Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4 HTTP/1.1 200 OK Connection: close Content-Type: application/octet-stream Cache-Control: no-cache ANNEE,MOIS,JOUR,T1_BASE,T1_HCHP,T1_HCHC,T1_EJPHN,T1_EJPHPM,T1_BBRHPJB,T1_BBRHCJB,T1_BBRHPJW,T1_BBRHCJW,T1_BBRHPJR,T1_BBRHCJR,T1_PMAX,T1_ISOUSC,T1_IMAX,Counter1,T2_BASE,T2_HCHP,T2_HCHC,T2_EJPHN,T2_EJPHPM,T2_BBRHPJB,T2_BBRHCJB,T2_BBRHPJW,T2_BBRHCJW,T2_BBRHPJR,T2_BBRHCJR,T2_PMAX,T2_ISOUSC,T2_IMAX,Counter2 2015,1,21,0,437439,233912,0,0,0,0,0,0,0,0,0,45,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2024300, 2015,1,22,0,445749,251266,0,0,0,0,0,0,0,0,0,45,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2024300, Regards,
  6. Hello, My LUA-scenes are not being rescheduled on Home center 2. They run once when I click "start" or "run" but never runs again. This has worked fine before and just seem to have stopped working all of a sudden. Even if I create a new scene with just at debug printout, nothing happens more than once. It might be related to a firmware upgrade, I'm not what version of the firmware that this was running properly on. Now I use the latest version (4.042). Any clues to what's going on and how I can get things going again? BR Erik
  7. How hard can it be to set a value to 30 from 60 ? delay = fibaro:getValue(28, "alarmDelay"); -- Get time fibaro:debug ("exit delay =" ..delay); fibaro:call(28, "alarmDelay", "30"); --set new time delay = fibaro:getValue(28, "alarmDelay"); -- Get new time fibaro:debug ("new exit delay =" ..delay); But i cant change it, It is still 60
  8. Hi Every morning i forget to disarm my permitter (night) alarm. Now I would like to create a scen that does it for me :=) Senario: in the morning between 6-7am monday to friday then motion is detected in the bathroom then disarm So I need some help with he lua cod for the timerange ==================================================== --[[ %% properties 9 value %% globals --]] if ( ( tonumber(fibaro:getValue(9, "value")) > 0 ) -- Motion detected and THIS ===> ( (os.day= monday to friday) and (os.time = 06:00 to 07:00) ); ) then fibaro:call(61, "turnOn"); -- example code for disable permiter... End ====================================================== THX in advance
  9. Hi, I'm trying to learn how to use Lua, but struggling to get my head around it with no examples, if possible could you post a scene on here with a breif description of what it is, ie the ID and what they are, it would be very much appreciated Thanks Ally
×
×
  • Create New...