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

lua change value alarmExclude


Question

Posted

Hi, I have to change in lua code the 

Please login or register to see this code.

in

Please login or register to see this code.

How I can do?

 

I tried different solutions but no one worked

 

Please login or register to see this code.

Thank's

5 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    Hey guys! No one answers? ?

    • 0
    Posted (edited)

    Yo can not change property value by fibaro:call(). It works for ACTION only

    May I ask you, why you change it by Lua? Usually this done by device configuration and not by code!!!!

    Please login or register to see this spoiler.


    In any case here is the code to do it. (change "local id" to your real device ID)
    Please note, if device is battery powered it will wait for device wakeup to update parameters. (You can manually to wakeup device).

    Please login or register to see this code.

     

    Edited by cag014
    • 0
  • Inquirer
  • Posted (edited)

    Hi cag014,

    the answer to your question is that I often have to temporarily exclude zones and I must have the possibility to do so from the app

     

    I've execute your code but the properties.alarmExclude not changed even after wakeup

    This my code:

     

    Please login or register to see this code.

    Result:

    Please login or register to see this code.

    Code Check:

    Please login or register to see this code.

    Result:

    Please login or register to see this code.

    Can you help me?

    Thank's a lot

    Edited by zcris71
    • 0
  • Inquirer
  • Posted

    The right code is:

     

    Please login or register to see this code.

    Thank you cag014 for the inspiration you gave me to solve the problem

    Have a nice day!

     

    • 0
    Posted (edited)

    "device" parameter is a table,so in order to print it out use:

    fibaro:debug(json.encode(device))

    or just print parameter that you need

    fibaro:debug(device.properties.alarmExclude)

     

    Is it works for you?

    BTW: to verify your changes just enter in browser

    http://hc2/api/devices/ID

    Change hc2 to your IP address and ID to your device ID number (something like that)

    http://192.168.1.100/api/devices/394

    Edited by cag014

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