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

display sunset time


ErnstH
 Share

Question

Hi all,

I would like to display a debug message with the time of sunset + an x amount of minutes. So there needs to be a calculation.

I have a few scenes whose start is dependent of the month, turning lights on earlier or later.

My debug message should be something like "today lights will be on at 21:15". That 21:15 is the calculated time.

I have these declarations at the start of scenes:

local sunsettime    = fibaro:getGlobalValue("SunsetTime");
local sunsetHour   = fibaro:getValue(1,'sunsetHour')

But I can't figure out how to do this. Shouldn't be very complicated, but i'm not good in LUA programming with time.

Hope someone can help me out.

Link to comment
Share on other sites

Recommended Posts

  • 0

@ErnstH no, it’s my fail 

this code for HC3

sorry

replace Fibaro. On fibaro: 

I have fix code for HC2 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 31 minutes ago, 10der said:

    I have fix code for HC2

    Hope so, getting curious...?

    Link to comment
    Share on other sites

    • 0

    @10der Do you happen to know is there is a way to use an icon that is not on the Homecenter but on the internet?

     

    (For example an icon on the internet that represents the current weather, depending the weather state.)

    Link to comment
    Share on other sites

    • 0

    @SmartHomeEddy icon for what?

    IMHO HC3 should woirks without intrenet ? what icon will be showed if you have no internet connection?

    if ypu asking about QA icons - no. as i can see HC3 load icon localy from assert folder. 

    i have already asked Socha about adding icons for Angular materials... but were sent :) 

    Link to comment
    Share on other sites

    • 0

    @10der an icon for a QuickApp. Yes, you have a point when no internet. Then I have to check that also. 

     

    My weather app sends in the json a link for an weather representing icon. Would be fun to use that. 

     

    Maybe there is a way to download the current icon from the internet with an other QuickApp or Lua script, save (overwrite) it on the local (icon) HC3 folder and use it. If no internet, then use the last saved icon. 

     

     

     

     

     

     

    On 8/11/2020 at 10:29 PM, ErnstH said:

    Hope so, getting curious...?

     

    Looking for this (HC2 VD)?

     

    Please login or register to see this code.

     

    Edited by SmartHomeEddy
    Link to comment
    Share on other sites

    • 0
    30 minutes ago, SmartHomeEddy said:

    Maybe there is a way to download the current icon from the internet with an other QuickApp or Lua script, save (overwrite) it on the local (icon) HC3 folder and use it. If no internet, then use the last saved icon. 

    hint, google. base64enc image url

    Link to comment
    Share on other sites

    • 0
    On 8/10/2020 at 9:57 AM, 10der said:

    @theuksbest hust create 

    DayPart

    like

    Please login or register to see this link.

     

    after 1 min variable should re-filled

    than you can use this var with more details sun events

     

        "nauticalDawn"-- 1
        "blueHourDawn"-- 2
        "dawn"-- 3
        "blueHourDawnEnd"-- 4
        "sunrise"-- 5
        "sunriseEnd"-- 6
        "goldenHourEnd"-- 7
        "solarNoon"-- 8
        "goldenHour"-- 9
        "sunsetStart"-- 10
        "sunset"-- 11
        "blueHourDusk"-- 12
        "dusk"-- 13
        "blueHourDuskEnd"-- 14
        "nauticalDusk"-- 15
        "night"-- 16
        "nadir"-- 17
        "nightEnd" -- 18
     

     

    @10der - hiya sorry for coming back to here again, but trying to use the variable you helped me with in a scene but it's not triggering - can you see what i'm doing wrong?

     

    Scene condition:

    Please login or register to see this code.

     

    But here is the Value output on the variable which looks a bit odd:

    Please login or register to see this attachment.

     

     

    Should i be using a specific format for the value in the scene declaration?

    Link to comment
    Share on other sites

    • 0

    Oppps

    never used my sun events in scene 

    on will try. No ready for use answer for you, just now 

    sorry 

    Link to comment
    Share on other sites

    • 0
    4 hours ago, theuksbest said:

    Should i be using a specific format for the value in the scene declaration?

    1st of. i can;t understand what you decide to achieve

    My QA re-calculated (yes it's not optimizaed) every minute - should at 00:00 maybe. in some cases at 03:00 

    but my question sill what you trying to get in scene? for what?

    just reading the current info about the sun?

    it`s very easy

    for example

     

    Please login or register to see this code.

     

    are you want trigger on event changing? 

    Hmmm, 

     

    try this

     

    left

    Please login or register to see this code.

     

     

    right

    Please login or register to see this code.

     

     

    Edited by 10der
    Link to comment
    Share on other sites

    • 0

    QA updated

     

    Please login or register to see this attachment.

    Edited by 10der
    Link to comment
    Share on other sites

    • 0

    Please login or register to see this image.

    /monthly_2020_11/image.png.8d15fbc91bf08ff107ce595cd22dc998.png" />

    Link to comment
    Share on other sites

    • 0
    On 11/1/2020 at 3:55 PM, 10der said:

    Please login or register to see this link.

     

    @10der ah thats great, thank you! I’ll test it and let you know how i get on.

     

    I want to use it to trigger electric blinds coming down in the house in the late afternoon.. So when the global variable changes, it will trigger a scene to close my blinds. But i will probably use it as well to trigger profile changes from night to day as well. At the moment i have a scene with a fixed time before Sunset to change the profile but i just find that sometimes thats not very accurate for the real outside conditions, and means the night lights come on a little too early and its still daylight.

     

    I think your QA might be more accurate for that :) 

     

    I’m also automating how bright my lights come on with motion depending on the time of the day, might even be able to use this for that i guess, just an idea

     

    Thanks for your help!

    Edited by theuksbest
    • Like 1
    Link to comment
    Share on other sites

    • 0

    @10der been testing this and i think I’ve got it working - triggering a scene. However, could you help me build in some of the other categories into events, it actually looks like Evening might be missing  from this example.

     

    Please login or register to see this code.

     

    And I think this is where its creating the even, but missing Evening which i think thats the one i would like to use

     

    Please login or register to see this code.

     

    How can i add Evening and any others which i may would like, thanks in advance for your help?

     

     

    Link to comment
    Share on other sites

    • 0

    @10der still haven't been able to get a scene to trigger properly, can you see anything obvious?

     

    left (id 274 is just a window sensor to make sure the window is closed before the blinds close)

    Please login or register to see this code.

     

     

    right

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0

    Cuz userdescription prop contain OBJECT - TABLE not string “night” like you trying to,pass 

    Link to comment
    Share on other sites

    • 0

    @10der - is there a way to make it an object then, that would make this app really useful for me in running scenes?

     

    So if the value it just had the Day part it was as an object?

     

    Please login or register to see this attachment.

     

    I'm sure others would find this really useful too actually

    Link to comment
    Share on other sites

    • 0
    11 hours ago, theuksbest said:

    So if the value it just had the Day part it was as an object?

    :( so you stil can’t catch my idea 

    ok

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    @10der - ow yeah i think i missed what you were suggesting before, so create an Event and trigger the scene from the event?

     

    is it still possible to have it update the Global Variable though? 

     

    thanks for your help

    Link to comment
    Share on other sites

    • 0
    10 minutes ago, theuksbest said:

    @10der - ow yeah i think i missed what you were suggesting before, so create an Event and trigger the scene from the event?

     

    is it still possible to have it update the Global Variable though? 

     

    thanks for your help

    both!

     

    u can read json data from globals

    u can handle event via scene

    Link to comment
    Share on other sites

    • 0

    Is it not possible then to just have the current variable showing here, rather than a current report on all of them?

     

    see here there looks like a report, current state on all of them.

     

    Please login or register to see this attachment.

     

    I setup the event scene like you suggested so i'm assuming i'll start to see those events coming through. If i use this approach though i was wondering how i add to the Events you have already setup "morning, day and night"

     

    i think this is it right? so how could i add in Evening for example as a new event?

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    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.

     Share

    ×
    ×
    • Create New...