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:

 

dear Rover this issue I can't fix. This issues sometimes occured also for me.

only reboot (Noooooooooooooooo) :D can solve this issue.

do not change anything just reboot.

another way (lol also) just copy / paste all code from my QA to a new one.

crazy? yes.

 

 

@petergebruers check this :) Ha ha? no. it's no ha ha :(

Hi @10der,

Firstly congratulations with your 3000th post to this forum ?

 

I had rebooted HC3 and then run the SonosHub scene again:

Please login or register to see this spoiler.

 

Link to comment
Share on other sites

17 minutes ago, tinman said:

 

ehm honestly, there is one thing i really hate: bad (or crashing) code and statement "can't fix, it's software, do reboot". If you know there is issue with your code, fix it or remove it or add warrning to the posting/place where the code is located/into the updated code. Just respect users, installers and support - crashing code (without any information about know bug) produce tons of frustrating support/debug hours, for everybody. It's not against you, it's against "i don't care, my crashing code must be Fibaro fault"

 

 

not it's not, if part of the code produce kind of memory leak, overflow, process kill, only reboot will help.

 

Hi @tinman,

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.

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

Link to comment
Share on other sites

@tinman, with all due respect to your

I have test QA with 4  (lines of code)

 

Please login or register to see this image.

/monthly_2020_11/image.png.fb68c439fdcb249b00c9507be1c3bee8.png" />

 

 

Please login or register to see this attachment.

 

 

and sometimes I can see

image.png.8b1daba5ad807bbb66d892513cf526fe.png

 

Are you really thinking what I am stuped?

 

 

Rover, can you put here original command to Sonos Hub.

Ill test it also 

@Rover

btw

image.png.748709fd43d11b32e33d638043f030fb.png

Link to comment
Share on other sites

5 minutes ago, 10der said:

@tinman, with all due respect to your

I have test QA with 4  (lines of code)

 

Please login or register to see this link.

 

 

Please login or register to see this attachment.

 

 

and sometimes I can see

Please login or register to see this link.

 

Are you really thinking what I am stuped?

 

 

Rover, can you put here original command to Sonos Hub.

Ill test it also 

@Rover

The only line in the testscene: fibaro.call(125, "playFromCIFS", "192.168.1.19", "Mediacenter/d/SonosGeluiden/Deurbel.mp3", 40) 

Link to comment
Share on other sites

12 minutes ago, 10der said:

@tinman, with all due respect to your

I have test QA with 4  (lines of code)

 

Please login or register to see this link.

 

 

Please login or register to see this attachment.

 

 

and sometimes I can see

Please login or register to see this link.

 

Are you really thinking what I am stuped?

 

 

Rover, can you put here original command to Sonos Hub.

Ill test it also 

@Rover

btw

Please login or register to see this link.

My iPhone updates automatically all apps. Actual version Sonos app is version 12.2.1

Link to comment
Share on other sites

@Roveryou wrong

my latest QA doesnot have this command

 

and 

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

 

works like a charm

 

here is my lates QA

Please login or register to see this attachment.

 

 

 

 

Link to comment
Share on other sites

2 minutes ago, 10der said:

@Roveryou wrong

my latest QA doesnot have this command

 

and 

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

 

works like a charm

 

here is my lates QA

Please login or register to see this attachment.

 

 

 

 

Do you mean that "playFromCIFS" is not working anymore?

Link to comment
Share on other sites

10 minutes ago, Rover said:

12.2.1

Hmm

 

Please login or register to see this image.

/monthly_2020_11/image.png.4360a3d2d2dea545147deecc1aac0f8c.png" />

 

 

1 minute ago, Rover said:

Do you mean that "playFromCIFS" is not working anymore?

I mean what cuz I violeted some rights of some user on this forum I should

1) re-write my QA from the scratch

2) re-name all commans in my QA

 

 

Link to comment
Share on other sites

so. here is some commands from my qa

 

function QuickApp:play(ipaddr)
function QuickApp:pause(ipaddr)
function QuickApp:stop(ipaddr)
function QuickApp:next(ipaddr)
function QuickApp:prev(ipaddr)
function QuickApp:setVolume(ipaddr, volume)
function QuickApp:setMute(ipaddr, mute)
 
ex
 fibaro.call(1987, "pause", "192.168.1.70")
 fibaro.call(1987, "play", "192.168.1.70")
 
extended commands
function QuickApp:playNotification(ipaddr, uri, volume) 
function QuickApp:clearQueue(ipaddr) 
function QuickApp:addToQueue(ipaddr, uris) 
function QuickApp:save(ipaddr) 
function QuickApp:restore(ipaddr) 
 
ex
fibaro.call(1987, "playNotification", "192.168.1.70", "//192.168.1.29/Multimedia/Music/female-opening-mail.mp3") 
fibaro.call(1987, "cleareQueue", "192.168.1.70") 
fibaro.call(1987, "addToQueue", "192.168.1.70",  {
             "//192.168.1.29/Multimedia/Music/!NEW/Squazoid - Voyage Across (The Remixes) - 2020/06. Squazoid - Sacred Mantra (Kuba Remix).mp3",
             "//192.168.1.29/Multimedia/Music/female-opening-mail.mp3",
             "//192.168.1.29/Multimedia/Music/Ding.mp3",
             "http://192.168.1.29/Ding.mp3"
         }
    )
 
    fibaro.call(1987, "save", "192.168.1.70")
    fibaro.call(1987, "restore", "192.168.1.70")
 
Link to comment
Share on other sites

25 minutes ago, 10der said:

so. here is some commands from my qa

 

function QuickApp:play(ipaddr)
function QuickApp:pause(ipaddr)
function QuickApp:stop(ipaddr)
function QuickApp:next(ipaddr)
function QuickApp:prev(ipaddr)
function QuickApp:setVolume(ipaddr, volume)
function QuickApp:setMute(ipaddr, mute)
 
ex
 fibaro.call(1987, "pause", "192.168.1.70")
 fibaro.call(1987, "play", "192.168.1.70")
 
extended commands
function QuickApp:playNotification(ipaddr, uri, volume) 
function QuickApp:clearQueue(ipaddr) 
function QuickApp:addToQueue(ipaddr, uris) 
function QuickApp:save(ipaddr) 
function QuickApp:restore(ipaddr) 
 
ex
fibaro.call(1987, "playNotification", "192.168.1.70", "//192.168.1.29/Multimedia/Music/female-opening-mail.mp3") 
fibaro.call(1987, "cleareQueue", "192.168.1.70") 
fibaro.call(1987, "addToQueue", "192.168.1.70",  {
             "//192.168.1.29/Multimedia/Music/!NEW/Squazoid - Voyage Across (The Remixes) - 2020/06. Squazoid - Sacred Mantra (Kuba Remix).mp3",
             "//192.168.1.29/Multimedia/Music/female-opening-mail.mp3",
             "//192.168.1.29/Multimedia/Music/Ding.mp3",
             "http://192.168.1.29/Ding.mp3"
         }
    )
 
    fibaro.call(1987, "save", "192.168.1.70")
    fibaro.call(1987, "restore", "192.168.1.70")
 

TNX for the information, @10der ?

I am going to use this.

Especially the feature of filling and clearing a sort of playlist (Queue) offers a lot of possibilities.

What are the functional or other changes from the initial SonosHub?

Link to comment
Share on other sites

1 minute ago, Rover said:

Especially the feature of filling and clearing a sort of playlist (Queue) offers a lot of possibilities.

What are the functional or other changes from the initial SonosHub?

that's all list of the commands.

rewitten was core. cuz initial version was based on code by TinMan what is not right as for me. And I am really sorry for this, TinMan. 

Link to comment
Share on other sites

1 hour ago, 10der said:

@tinman, with all due respect to your

 

no worries, i was (more than) twice married\divorced, so one can call my ass*** and i really don't mind

 

1 hour ago, 10der said:

I have test QA with 4  (lines of code)

...

and sometimes I can see

..

 

oh well, one can write perfectly QA with only one line and wonder why HC3 is "broken" after one clicked on save button ^.^

 

Please login or register to see this code.

 

 

1 hour ago, 10der said:

@tinman, with all due respect to your

I have test QA with 4  (lines of code)

...

and sometimes I can see

..

 

If this would be new empty QA, without button, label, or any other copy/paste action, on a empty HC3, i would say "we have general problem", but i know this is not the case.

 

If this would be new empty QA, without button, label, or any other copy/paste action, on your HC3, i would say "it might be caused as well by other crashing QA/scenes, illegal API calls, missing code cleaups", and then this simple 3 lines QA is restarting (with). Now you have 3 (init) lines, button and label ... label with strange characters should be not a problem (huge chance for "not issue"), button can be already filled with wrong call/callback (e.g. reserved names), the init code might have special characters ... so the QA is starting, crashing, and automatically restarting and crashing ... 

 

 

1 hour ago, 10der said:

Are you really thinking what I am stuped?

 

the majority of humans is stupid, so really does not matter what i think (and as i never met you, i can't judge about you, so no). 

 

But from your 3000 postings i can tell you following: think twice before you post, test on HC3 before you post, check your HC3 logs (and fix your errors first, before you test/publish), don't think you can develop everything better and Fibaro/others are idiots. Use less caps and exclamation marks.

  • Thanks 1
Link to comment
Share on other sites

18 hours ago, Rover said:

TNX for the information, @10der ?

I am going to use this.

Especially the feature of filling and clearing a sort of playlist (Queue) offers a lot of possibilities.

What are the functional or other changes from the initial SonosHub?

@10der SonosHub  playNotification does not work.

Please login or register to see this spoiler.

 

 

Edited by Rover
Link to comment
Share on other sites

1 hour ago, Rover said:

@10der SonosHub  playNotification does not work.

Please login or register to see this spoiler.

"//192.168.1.29/Multimedia/Music/female-opening-mail.mp3" - file for notification.

@Rover

Please login or register to see this link.

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, 10der said:

yes, cuz you thoughtless friend... 

// leading mean playing with network

also ypou can use other prefixes

 

-[[
x-rincon-stream:                Line In
x-sonos-htastream:              TV
x-file-cifs:                    Local Library
x-rincon-mp3radio:              Radio
x-sonosapi-stream:              Radio
aac:                            Radio
x-sonosapi-radio:               Radio
hls-radio:                      Radio
http:                           Track or Radio
https:                          Track or Radio
x-sonos-spotify:                Spotify
x-sonos-http:                   Google (music library or mix)
x-sonos-http:library            Amazon (my music)
x-sonosapi-hls-static:          Amazon (tracks and radio stations)
x-sonos-http:ondemand_track     Napster tracks
x-sonosprog-http:station_track  Napster stations
]]

"//192.168.1.29/Multimedia/Music/female-opening-mail.mp3" - file for notification.

@Rover

Please login or register to see this link.

Works! TNX @10der

  • Thanks 1
Link to comment
Share on other sites

@10der

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

produces:

Please login or register to see this spoiler.

What could wrong?

 

Edited by Rover
Link to comment
Share on other sites

@Roveridk

 

fibaro.call(
    fibaro.getDevicesID({name = "Sonos Hub"})[1],
    "pause",
    "192.168.1.70"
)
 
fibaro.call(
    fibaro.getDevicesID({name = "Sonos Hub"})[1],
    "play",
    "192.168.1.70"
)

 

 

Please login or register to see this attachment.

 

 

but question what was before in queue

 

Link to comment
Share on other sites

3 minutes ago, 10der said:

@Roveridk

 

fibaro.call(
    fibaro.getDevicesID({name = "Sonos Hub"})[1],
    "pause",
    "192.168.1.70"
)
 
fibaro.call(
    fibaro.getDevicesID({name = "Sonos Hub"})[1],
    "play",
    "192.168.1.70"
)

 

 

Please login or register to see this attachment.

 

 

but question what was before in queue

 

So if queue is empty, SonosHub is in error ?

Link to comment
Share on other sites

fibaro.call(212, "addToQueue", "192.168.1.19",{"//Mediacenter/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

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

/monthly_2020_11/image.png.aab40e4fde72129d99f07bac2d814347.png" />

 

 

 

 

 

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

Edited by 10der
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...