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

*SOLVED* Can you not retrieve values from battery devices?


Question

Posted

Hi All,

May be a stupid question but I've never really thought of it until I just tried to debug a script. Basically I tried (for debug purposes) to get the 'value' of a doorsensor and it's 'armed' status. When I did this and tried to print out to screen all I get is an error saying that cannot concatenate a NIL value for _test (below). Basically saying it cannot put a null value into the variable. So my question is what to do? I am guessing it will work properly when the id for the device is triggered and, guess, is awake and so it's value is past through to scene script but can we not pull values from battery devices at all? Either that or am I doing something else wrong?

KR, Dave segment of code below:

if tonumber(fibaro:getValue(_outerSpotsDeviceI, "value")) == 0 then

fibaro:call(_outerSpotsDeviceI, "turnOn");

else

local _test tonumber(fibaro:getValue(_silveloxFDoorID, "value"));

-- local _test = 10;

local _test1 tonumber(fibaro:getValue(_silveloxFDoorID, "armed"));

fibaro:debug('Kitchen Lights already on');

fibaro:debug('Silvelox id: ' .._test); -- ..'and is: ' .._test1);

end

[ Added: 2015-01-11, 00:48 ]

Woah the forums are busy at the minute!?

>300 views and no thoughts anyone??

6 answers to this question

Recommended Posts

  • 0
Posted

You can actually gather information from battery operated devices.

I am using the script below to collect information from a D/W sensor and send a message to my telephone if it is open for more than 3 minutes.

Please login or register to see this code.

  • 0
  • Inquirer
  • Posted

    Hmm, I wonder why the debug is coming back with 'try to concatenate NIL value failed' then?

    I'm lost. Seems like an easy thing, if I transpose the getvalue command for initialising the variable just = 10; then it reads out 10 into debug window. Put the value back and I get that error message!

    Odd!

    Thanks for reply though, nice script:)

    • 0
    Posted

    if this is really an excerpt of your script, then the following line won't work:

    Please login or register to see this code.

    if you want to assign a value to your variable, you should add the '=' sign:

    Please login or register to see this code.

    • 0
  • Inquirer
  • Posted

    OMG

    Please login or register to see this image.

    /emoticons/default_icon_rolleyes.gif" alt=":roll:" />

    Please login or register to see this image.

    /emoticons/default_icon_rolleyes.gif" alt=":roll:" />

    Please login or register to see this image.

    /emoticons/default_laugh.png" alt=":lol:" />

    See, that;s why I love the forum....someone spots what I can't see right in front of my stupid face!

    That;s where copy n paste gets you!! My bad, cheers HorseOne, obvious mistake for previous reason....no idea why I didn't spot it to be honest....was late when I did the scene! That's my excuse anyway!

    Cheers, Solved!

    • 0
    Posted

    Good to hear that you solved it.

    Cheers.

    • 0
  • Inquirer
  • Posted

    Well you did to be fair....

    My Cheval to the rescue lol!!!

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