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


  • 1

Scene Trigger on Variable Change


Question

Posted

Hi

 

I know it is possible for a scene to be triggered every time a device value changes by using the lua script below:

--[[ </br>
2    %% properties </br>
3   50 value </br>
4    %% globals </br>
5    –]] </br>
 
This will activate teh scene every time deviceID 50 changes its value.
 
I would like the scene to be triggered every time the value of my variable Battery_Level changes?
this doesnt seem to work:
--[[
%% properties
"Battery_Level" value
%% events
%% globals
--]]
 
Help please.

5 answers to this question

Recommended Posts

  • 0
Posted

Try this:

 

--[[
%% properties

%% events
%% globals
Battery_Level
--]]

 

  • 0
  • Inquirer
  • Posted

    Hi

     

    Unfortunately I've tried that and it doesnt trigger.  any more suggestions?

    • 0
    Posted (edited)

    This works for an individual battery device;

    Please login or register to see this code.

     

    And check this download from @AutoFrank  for multiple devices and notifications - 

     

     

    Edited by MARCUSP.I.L
    • 0
    Posted (edited)

    Hei again , after reading your post i found that i wanted a scene that gave me visual warnings, i.e. light in room with battery device might flash if battery level was very low.

    Sankotronic's battery check scene is marvelous and gives a visual oversight that pinpoints every detail , really clever.

     

    Here is a scene i found on the Forum. all credits go to author..

    You can change battery levels for scene and add actions i.e. turn on/ flash light etc..

     

    Please login or register to see this code.

     

    Edited by MARCUSP.I.L
    • 0
    Posted
    On 6/21/2019 at 12:43 AM, rickydehaas said:

    Try this:

     

    --[[
    %% properties

    %% events
    %% globals
    Battery_Level
    --]]

     

     

    On 6/21/2019 at 7:58 PM, ChrisI said:

    Hi

     

    Unfortunately I've tried that and it doesnt trigger.  any more suggestions?

     

    Hi @ChrisI ,

     

    Above solution from @rickydehaas  definitely work, but for test purpose you have to change that global variable value from some test code. Scene will NOT be triggered if you change global variable value in variable panel and press Save button.

     

    Actually more and more solutions on this forum uses table formatted data stored in global variables which are destroyed if Save button is used in global variable panel so you should not do that but have some test VD where you can change global variable value with simple code.

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