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


  • 0

need Help, Lua Coding HC3


Question

Posted

Hello, 

i just moved vrom HC2 to HC3. I like the new HC3 but i have problems with the new LUA coding. I just don't get it at all. I'm used to programm in C++ and also programmed some scenes in the "old" LUA. But now i'm lost.

My problem ist actually simple. I have for example 2 or more motion sensors and one or more switches to have an action on. The light should only come one between 10pm and 8am. Either motion sensor can actuate the light. I tried with block scenes too, but also no success. Maybee i have some big tomatoes on my eyes and i just don't see it.

that's what i tried...

I'm looking forward for any help! Thanks

Best regards Hans

{
    conditions = { {
            type = "device",
            id = 284,               --motion Eye1
            property = "value",
            operator = "==",
            value = true,
            isTrigger = true
        }, {
            type = "device",
            id = 72,                 --motion Eye2
            property = "value",
            operator = "==",
            value = true,
            isTrigger = true
        },  {
            conditions = { {
                    isTrigger = false,
                    type = "date",
                    property = "cron",
                    operator = "match>=",
                    value = { "00""22""*""*""*""*" }
                }, {
                    isTrigger = false,
                    type = "date",
                    property = "cron",
                    operator = "match<",
                    value = { "00""07""*""*""*""*" }
                }},
                operator = "all"
            }},
            operator = "any"
}

4 answers to this question

Recommended Posts

  • 0
Posted

I think the problem that you set operator="all" for time condition. The time can not be greater than 22:00 and less 07:00 at the same time.

Try operator="any" for time conditions also.

  • Like 1
  • 0
Posted

To avoid all that I strongly suggest to use

Please login or register to see this link.

 

  • 0
  • Inquirer
  • Posted

    Hello, thanks for your suggestions. For the operator conditions i tried every possible combination. Even with the timespan on the same day (from 21:00 to 22:00). Nothing worked. Then i tried to look at the two motion sensors seperate, but it didn't help either. I will read the AOQ's and the other files, some of them i read already thow... In my old HC2 i did setup the same situation and it worked for years. And i didn't wanted to transfer the system from HC2 to HC3 becaus it gave me the opportunity to a fresh start. The whole house is now converted to HC3 exept the situation in the Hall and Staitcases with the Motion lights. I have to grow into this new Lua coding. At first i didn't have a clue but now i see it a bit clearer. But i have to say that C++ is a dream to programm compared to this Lua....

     

     

    • 0
    Posted
    9 hours ago, speedy610 said:

    Hello, thanks for your suggestions. For the operator conditions i tried every possible combination. Even with the timespan on the same day (from 21:00 to 22:00). Nothing worked. Then i tried to look at the two motion sensors seperate, but it didn't help either. I will read the AOQ's and the other files, some of them i read already thow... In my old HC2 i did setup the same situation and it worked for years. And i didn't wanted to transfer the system from HC2 to HC3 becaus it gave me the opportunity to a fresh start. The whole house is now converted to HC3 exept the situation in the Hall and Staitcases with the Motion lights. I have to grow into this new Lua coding. At first i didn't have a clue but now i see it a bit clearer. But i have to say that C++ is a dream to programm compared to this Lua....

     

     

    There is nothing wrong coding with Lua, but Fibaro conditions and other their built-in high-level commands create problems to the users.

    ?

    • Thanks 1

    Join the conversation

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

    Guest
    Answer this question...

    ×   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...