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


pixys

Member
  • Posts

    48
  • Joined

  • Last visited

About pixys

Profile information

  • Country
    Luxembourg
  • Gateway/s
    Home Center 2

Recent Profile Visitors

95 profile views

pixys's Achievements

Learner

Learner (2/8)

1

Reputation

  1. Thanks you so much After checks when you load it from json without the decode, it is a string the json.decode convert the json to an array In order to work I had to response = HC2:GET("/json/myjson.json") response = json.decode(response) change my file from { d20200201="A", d20200204="A", d20200205="B", d20200207="C" } to { "d20200201":"A", "d20200204":"A", "d20200205":"B", "d20200207":"C" }
  2. Thanks a lot for your code. I did try It, it is working when I manually define res = { d20200201="A", d20200204="A", d20200205="B", d20200207="C" } but if I do take res from res = HC2:GET("/ical/test.json") with the same content, it is not working anymore, it says [DEBUG] 14:54:41: { d20200201="A", d20200204="A", d20200128="B", d20200207="C"} [DEBUG] 14:54:41: Value for d20200128 not found it looks like it does not recognise the type of the array anymore. Any idea why ?
  3. Hello I'm trying to do a virtual devise with load a json data with the current date. I'm currently stuck with LUA programming, If you could help me , it would be nice. www.mysite.com/json/data.json is looking like this { "d20200201":"A", "d20200204":"A", "d20200205":"B", "d20200207":"C" } HC2 = Net.FHttp("www.mysite.com") response = HC2:GET("/json/data.json") response = json.decode(response) date = (os.date("%Y%m%d")) if (loadstring(printf (response."d"..date)) != nill) then fibaro:loadstring(setGlobal("Today", response."d"..date)) fibaro:log("Today : "..fibaro:getGlobalValue("Today")) fibaro:loadstring(call(78,"setProperty","ui.Label1.value",response."d"..date)) fi What I'm trying to do is in theory quite simple. I do read my json with the current date, I try to see if I can get a value for the date in my json, if yes, I do set the Variable in Fibaro named "Today" with the value of my json. Thanks a lot Christophe
  4. Hello, I will check. Thanks a lot
  5. Hello After 2,x days, I've got service unavailable on my homecenter2. The only thing I can do is : restart services and the service is back again. Is there anyway for me to check logs in order to know the reason of this unavaibility ? I know this come from LUA scene programmation changes. But I would like to know what wrong. If this is link to the CPU or used RAM. Is there a way for me to investigate ? Thanks Pixys
  6. Thanks , I will have to read it twice to understand all the concept
  7. I've got 7 in total 1 per heating control. I understand the main loop --[[ %% autostart %% properties %% events %% globals --]] local sourceTrigger = fibaro:getSourceTrigger(); myfunction if (triggervarscene1==true) then execute scene1 end setTimeout(myfunction, 60*1000) end if (sourceTrigger["type"] == "autostart") then tempFunc() end Do you have any sample of a scene trigger by device or variable ? Thanks Pixys
  8. Hello I've wrote a little scene in LUA, and I still do not figure out how scene are triggered --[[ %% autostart %% properties %% events %% globals --]] local sourceTrigger = fibaro:getSourceTrigger(); fibaro:debug(tostring(os.date("%d/%m/%y %H:%M:%S"))..' - Start - Scene Activate'); if (sourceTrigger["type"] == "autostart") then fibaro:debug(tostring(os.date("%d/%m/%y %H:%M:%S"))..' - Debug Autostart'); else if (startSource["type"] == "other") then fibaro:debug(tostring(os.date("%d/%m/%y %H:%M:%S"))..' - Manual Trigger'); end end fibaro:debug(tostring(os.date("%d/%m/%y %H:%M:%S"))..' - End - Scene Activate'); For the result in the debug windows with this code should loop. and should look like [DEBUG] 16:45:51: 28/09/17 16:45:51 - Start - Scene Activate [DEBUG] 16:45:51: 28/09/17 16:45:51 - Debug Autostart [DEBUG] 16:45:51: 28/09/17 16:45:51 - End - Scene Activate [DEBUG] 16:45:52: 28/09/17 16:45:52 - Start - Scene Activate [DEBUG] 16:45:52: 28/09/17 16:45:52 - Debug Autostart [DEBUG] 16:45:52: 28/09/17 16:45:52 - End - Scene Activate [DEBUG] 16:45:53: 28/09/17 16:45:53 - Start - Scene Activate [DEBUG] 16:45:53: 28/09/17 16:45:53 - Debug Autostart [DEBUG] 16:45:53: 28/09/17 16:45:53 - End - Scene Activate ..... But the result of the execution is that one [DEBUG] 16:45:51: 28/09/17 16:45:51 - Start - Scene Activate [DEBUG] 16:45:51: 28/09/17 16:45:51 - Debug Autostart [DEBUG] 16:45:51: 28/09/17 16:45:51 - End - Scene Activate only 1 occurence of the execution. Can someone explains what's triggering the execution of the scene ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- I found the explaination. How this is working Scene got activated once. If you want to have a reoccurence of the activation you need to create a function and write inside what the part of the code you want to reexecute. and at the end of the function use the fibaro function setTimeout(nameofmyfunction, 60*1000) -> 60 is 60 secondes. The code should looks like --[[ %% autostart %% properties %% events %% globals --]] local sourceTrigger = fibaro:getSourceTrigger(); myfunction fibaro:debug('This is looping'); setTimeout(myfunction, 60*1000) end if (sourceTrigger["type"] == "autostart") then tempFunc() end
  9. I will try with the knowledge I've got
  10. Hello It worked, Thanks to all of you
  11. Hello What I want is : when I switch on the wall plug is to have the led around the wall plug switch on. For some reason, this one switch off after 3, 4 seconds Here are the parameter . Parameter 61 LED ring illumination colour when controlled device is on. 1 - LED ring illumination color changes continuously, using full spectrum of available colors, depending on power consumption changes. Parameter 62 LED ring illumination colour when controlled device is off. 8 - illumination turned off completely. Parameter 63 LED ring illumination colour at the Z-Wave network alarm detection. 1 - LED ring flashes red / blue / white (default), For pressing the switch, I've to wait to be home. I took the parameter remotely Regards Christophe
  12. I will tried that, I'll keep you informed Thanks Pixys
  13. Hello I've got 1 Wall plug which has a strange behaviour. When I switch on the wall plug, the led switch on for 3,4 seconds and after switch off. The wall plug is still on but the led are off. I've checked between my other wall plug and this one, the only difference I see is the Wall plug type. 1 is a light switch the one which does not work is "other device". I've tried to reset the wall plug, the led do not stay on when the wall plug is on. Do I do something wrong ? Any idea ? Thanks Pixys
  14. Hello, For a weird reason, I look like the convert to LUA did not work on some of my scene. It remove the part fibaro:call(8, "setTargetLevel", "23"); fibaro:call(8, "setTime", tonumber(os.time(t)) + 120*60); which would be a reason why my scene were not working. I'll keep you post. There is definitively an issue with the converter from BLOCK to LUA. Some part from the execution are removed during the convertion.
×
×
  • Create New...