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


HC3 QuickApps coding - tips and tricks


jgab

Recommended Posts

32 minutes ago, NLWaard said:

Does anyone know how I can pick up the call from that QA  refresh

i hope all commands from UI passed via HTTP RPC calling,.

1) you can peep the command in ypur browser by F12 developent mode

2) grab events via refreshState

 

 

  • Thanks 1
Link to comment
Share on other sites

Jan,

I download and installed ICalendar.

I see two items under the refresh button>>>> Nice QA!

The name of the item I have placed behind >>>#start:xxxx (Not available)<<<< Remark there is a space between xxxx (Not available) That I cant change.

In ER scene:

Rule.eval([[#start:xxxx (Not available) =>
        woonKamer.wcdPlug:on; log('if calendar gives Not  available wcdPlug - On')
                ]])
Plug will not be on.
What I am doing wrong?
How fast the calendar is refreshed if push the refresh button? 
Please advice
//Sjakie
 
Link to comment
Share on other sites

  • Topic Author
  • 10 minutes ago, Sjakie said:

    Jan,

    I download and installed ICalendar.

    I see two items under the refresh button>>>> Nice QA!

    The name of the item I have placed behind >>>#start:xxxx (Not available)<<<< Remark there is a space between xxxx (Not available) That I cant change.

    In ER scene:

    Rule.eval([[#start:xxxx (Not available) =>
            woonKamer.wcdPlug:on; log('if calendar gives Not  available wcdPlug - On')
                    ]])
    Plug will not be on.
    What I am doing wrong?
    How fast the calendar is refreshed if push the refresh button? 
    Please advice
    //Sjakie
     

     

    The iCalendar will post the calendar event as a fibaro custom event.

    The problem is that I try to name the event '#start:xxxx (Not available)' which is not a valid event name.

    If you had just '#start:xxxx' you could have triggered it in ER as

    rule("#custom-event{name='xxxx'} => ...")

     

    The QA was written in February - I will have a look at it during the weekend if it can be "modernised" a bit...

     

    Link to comment
    Share on other sites

    Guest kallecux

    SONOS-QA-Question:

     

    Hi there, if i use this syntax:

     

    Please login or register to see this code.

    i get:

     

    Please login or register to see this code.

    Any hint?

     

    Greetings Karl Heinz 

    Link to comment
    Share on other sites

    53 minutes ago, kallecux said:

    SONOS-QA-Question:

     

    Hi there, if i use this syntax:

     

    i assume the QA from @10der, in my QA Sonos Player i haven't implemented stream info (because i don't care about that - i wish just to play).

    When i need more, then there is QA from @Krikroff which can catch such things properly.

     

    • Thanks 1
    Link to comment
    Share on other sites

    @kallecux btw, Fibaro still unimpkement main (as for me) thing

     

    1) we can`t definde user (custom) properties.

    ( more clear: I want to add and use in Generic (and not on;y generic) QA 

    here user/custom properties

    Please login or register to see this image.

    /monthly_2020_10/image.png.0d9c5a7ef7406b03f083fd5d2a38c869.png" />

     

    2) please make able to get result of fibaro.call

    yes I know what this function is asynced and we can get only Succ ro not succ resut,

    but we want to get response result in some cases!

    please! 

     

    @A.Socha

    Edited by 10der
    Link to comment
    Share on other sites

    Guest kallecux

    Hi @10der

     

    In Germany there is a saying if you don't understand a thing: It goes like this: I only understand "train station" -> Ich verstehe nur "Bahnhof"

    :-)

    What do i have to do?

    Greetings!

    Link to comment
    Share on other sites

  • Topic Author
  • On 10/15/2020 at 1:11 PM, jgab said:

     

    The iCalendar will post the calendar event as a fibaro custom event.

    The problem is that I try to name the event '#start:xxxx (Not available)' which is not a valid event name.

    If you had just '#start:xxxx' you could have triggered it in ER as

    rule("#custom-event{name='xxxx'} => ...")

     

    The QA was written in February - I will have a look at it during the weekend if it can be "modernised" a bit...

     

     

     

    Ok, I have "modernised" the

    Please login or register to see this link.

    The original idea was that the QA would emit custom event with names from the the calendar event title or special tags in the description. That way one could make block scenes that reacted to calendar events. However, due to how custom-events work, it's not a great idea as custom-events can "overwrite" themselves as they need to be predefined before we can emit them...

    Anyway, besides custom-events, the new QA publish the event at start and end of the calendar event - using the QA_toolbox pubs mechanism. ER4 scenes can subscribe to pubsub events.

    Please login or register to see this code.

    These rules subscribe to 'iCAL' events and then a rule that logs start events.

    The QA publish an event when the it starts and when it terminates. The 'status' key is either 'start' or 'end' depending on.

     

    The full event have this structure:

    Please login or register to see this code.

    endDate and startDate is unix.time for the start and end of the. event.

    You could match on the title or the. descr field to trigger actions in various ways...

    Link to comment
    Share on other sites

    Jan,

    Just started HC3 downloaded your file

    add as QA error:

    Please login or register to see this attachment.

    //Sjakie

    Link to comment
    Share on other sites

    I'm getting error:

    HTTP Error:"Operation not supported"

     

    Can't figure out what am I doing wrong.

    Link to comment
    Share on other sites

    Jan, sorry something with Firefox??

    Download again with Chrome restarted HC3 and its accepted

    //Sjakie

    btw I see calendar Items

    Link to comment
    Share on other sites

    12 minutes ago, Sjakie said:

    Jan, sorry something with Firefox??

    Uploaded in Firefox; no probs at all

    Link to comment
    Share on other sites

  • Topic Author
  •  

    1 hour ago, Bodyart said:

    I'm getting error:

    HTTP Error:"Operation not supported"

     

    Can't figure out what am I doing wrong.

     

    Is your iCal URL correct?. You use iCloud or Google calendar?

    Link to comment
    Share on other sites

  • Topic Author
  • 3 hours ago, jgab said:

     

     

    Ok, I have "modernised" the

    Please login or register to see this link.

    The original idea was that the QA would emit custom event with names from the the calendar event title or special tags in the description. That way one could make block scenes that reacted to calendar events. However, due to how custom-events work, it's not a great idea as custom-events can "overwrite" themselves as they need to be predefined before we can emit them...

    Anyway, besides custom-events, the new QA publish the event at start and end of the calendar event - using the QA_toolbox pubs mechanism. ER4 scenes can subscribe to pubsub events.

    Please login or register to see this code.

    These rules subscribe to 'iCAL' events and then a rule that logs start events.

    The QA publish an event when the it starts and when it terminates. The 'status' key is either 'start' or 'end' depending on.

     

    The full event have this structure:

    Please login or register to see this code.

    endDate and startDate is unix.time for the start and end of the. event.

    You could match on the title or the. descr field to trigger actions in various ways...

     

    Example.

    We mark in the calendar what time the sauna should be on. In the description field we have the keyword "SaunaON" somewhere.

    We then trigger on the start event. We check if the description contains the keyword SaunaON and then turn on the sauna.

    ...and then we trigger on the end event, and turn off the sauna.

    Please login or register to see this code.

    If we just want to turn on the sauna at a given time we of course skip the last rule.

     

    Just realised that this post should have been in the EventRunner thread.

    Edited by jgab
    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    Is your iCal URL correct?. You use iCloud or Google calendar?

    I use Google calendar and i'm using the same URL as in previous version iCalendar (v0.1), where it worked correctly..

    CALURL = "https://calendar.google.com/calendar/ical/xxxxxx%40gmail.com/private-ffffffffffffffffffffffff/basic.ics"
    Ofcourse with correct credentials...
    Link to comment
    Share on other sites

  • Topic Author
  • 7 minutes ago, Bodyart said:

    I use Google calendar and i'm using the same URL as in previous version iCalendar (v0.1), where it worked correctly..

    CALURL = "https://calendar.google.com/calendar/ical/xxxxxx%40gmail.com/private-ffffffffffffffffffffffff/basic.ics"
    Ofcourse with correct credentials...

    If you paste the url into the browser does it download the calendar?

    Link to comment
    Share on other sites

    I had to change:
    if CALURL then self:setVariable(CALNAME,"Joe",CALURL) end
    to
    if CALURL then self:setVariable(CALNAME,CALURL) end

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, jgab said:

    If you paste the url into the browser does it download the calendar?

    Ah there is a bug in the code.

    At the end of the "main" file

    Change

      if CALURL then self:setVariable(CALNAME,"Joe",CALURL) end

    to

      if CALURL then self:setVariable(CALNAME or "Joe",CALURL) end

     

    I assume that you have set CALURL and CALNAME?

    2 minutes ago, bgoldie said:

    I had to change:
    if CALURL then self:setVariable(CALNAME,"Joe",CALURL) end
    to
    if CALURL then self:setVariable(CALNAME,CALURL) end

    You beat me with 30s :-) 

    • Like 1
    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
    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...