Aller au contenu

stef1234

Membres confirmés
  • Compteur de contenus

    1
  • Inscription

  • Dernière visite

Réputation sur la communauté

0 Neutral

À propos de stef1234

  • Rang
    Nouveau

Profile Information

  • Sexe :
    Homme
  • Ville :
    nuenen
  • Box
    Home Center 2
  • Version
    4

Visiteurs récents du profil

278 visualisations du profil
  1. Hi

     

    Can you make something like in the old app HC2 to stream a content to my Sonos in HC3

     

    Greetz Stef

     

    STREAM: Pour utiliser la lecture de Stream depuis une scène ou un périphérique virtuel il faut exécuter le code LUA suivant avec les bons paramètres.

    -- 408 is the Virtual Device ID
    -- 28 is the Process button ID
    local sid, bid = 408, 28
    -- Create STREAM params object
    local params = {
      -- stream: the file / uri
      stream = "//s3.amazonaws.com/smartapp-media/sonos/bell1.mp3",
      -- source: "local" or "http", "local" is setted by default
      source = "http",
      -- duration: play duration in seconds (option) or "auto"
      duration = 8,
      -- volume: the volume for playing the stream
      volume = 10
    }
    local _f = fibaro
    local _x ={root="x_sonos_object",load=function(b)local c=_f:getGlobalValue(b.root)if string.len(c)>0 then local d=json.decode(c)if d and type(d)=="table"then return d else _f:debug("Unable to process data, check variable")end else _f:debug("No data found!")end end,set=function(b,e,d)local f=b:load()if f[e]then for g,h in pairs(d)do f[e][g]=h end else f[e]=d end;_f:setGlobal(b.root,json.encode(f))end,get=function(b,e)local f=b:load()if f and type(f)=="table"then for g,h in pairs(f)do if tostring(g)==tostring(e or"")then return h end end end;return nil end}
    -- Make a request to the remote to process params object instantly
    _x:set(tostring(sid), { stream = params })
    _f:call(sid, "pressButton", bid)
  2. stef1234

    New Op Dit Forum

    Hi ben leek fibaro
×