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


jgab

Calendar info, Sweden.. and other countries

Recommended Posts

Posted (edited)

Sorry, this is mostly useful for Swedish users. Simple QA that sets a variable if it's a working day or not (i.e. bank holidays). Uses the api from dryg.net.

Good to have to control some automation - avoid turning on the lamps too early on a non-working day...

Please login or register to see this attachment.

Code example with creating global variables and an update loop that runs every midnight and survives daylight savings....

Please login or register to see this code.

Variables set:

"Namnsdag" - Name(s) of the day
"Flaggdag" - if flag dat - reason for flagging
"Arbetsfri" - "Ja"/"Nej"

Edited by jgab
  • Like 1

Share this post


Link to post
Share on other sites

A great idea, I hope that someone will be able to adapt to the Polish calendar.

Share this post


Link to post
Share on other sites
  • Topic Author
  • 39 minutes ago, michal85pl said:

    A great idea, I hope that someone will be able to adapt to the Polish calendar.

    The trick is to find someone that publish an API without charging for it... :-)

     

    Share this post


    Link to post
    Share on other sites

    Hi @jgab,

    What made you decide to use global variable instead of local QA variables?

    Share this post


    Link to post
    Share on other sites

    Great!!

    Something like this?

    1000 free requests/ month

    //Sjakie

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 43 minutes ago, Bodyart said:

    Hi @jgab,

    What made you decide to use global variable instead of local QA variables?

    Because block scenes can trigger on or check globals. Easier for other scenes/QAs to get value also.

    quickVars are best for QA’s own use and config parameters.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • 4 hours ago, jgab said:

    Because block scenes can trigger on or check globals. Easier for other scenes/QAs to get value also.

    quickVars are best for QA’s own use and config parameters.

     Well, I had introduced a bug so the QA didn't update...

    Here is a corrected version

    Please login or register to see this attachment.

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Ok, bad topic of the thread (not only for Sweden now) but here is a more international version using the 

    Please login or register to see this link.

    service that @Sjakie pointed at.

    Please login or register to see this attachment.

    You will manage the free tier as it calls the api once a day, ~30 times a month, and it's free for 1000/month.

     

    quickAppVariables:

    'api_key' - the api key you get when you register

    'country' - country code according to their api

    'language' - only if you pay you get the data in your language of choice - otherwise english

    'weekends' - if set to "no" will not consider weekends as work free days (default is yes)

     

    This behaves a bit different. The QA is of type binarySwitch and will be on when it's a holiday (or weekend) and off when not (when it's a work day)

    This way it's easy to test if the QA is on or off.

    It also supports turnOn and turnOff commands to override the automatic setting. If you wake up in the morning and decides it should be holiday anyway... :-) 

     

    Feel free to improve.

    • Thanks 3

    Share this post


    Link to post
    Share on other sites

    Jan,

    You are the best with your service excellence!!

    Thanks for your support to all users off Fibaro.

    I cant wait to buy my HC3 but with pain because HC2 is running very smooth now, she knows it!

    //Sjakie

    Share this post


    Link to post
    Share on other sites

    Hi @michal85pl have you thought of using a Google Calendar? You could set your own public holidays and personal holidays. You could then use www.ijpuk.com service to read your calendar. You’ll have much more control. 

    Share this post


    Link to post
    Share on other sites
  • Topic Author
  • Yes, but the idea was that I was too lazy to remember and setup holidays so I wanted a source to do it automatically. :-)

    However, one can subscribe to public holidays for calendars so that could be a way.

    I have already made a iCalendar QA (works with Google calendar and Apple's iOS calendar)

    but the use-case is a bit different (I guess similar to your service?). There you can add events in the calendar that will be posted as custom-events for the HC3 so that block-scenes and scenes easily can trigger on the events starting and stopping. 

    I'm currently re-working the QA a bit and will re-post it as I have got some more ideas...

    Share this post


    Link to post
    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
    Reply to this topic...

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