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


All-in-One Scene: How to do it Better


cag014

Recommended Posts

Hi @cag014

 

I can confirm this now working and working a treat!! Thanks very much for this.

 

I do have another question.

 

I have a mix of Fibaro RGBW controllers 1st and 2nd gen and use these more than I use lights. 

 

Could you please give an example how I can have these turn on when motion is detected and a global variable TimeOfDay is set to night rather than day. I have 2 block scenes that changes the global variable to night when a Fibaro sensor detects that the Lux drops below 150 and another for when when the Lux is above 250 and set the variable to Day. There is probably a way I can do this with your scene but not to sure how to. And I know the version 1 and 2 RGBW's are totally different the way they work and need controlling.

 

I have tried the below just for a test going on what I heave learned so far for RGBW version 1 and this is not working: - 

 

Please login or register to see this code.

 

Thanks once again,

 

Hal

 

 

Edited by Hallamnet
Link to comment
Share on other sites

  • 4 weeks later...

Hello someone here can help me on this code:

 

"

--========================== USER CONFIGURABLE PARAMETERS ===============================

gpsDevice={["999"]="UserName",["9999"]="skip"}

--=== jSon Parameters to number

jP2n={ outTempLim=25, homeTempLim=23,humLim1=65,humLim2=81,

     vmc1=20,vmc2=25,vmc3=55,vmc4=60,vmc5=95,vmc6=99}

 

--=== jSon String to name

jS2n={qubino=1147, ktLT=554, bathLT1=56, bathLT2=62, bathLT3=347, bathLT4=207,

bathHum1=51, bathHum2=66, bathHum3=143, bathHum4=213,

outTemp=3,homeTemp=365,

}

 

--=== jSon Main actions table

 

jM={

 

{5,"`qubino`",{state="`vmc1`",lineState="if{$24clock:value=21:00~06:59} or {$24clock:value=12:00~13:59} or {`outTemp`:Temperature>`outTempLim`}",

       timeLoopAct={"`qubino`","setValue,0"}}},

 

{5,"`qubino`",{state="`vmc2`",lineState="if {`bathLT1`,`bathLT2`,`bathLT3`,`bathLT4`,`ktLT`:valueModified>180}",

      timeLoopAct={"`qubino`","setValue,`vmc1`;else;setValue,`vmc3`","if{$isFalse:value=?@`bathLT1`>value+@`bathLT2`>value+@`bathLT3`>value+@`bathLT4`>value+@`ktLT`>value?}"}}},

 

{5,"`qubino`",{state="`vmc3`", lineState="if {`bathLT1`,`bathLT2`,`bathLT3`,`bathLT4`,`ktLT`:valueModified>180}",

      timeLoopAct={"`qubino`","setValue,`vmc1`","if{$isFalse:value=?@`bathLT1`>value+@`bathLT2`>value+@`bathLT3`>value+@`bathLT4`>value+@`ktLT`>value?}"}}},

 

{5,"`qubino`",{state="`vmc4`", timeLoopAct={"`qubino`","setValue,`vmc3`","if {`bathHum1`,`bathHum2`,`bathHum3`,`bathHum4`:value<`humLim1`}"}}},

  

{5,"`qubino`",{state="`vmc5`",timeLoopAct={"`qubino`","setValue,`vmc4`","if {`bathHum1`,`bathHum2`,`bathHum3`,`bathHum4`:value<`humLim2`}"}}},

  

{30,"`qubino`",{state="`vmc6`",timeLoopAct={"`qubino`","setValue,`vmc5`","if {`homeTemp`:value<`homeTempLim`}"}}},

 

{"`qubino`",{initOnStartup=false,state="value=300",lineState="if {`homeTemp`:value>`homeTempLim`}",timeSlot="true22:00, false06:45",

      trueAct={"`qubino`","setValue,`vmc6`"},falseAct={"`qubino`","setValue,`vmc5`"}}},

 

{"`qubino`",{initOnStartup=false,state="value=300",lineState="if {`qubino`:value<`vmc2`}",timeSlot="true07:00, false12:00",

      trueAct={"`qubino`","setValue,`vmc1`"},falseAct={"`qubino`","setValue,0"}}},

 

{"`qubino`",{initOnStartup=false,state="value=300", lineState="if {`qubino`:value<`vmc2`}", timeSlot="true16:00, false21:00",

      trueAct={"`qubino`","setValue,`vmc1`"},falseAct={"`qubino`","setValue,0",}}},

 

{"`bathLT1` and `bathLT2` and `bathLT3` and `bathLT4` and `ktLT`",{lineState="if {`qubino`:value<`vmc3`}", state=">0",

      trueAct={"`qubino`","setValue,`vmc2`"}}},

  

{"`bathHum1` and `bathHum2` and `bathHum3` and `bathHum4`",{ trigAll=true, state=">`humLim1`",

      trueAct={"`qubino`","setValue,`vmc4`;else; setValue,`vmc5`","if{`bathHum1`,`bathHum2`,`bathHum3`,`bathHum4`:value<`humLim2`}"},

falseAct={"`qubino`","setValue,vmc3","if {`qubino`:value=`vmc3`~`vmc6`}"}}},

  

 

{0, "$RAM",{state=">85",trueAct={{"RAM>85%","sendNote","Warning. \nSystem memory is $RAM% ",true},{"|$lineId|","setStateValue","80"}},falseAct={{"|$lineId|","setStateValue","85"},{"RAM<80%","sendNote","System memory is $RAM%"}}}},

{0, "$HC2onLine",{state="true",trueAct={"","tts","$dayTime, Home center is on line","{$24clock:value=?$sunriseHour+7200?~?$sunsetHour+3600?}{$24clock:value=?$sunsetHour+3600?~?$sunriseHour+7200?}"},falseAct={"","tts","$dayTime, Home center is off line"}}},

{0, "$internet",{state="online",trigAct={"","tts","$dayTime, Internet is $internet"}}}, ics

}     

 

 

Regards

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hi @cag014,

I have a problem with the timer function:

{"`CVketel`","turnOn"}, {"`CVketel`","turnOff","timerCVketel,?60*60?","if {`Thermostaat`:heatingThermostatSetpoint < @`TempThermostaat`>value}"},

results in: 

[18.11.2023] [09:25:20] [TRACE] [AOQ387]: jM{9}T   Portable;283:Port Switch[2.Pressed] ➯ turnOn{CVketel)

[18.11.2023] [09:25:20] [TRACE] [AOQ387]: jM{9}T   Portable;283:Port Switch[2.Pressed] ↪ skip turnOff {CVketel}  if not {Thermostaat(19.0):heatingThermostatSetpoint<18.5TemperatuurHuiskamer:832>value}

 

I want to execute the condition after the delay from the timer and not immediately. What is wrong?

Link to comment
Share on other sites

  • 2 weeks later...
  • Topic Author
  • Hi to all,

    Lately have been extremely busy and have endless business travels. 

    I am back day after tomorrow and will try to answer all topics.

     

    On 11/18/2023 at 12:53 PM, Rover said:

    Hi @cag014,

    I have a problem with the timer function:

    {"`CVketel`","turnOn"}, {"`CVketel`","turnOff","timerCVketel,?60*60?","if {`Thermostaat`:heatingThermostatSetpoint < @`TempThermostaat`>value}"},

    results in: 

    [18.11.2023] [09:25:20] [TRACE] [AOQ387]: jM{9}T   Portable;283:Port Switch[2.Pressed] ➯ turnOn{CVketel)

    [18.11.2023] [09:25:20] [TRACE] [AOQ387]: jM{9}T   Portable;283:Port Switch[2.Pressed] ↪ skip turnOff {CVketel}  if not {Thermostaat(19.0):heatingThermostatSetpoint<18.5TemperatuurHuiskamer:832>value}

     

    I want to execute the condition after the delay from the timer and not immediately. What is wrong?

    Please post related JM lines

    Link to comment
    Share on other sites

    11 hours ago, cag014 said:

    Hi to all,

    Lately have been extremely busy and have endless business travels. 

    I am back day after tomorrow and will try to answer all topics.

     

    Please post related JM lines

    Hi @cag014, good to see your reaction 😅.

    The related jM lines have been shown in the black line above.

    Link to comment
    Share on other sites

  • Topic Author
  • On 11/28/2023 at 10:53 PM, cag014 said:

    Hi to all,

    Lately have been extremely busy and have endless business travels. 

    I am back day after tomorrow and will try to answer all topics.

     

    Please post related JM lines

    As You can see the condition of the turnOff command is false, that's why the timer doesn't start. 

    Link to comment
    Share on other sites

    On 12/3/2023 at 6:36 PM, cag014 said:

    As You can see the condition of the turnOff command is false, that's why the timer doesn't start. 

    Exactly what the problem is. The condition should be active after the timer delay and not immediately.

    Link to comment
    Share on other sites

    Hi @cag014,

    After moving the jS2n line

    Kerstverlichting="`Kerstboom`|`OmasKast`|`Kookeiland1`|`Kookeiland2`|`Kerstwaterval`|`Hernhuters`|`Vensterbanklicht`",

    in file user_data to another file, the error shows not finding alias `Kerstverlichting`, while in the list of available aliases `Kerstverlichting` is present ?!?

    If the jS2n line is present in both files (or only in file user_data) then there is no error notification.

    Please login or register to see this spoiler.

     

    Link to comment
    Share on other sites

  • Topic Author
  • On 12/5/2023 at 9:59 AM, Rover said:

    Exactly what the problem is. The condition should be active after the timer delay and not immediately.

     

    The condition of the line is not for the timer but for the command therefore the condition active for the timer also.

    Don't know what version you are using, but there is a setTimer command to set/modify the timer condition or duration.

    Please try as below:

    Please login or register to see this code.

     

    Edited by cag014
    • Thanks 1
    Link to comment
    Share on other sites

    Hi @cag014,

    [07.12.2023] [17:15:55] [TRACE] [AOQ387]: jM{1}F   Hal;44:Beweging Hal[false] ➯ turnOff{GIA)

    [07.12.2023] [17:53:09] [DEBUG] [AOQ387]: Gathering information...32611

     

    Why has the AOQ initiated without a crash error notification?

    Link to comment
    Share on other sites

  • Topic Author
  • On 12/7/2023 at 7:24 PM, Rover said:

    Hi @cag014,

    [07.12.2023] [17:15:55] [TRACE] [AOQ387]: jM{1}F   Hal;44:Beweging Hal[false] ➯ turnOff{GIA)

    [07.12.2023] [17:53:09] [DEBUG] [AOQ387]: Gathering information...32611

     

    Why has the AOQ initiated without a crash error notification?

    There are so many errors could be done in jM lines, so it is impossible to simulate and catch all of them.

    Do you know what has been changed in user files that causes this problem?

    Link to comment
    Share on other sites

    On 12/11/2023 at 12:25 PM, cag014 said:

    There are so many errors could be done in jM lines, so it is impossible to simulate and catch all of them.

    Do you know what has been changed in user files that causes this problem?

    No, I have made a lot of changes in the last period.

    But a QA crash should be notificated anyhow with or without indicated reason.

    Link to comment
    Share on other sites

  • Topic Author
  • On 12/12/2023 at 4:06 PM, Rover said:

    No, I have made a lot of changes in the last period.

    But a QA crash should be notificated anyhow with or without indicated reason.

    Not in HC3. Some LUA code errors (like in tables or json commands when values are nul) are failed with no error descriptions.

    Happens a lot...

    Link to comment
    Share on other sites

    On 12/5/2023 at 10:58 AM, Rover said:

    Hi @cag014,

    After moving the jS2n line

    Kerstverlichting="`Kerstboom`|`OmasKast`|`Kookeiland1`|`Kookeiland2`|`Kerstwaterval`|`Hernhuters`|`Vensterbanklicht`",

    in file user_data to another file, the error shows not finding alias `Kerstverlichting`, while in the list of available aliases `Kerstverlichting` is present ?!?

    If the jS2n line is present in both files (or only in file user_data) then there is no error notification.

    Please login or register to see this spoiler.

    Hi @cag,

    How to solve this?

    Link to comment
    Share on other sites

  • Topic Author
  • On 12/19/2023 at 11:50 AM, Rover said:

    Hi @cag,

    How to solve this?

    Unable to recreate the error.

    Could you please post the jS2n table you are using?

    Link to comment
    Share on other sites

    9 hours ago, cag014 said:

    Unable to recreate the error.

    Could you please post the jS2n table you are using?

    Please login or register to see this spoiler.

    The last line shows the alias of Kerstverlichting.

    When I move the jS2n lines to the jS2n={ table in the main file: no problems.

    Put also attention to the second last line: 2=Kerstwaterval=579 ?!?

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...