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

Goodnight Scene - Notification optimisation


Question

Posted

Hi guys, I'm trying to do a scene that checks my bedroom plug, and when I turn it on ( because its an extension and have a power button ), it consumes about 0.5W only with the charges connected and without the phone / tablet and watch connected to it. When I connect everything to the charger it goes up to 10W.

 

So, when I turn on my extension I receive a push notification where I can activate Goodnight Scene that turns off everything and turns on the alarm.

 

Can I optimise this code?

Please login or register to see this code.

I'll add another condition that checks it the global variable Day/Night is Night, to run the script only at night. I'm not a programmer, so I don't know if its OK to use that sleep times so big.

 

Thanks.

 

4 answers to this question

Recommended Posts

  • 0
Posted

have a look at GEA, you can do this with 2-3 lines I guess

 

Please login or register to see this link.

 

Please login or register to see this link.

  • 0
Posted

I think I'm doing the same thing in a similar way. This seems to be very solid in the last 6 months.

Please login or register to see this code.

  • 0
  • Inquirer
  • Posted

    @umbex, sorry for the delay to responding, but I was in vacations. I'm willing to test your scene, in line 17

    Please login or register to see this code.

    what is alarmDeviceID? I understand that if the phone is charging and if its night time, then this device is turned ON, but what I what to do is to sendPushMSG() to activate or not the sceneId = 166.

     

    I know that I can delete that part, and create another scene using the "PhoneCharging" variable, but if I can keep it in one scene would be grater.

     

    Thanks for the help!

    • 0
  • Inquirer
  • Posted

    @umbex I made this work flow chart because after trying your scene tonight I received 182 notifications :/

    Please login or register to see this attachment.

     

    I made some changes to match my scene, and gonna test again tonight.

     

    Thanks for sharing your code. Just one more question, in MAIN part of the code you have a commented line:

    Please login or register to see this code.

    Why do you need to anticipate sunrise for 1 hour during winter time? And how do yo do that?

     

    Thanks.

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