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

1 hour ago, 10der said:

idk again

fibaro.call(
    fibaro.getDevicesID({name = "Sonos Hub"})[1],
    "addToQueue",
    "192.168.1.70",
    { "//192.168.1.29/Multimedia/Music/female-opening-mail.mp3" }
)

 

Please login or register to see this attachment.

 

Please login or register to see this link.

 

 

 

 

 

@Rover may (guess) you are caling from SCENE. encode params for calling 

Yes, I am calling from scene, unpacked IPnumber did not change the result:

fibaro.call(212, "addToQueue", "192.168.1.19",

{"//192.168.1.3/d/SonosGeluiden/Deurbel.mp3",

"//192.168.1.3/d/SonosGeluiden/Deurbel.mp3"})

fibaro.call(212, "play", "192.168.1.19") 

Please login or register to see this spoiler.

 

Link to comment
Share on other sites

@jgab Jan can you point @Rover to topic where you describe a diff with calling QA from another QA and scene and how should encode (json encode) params

 

thnx

Link to comment
Share on other sites

1 hour ago, 10der said:

@jgab Jan can you point @Rover to topic where you describe a diff with calling QA from another QA and scene and how should encode (json encode) params

 

thnx

So, now json encoded and no handleJsonRpc errors anymore, but still no positive result:

Please login or register to see this spoiler.

Please help me @10der by telling me what is wrong and how to do it right ?

Link to comment
Share on other sites

@Rover

no magic

i do not know

just

 

Please login or register to see this image.

/monthly_2020_11/image.png.fbf5943aef1c3a6dfd55445c936e2904.png" />

 

run

 

Please login or register to see this attachment.

 

 

Please login or register to see this attachment.

 

and I can hear sound

Please login or register to see this attachment.

if queue is NOT empty

file added at the top

and play command can ignore this file if "locator" was on another line.

Edited by 10der
Link to comment
Share on other sites

4 hours ago, 10der said:

@Rover

no magic

i do not know

just

 

Please login or register to see this link.

 

run

 

Please login or register to see this attachment.

 

 

Please login or register to see this attachment.

 

and I can hear sound

Please login or register to see this attachment.

Please login or register to see this spoiler.

How can it be that I have exactly the same onAction lines as yours (in your picture) but followed by an error?

It must be possible for you to see the origin of the error in your code? I myself am not clever enough to see that. So please have a look.

Link to comment
Share on other sites

@Rover you never provide additionla information about issue.

no ingo what playing now or silibe what in in QUEUE or empty etc etc so on so on so on 

 

I do not want to try to find a black cat in the darkroom.... more than - if as fact no cat in the room at all.

Link to comment
Share on other sites

On 11/14/2020 at 10:19 AM, ChristianSogaard said:

For 1.11

Thank you for adding these features ?

"Double Click" to 100% af after dim down ?  works

 dim2off = true - i think it kicks in too fast, if dimtime = 10. if i press Hold for 2-3 sec starting from 100%, its ends up turning off the bulb

dim2off = false - , if dimtime = 10 i can stop after 8-9 sec, and can still dimm a little in second time I press Hold.

Hi Jgab - any thoughts ? for the one button support? and the dim2off = True - where if dimtime = 10. if i press Hold for 2-3 sec starting from 100%, its ends up turning off the bulb. I really like this feature.

 

and ... one more thing.

I'm using the light in the Matrix.

Could you add support for this in CoH? or would it be easier to Integrate with ER4?

 

ChildrenOfHue
Condition
•    HUE Bulb is OFF
•    Matrix switch - TurnON HUE Bulb
Action -- Turn Green for 3 Sec
•    local colPlay = {r="0", g="127",b="0",w="0"}
•    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);    
after 3 seconds
•    local colNormal = {r="2", g="2",b="2",w="0"}
•    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);

 

Condition
•    Matrix switch - TurnOFF HUE
Action -- Turn RED for 3 Sec
•    local colStop = {r="127", g="0",b="0",w="0"}
•    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);    
after 3 seconds
•    local colNormal = {r="2", g="2",b="2",w="0"}
•    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);

Link to comment
Share on other sites

Hi @Rover,

 

On 11/14/2020 at 3:16 PM, Rover said:

I used earlier your nice QA SonosPlayer, but then came SonosHub with a huge advantage: Saving the volume of the interrupted Sonos play and  after playing the SonosHub sound restoring the original play with the original volume! This was the big omission in Krikroffs HC2 Sonos VD.

 

I think you are using the wrong version ;)

 

On 11/14/2020 at 3:16 PM, Rover said:

The newest Sonos HC3 QA of  Krikroff has this same advantage as SonosHub but is unusable because it blows up the HC3 CPU load till near 100%.

 

I am very surprised, my HC3 under pressure with four QA sonos at the same time :)

 

Please login or register to see this attachment.

 

 

Link to comment
Share on other sites

  • Topic Author
  • 57 minutes ago, ChristianSogaard said:

    Hi Jgab - any thoughts ? for the one button support? and the dim2off = True - where if dimtime = 10. if i press Hold for 2-3 sec starting from 100%, its ends up turning off the bulb. I really like this feature.

     

    and ... one more thing.

    I'm using the light in the Matrix.

    Could you add support for this in CoH? or would it be easier to Integrate with ER4?

     

    ChildrenOfHue
    Condition
    •    HUE Bulb is OFF
    •    Matrix switch - TurnON HUE Bulb
    Action -- Turn Green for 3 Sec
    •    local colPlay = {r="0", g="127",b="0",w="0"}
    •    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);    
    after 3 seconds
    •    local colNormal = {r="2", g="2",b="2",w="0"}
    •    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);

     

    Condition
    •    Matrix switch - TurnOFF HUE
    Action -- Turn RED for 3 Sec
    •    local colStop = {r="127", g="0",b="0",w="0"}
    •    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);    
    after 3 seconds
    •    local colNormal = {r="2", g="2",b="2",w="0"}
    •    fibaro.call(bId,"setColor",col.r,col.g,col.b,col.w);

     

    The ChildrenOfHue QA only control Hue lights. It has no idea if it is a fibaro dimmer switch, a Matrix, or a keyFob or another QA controlling it. ... and it shouldn't have such a dependency.

     

    If you want to update the colors of the Matrix when you click on buttons you could add it to the scene we worked on, so besides sending commands to the Hue it will also send color commands to the Matrix.

     

    ...or you do a Matrix QA that is a "front" for the z-wave Matrix device (actually,  many devices as they appear in the HC3), and supports mapping of keys to various commands and includes options to switch colors on the Matrix buttons depending on commands. If was thinking about doing something like this myself but haven't had the time or motivation yet.

    Link to comment
    Share on other sites

    1 hour ago, Krikroff said:

    Hi @Rover,

     

     

    I think you are using the wrong version ;)

     

     

    I am very surprised, my HC3 under pressure with four QA sonos at the same time :)

     

    Please login or register to see this attachment.

     

     

    Dear Krikroff,

    I like your amazing implementation of QA_Sonos_ZC_1.3.1_RC. But the CPU load is hugh!! I wished it was not true.

    At the picture beneath you can see at the right site the effect of deleting the QA.

    Please login or register to see this spoiler.

    12:55 installed without the IP of Sonos speaker.

    12:56 und further: with the IP of Sonos speaker.

    Edited by Rover
    Link to comment
    Share on other sites

    1 hour ago, Rover said:

    Dear Krikroff,

    I like your amazing implementation of QA_Sonos_ZC_1.3.1_RC. But the CPU load is hugh!! I wished it was not true.

    At the picture beneath you can see at the right at 12:50 the effect of deleting the QA.

    Please login or register to see this spoiler.

     

     

    @Krikroff,

    Running from HC3 test scene:

    fibaro.call(215, "playFile", "Mediacenter/d/SonosGeluiden/Deurbel.mp3", true, 40)  works!

    But,

    fibaro.call(215, "addURIToQueue", "Mediacenter/d/SonosGeluiden/Deurbel.mp3")

    fibaro.call(215, "addURIToQueue", "Mediacenter/d/SonosGeluiden/Deurbel.mp3")

    fibaro.call(215, "startQueue")

    delivers no sound, why?

    Edited by Rover
    Link to comment
    Share on other sites

    2 hours ago, jgab said:

     

    The ChildrenOfHue QA only control Hue lights. It has no idea if it is a fibaro dimmer switch, a Matrix, or a keyFob or another QA controlling it. ... and it shouldn't have such a dependency.

     

    If you want to update the colors of the Matrix when you click on buttons you could add it to the scene we worked on, so besides sending commands to the Hue it will also send color commands to the Matrix.

     

    ...or you do a Matrix QA that is a "front" for the z-wave Matrix device (actually,  many devices as they appear in the HC3), and supports mapping of keys to various commands and includes options to switch colors on the Matrix buttons depending on commands. If was thinking about doing something like this myself but haven't had the time or motivation yet.

    I love that Children of Hue is independent – so that all systems, buttons, keys and QA can use it.

    I see this feature is independent also, it’s not for Matrix or keyFob specific.

    I was thinking of an extra function – StartDimmLevel that could be the entry point in situations when you want to control you Bulb from an one button system
    In this situation StartDimmLevel is calling startLevelDecrease or startLevelIncrease depending on the DimmDirection attribute that should be unique on each Bulb - or just change the direction when over half way.
    In my opinion, it makes the system more flexible, but you are the expert.

     

    i was thinking of something like this for the easy solution - HueDevice is unique per bulb right? - else it would be a problem when two people it dimming at the same time.
     

    Please login or register to see this code.

     

    Edited by ChristianSogaard
    Link to comment
    Share on other sites

  • Topic Author
  • It needs to stop dimming also. This variation would switch between up - stop - down - ... with every click.

    It can't be used from blocks scenes as they only support pre-defined actions. But from Lua scenes and other QAs it would work.

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    2 minutes ago, jgab said:

    It needs to stop dimming also. This variation would switch between up - stop - down - ... with every click.

    It can't be used from blocks scenes as they only support pre-defined actions. But from Lua scenes and other QAs it would work.

    Please login or register to see this code.

     

    ? - Yes this was my wish ... Christmas comes early this year. I will try when I get home ;-)

    Link to comment
    Share on other sites

  • Topic Author
  • 25 minutes ago, ChristianSogaard said:

    ? - Yes this was my wish ... Christmas comes early this year. I will try when I get home ;-)

    Well, I hadn't implemented it yet in the QA....

    but now I have :-) v1.12

    Link to comment
    Share on other sites

    5 minutes ago, jgab said:

    Well, I hadn't implemented it yet in the QA....

    but now I have :-) v1.12

    I know - but i could add the code myself ;-) but this is better

     

    So now the mapping in the Scene is 

            [2] = { 
          HeldDown={'StartDimmLevel'}, 
          Released={'stopLevelChange'}, 
       

    Edited by ChristianSogaard
    Link to comment
    Share on other sites

    2 hours ago, ChristianSogaard said:

    I know - but i could add the code myself ;-) but this is better

     

    So now the mapping in the Scene is 

            [2] = { 
          HeldDown={'StartDimmLevel'}, 
          Released={'stopLevelChange'}, 
       

    What Class should it be in?

    [WARNING] [QUICKAPP936]: Class does not have StartDimmLevel function defined - action ignored

    Edited by ChristianSogaard
    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, ChristianSogaard said:

    What Class should it be in?

    [WARNING] [QUICKAPP936]: Class does not have StartDimmLevel function defined - action ignored

    startDimmLevel

    lowercase s

    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    startDimmLevel

    lowercase s

    Is works :-) up - stop - down - ... with every click

    Is there a way not to have the STOP? - its pretty strange to Hold Press to do nothing before you can reverse the dimm direction? So its Up - down - up - down?

    Link to comment
    Share on other sites

  • Topic Author
  • The idea was to use only one button and not use 'Released' status.

    But we can have it both ways.

     

    v1.14 uploaded.

     

    The command is now toggleDim(bool)

     

    Ex. fibaro.call(ID,"toggleDim",false) toggles without explicit stop. You need to call stopLevelChange or let it dim all the way.

     

    Ex. fibaro.call(ID,"toggleDim",true) toggles with stop. One button to cycle between dim up -> stop > dim down -> stop -> etc.

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