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

 

 

[violation of copyright]

sorry @Tinm

Edited by 10der
Link to comment
Share on other sites

@10der

 

Wow, that is what I expect it to do. 
 

Just to check if I have done the right things:

1. install the QuickApp

2. run a script with only: 

fibaro.call(473, "playFromCIFS", "192.168.1.230", "192.168.1.140/Fibaro/female-opening-mail.mp3")

 

(BTW I play internet radio via the Sonos app and run the scene)

 

Edited by SmartHomeEddy
Link to comment
Share on other sites

Hi,

 

If I paste in windows explorer   \\192.168.1.1\Schijf2\04-ServerDomotica\Test2.mp3 >>> it will play So the path and rights to open are okay.

 

Download Sonos Hub.fqa 
Save
Debug>>oninit
Scene 26 run

Song doest play


error below QA 148 is the Sonos Hub (I didt change anything)

 

Please advice how to solve?

//Sjakie

 

Please login or register to see this attachment.

Link to comment
Share on other sites

On 10/4/2020 at 6:30 PM, 10der said:

@SmartHomeEddy can yoi check again?

Please login or register to see this attachment.

Hi @10der,

SonosHub works fabulous! Music plays - Sound interrupts - Music play further with own sound level ?

 

How to change icon of Sonos_Hub.fqa?

  • Thanks 1
Link to comment
Share on other sites

20 minutes ago, Rover said:

How to change icon of Sonos_Hub.fqa?

only "hack-able"

1) find any humidy sensor

2) upload a new icon

3) cancel - do not change standart himidy sensor icon

4) find  NEW icon ID (via html inspector)

5) set in my QA onInit line self:updateProperty("deviceIcon", 1041)

where 1041 is icon id what you upload

 

@A.Socha any plans when we can change and assign any icons for generic QA?

Link to comment
Share on other sites

@10der, yes thats my sonos.

Please login or register to see this image.

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

Link to comment
Share on other sites

33 minutes ago, Rover said:

SonosHub works fabulous! Music plays - Sound interrupts - Music play further with own sound level


do you play for example MP3’s or internet radio?

 

(with internet radio it doesn’t work, the sound plays, but internet radio doesn’t return. And if I push “play” the MP3 message plays, not the internet radio)

Link to comment
Share on other sites

[violation of copyright]

sorry @Tinm

Please login or register to see this attachment.

Edited by 10der
Link to comment
Share on other sites

Hi,

ok its one step closer by hearing sound.

Next error no permission?

With Windows explorer I can open the disk and play the file. Also with the line I posted earlier.

Must I fill in my credentials for the network acces somewhere?

Please advice,

//Sjakie

Link to comment
Share on other sites

3 hours ago, SmartHomeEddy said:


do you play for example MP3’s or internet radio?

 

(with internet radio it doesn’t work, the sound plays, but internet radio doesn’t return. And if I push “play” the MP3 message plays, not the internet radio)

With Subsonic on Windows 10 I stream music to Sonos, which can be interrupted by mp3 sounds (playFromCIFS) via 10der's Sonos_Hub.

Link to comment
Share on other sites

@10der Wooowww it is working!

Problem: 192.168.1.1 is not equal for Sonos as the name off the Nas.

Now its synchrome it works.

Playing music from music libary>>>insert your .mp3 >>> continuing playing earlier playing music

I noticed sometimes it will not continue to play again the earlier music.

it shows scene run but no sound from the file requested and Sonos waits for push on start.

//Sjakie

 

  • Thanks 1
Link to comment
Share on other sites

[violation of copyright]

sorry @Tinm

 

Edited by 10der
Link to comment
Share on other sites

W dniu 17.09.2020 o 07:41, jgab napisał:

 

You could try to change the http.request call in the HC2 scene script to use https and see if it works.

Please login or register to see this code.

 

Thank You very much. As usual, you helped to solved my problem :)

Link to comment
Share on other sites

I have a physical dimmer 2. Which I call 'parent'.
I made a quickapp to change this dimmer 2 in functionality. This QA I call 'child'.


If the 'child' changes now, I will of course update the 'parent' with its value.

Please login or register to see this code.

This goes fine, until a parent doesn't function/exist anymore.  (it's property dead == true).
Then updating this value (when the parent property dead == true), will slow down the whole system considerably.


What I've come up with, is to copy the parent property dead of his child (So its also vilible in the mobile app).

and if the child is dead, it does not try to update his parent. like:

Please login or register to see this code.

But this doesn't work. It looks like property 'dead' and 'deadReason' are readonly.
What am I doing wrong, or this is not possible, and will I have to use the parent property dead==true as condition in the 'if' statement.

Which, of course, is quite illogical.

- If the parent is dead, the child in the mobile App must also be dead...

- and why is there a dead property in the quickapp.

 

 

Link to comment
Share on other sites

  • Topic Author
  • 2 hours ago, NLWaard said:

    I have a physical dimmer 2. Which I call 'parent'.
    I made a quickapp to change this dimmer 2 in functionality. This QA I call 'child'.


    If the 'child' changes now, I will of course update the 'parent' with its value.

    Please login or register to see this code.

    This goes fine, until a parent doesn't function/exist anymore.  (it's property dead == true).
    Then updating this value (when the parent property dead == true), will slow down the whole system considerably.


    What I've come up with, is to copy the parent property dead of his child (So its also vilible in the mobile app).

    and if the child is dead, it does not try to update his parent. like:

    Please login or register to see this code.

    But this doesn't work. It looks like property 'dead' and 'deadReason' are readonly.
    What am I doing wrong, or this is not possible, and will I have to use the parent property dead==true as condition in the 'if' statement.

    Which, of course, is quite illogical.

    - If the parent is dead, the child in the mobile App must also be dead...

    - and why is there a dead property in the quickapp.

    A couple of things going on here.

    Childs can access their parent QA with self.parent after they exit __init.

    Parents can access their children with self.childDevices[<childID>]

     

    To update the dead property use

    self:updateProperty("dead",true)

    or

    self.parent:updateProperty("dead",true)

    or

    self.childDevices[childID]:updateProperty("dead",true)

     

    Dead is a boolean. so you shouldn't need to convert it.

     

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • 12 minutes ago, jgab said:

    A couple of things going on here.

    Childs can access their parent QA with self.parent after they exit __init.

    Parents can access their children with self.childDevices[<childID>]

     

    To update the dead property use

    self:updateProperty("dead",true)

    or

    self.parent:updateProperty("dead",true)

    or

    self.childDevices[childID]:updateProperty("dead",true)

     

    Dead is a boolean. so you shouldn't need to convert it.

     

     

    Seems like you need the big gun to set the dead property

    Please login or register to see this code.

     

    • Like 1
    Link to comment
    Share on other sites

    15 hours ago, jgab said:

     

    Seems like you need the big gun to set the dead property

    Please login or register to see this code.

     

    This big gun ? did the trick.

    However, I am surprised that the regular property update did not work.  
    Thank you very much again, for you'r provided solution.

    Please login or register to see this code.

    Edited by NLWaard
    Link to comment
    Share on other sites

    Sending the death notification to the quickapp which takes over the function of a physical device work well now.

    Now you see in the mobile app that a device has 'no connection'.

     

    With that notification, there is also a refresh button.

    Does anyone know how I can pick up the call from that QA  refresh (after I click on it) and send that call to the real physical switch?

     

    Please login or register to see this spoiler.

     

     

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