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

How to put a timer on a device?


Question

Posted

Hello Forum,

I want to put a timer settings to my TV connected to a Fibaro Wall plug, like if TV is ON for 1hour it has to send a notification to my mobile.

how can i do this?

do i need to create a scene or any other settings were there.

if any one know please share the details.

5 answers to this question

Recommended Posts

  • 0
Posted

Set wall plug turned on as a trigger. set a timer using fibaro:sleep(1 hour) after that check if its still on, and send notification

  • 0
Posted

You just create a scene which starts when the plug changes value. If it changes value from 0 to 1, it starts a timer, if it changes from 1 to 0 it kills the scene. You also create a variable whoch is set at 0 when the scene starts.

Then for the timer, you create a loop which sleeps for 60000 ms and then check if the plug value is still = 1, if not, it kills the scene, if it is still 1, you add +1 to your variable. This repeats itself every minute until the variable reaches 60.

When the variable reaches 60, it fires off a push message and resets the vaiable to 0. Now you will receive a message every time another hour has passed.

This is pretty basic Lua stuff, so if you know Lua, this should be no issue to set up, if you don't, you probably need to consult someone who does and who is willing to help write code for you.

  • 0
  • Inquirer
  • Posted

    For this scenario can't i create a scene in graphical blocks

    • 0
    Posted

    This is pretty basic Lua stuff, so if you know Lua, this should be no issue to set up, if you don't, you probably need to consult someone who does and who is willing to help write code for you.

    You people forget there are people here too who have another product from Fibaro called the HCL, it doesn't support LUA, so it would be nice to know if u can make it without LUA too, instead of telling anyone to consult someone.

    I think you dont need LUA for basic stuff like that.

    • 0
    Posted

    Blocks offer just basic options. For results that OP desires, LUA is much more effective, because it allows you to check if more than one instance of the same scene is running and kill it. I think triggering scene by power consumption rather than with state of WP is more convinient way, but it will run a new scene with every change of power, resulting in many notifications send after declared period of time.

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