Welcome to Domotique-fibaro

 

Inscrivez-vous maintenant pour accéder à toutes nos fonctionnalités. Une fois inscrit et connecté, vous serez en mesure de contribuer à ce site en soumettant votre propre contenu ou en répondant au contenu existant. Vous serez en mesure de personnaliser votre profil, de recevoir des points de réputation comme une récompense pour la soumission de contenu, tout en communiquant avec d'autres membres via votre boîte de réception privée, et bien plus encore! Ce message sera supprimé une fois que vous vous êtes connecté.

 

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

drboss

Membres confirmés
  • Compteur de contenus

    27
  • Inscription

  • Dernière visite

Réputation sur la communauté

10 Good

À propos de drboss

  • Rang
    Nouveau

Profile Information

  • Sexe :
    Homme
  • Ville :
    Varsovie
  • Box
    Home Center 2
    Home Center Lite
    Autre
  • Version
    4.111b

Visiteurs récents du profil

94 visualisations du profil
  1. Tuto HC2

    Chez moi, après l'utilisation de le patch @Titof_44 et l'exécution de la commande httpClient:request("http://127.0.0.1:11111/api/sceneControl?id="..id.."&action=start") la commande fibaro:debug(fibaro:countScenes(id)) retourne 0, mais la scène fonctionne correctement. Bien sûr, Watchdog avec "0" redémarre la scène tout le temps Si la scène arrêté et redemarre par slide bouton fibaro:countScenes(id) returne bien 1 Pourquoi???
  2. Tuto HC2 et HCL

    Merci @Krikroff
  3. To play any album from Spotify (of corse spotify account exist on Sonos) I use this code, the id of album I take by spotify app for window (left mouse button on album image and from menu "copy id URI Spotify", take only the string after second ':') allbum ="ID URI SPOTIFY" ..//.. clear_last_que = function() -- without this album is added after play song/query return sendSoapMessage( -- control url "/MediaRenderer/Queue/Control", -- service type "urn:schemas-sonos-com:service:Queue:1", -- action { name = "RemoveAllTracks", service = "urn:schemas-sonos-com:service:Queue:1" }, -- soap body data (options) "<QueueID>0</QueueID>,<UpdateID>0</UpdateID>", -- callback (options) function(response) fibaro:debug("Remove"); end); end que_spotify_album = function() --album from Spotify return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "AddURIToQueue", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID>,<EnqueuedURI>x-rincon-cpcontainer:1004206cspotify%3aalbum%3a"..album.."</EnqueuedURI>,<EnqueuedURIMetaData>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;1004206cspotify%3aalbum%3a"..album.."&quot; parentID=&quot;100d2064your_albums&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;Remote&lt;/dc:title&gt;&lt;upnp:class&gt;object.container.album.musicAlbum&lt;/upnp:class&gt;&lt;desc id=&quot;cdudn&quot; nameSpace=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;SA_RINCON2311_X_#Svc2311-0-Token&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</EnqueuedURIMetaData>,<DesiredFirstTrackNumberEnqueued>2</DesiredFirstTrackNumberEnqueued>,<EnqueueAsNext>1</EnqueueAsNext>", -- callback (options) function(response) fibaro:debug("que"); end); end ..//.. clear_last_que() que_spotify_album(); playFile(FileVol);
  4. @Krikroff Sorry but this time I ask in english Is there a simple command to call the defined playlist? Eg. by replacing cmd in radio5 button I didn't fine solution on forum, maybe exist ... And I doing it (today night my children with wife going to my parents and I have time). Play by VD of playlist work. I use old (2014) LUA script of @Krikroff (I things). In this time without retrieve of playlist name. Only work by id of playlist, Please if wont test it on yours Sonos systems. My work is not big, the code is by @KrikroffI only do the small adaptation and add command of Sonos for play list. The version is not optimized and very professional because I doing it fast for me. I will use it for button and scene of sauna controller ;-) -- SONOS Play playlist, v.0.1 ------------------------------------------------------------------------------------------- ---made on source of:----------------------------------------------------------------------- -- SONOS Play stream... -- Copyright © 2014 Jean-Christophe Vermandé ------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------- ---------------------------------- -- User Settings ---------------------------------- ip = "192.168.1.232" port = 1400 FileVol = 10 PlayUnlimited = "Yes" -- si <> Yes, arrêt après 30s environ --duration = ---------------------------------- -- DO not change bellow this line ---------------------------------- selfId = fibaro:getSelfId(); --ip = fibaro:get(selfId, 'IPAddress'); --port = fibaro:get(selfId, 'TCPPort') or 1400; currentTransportState = ""; lastTransportState = ""; currentVolume = 0; lastVolume = 0; ttsVolumeIsDifferent = false; list_name = "Sonos Playlist n1" --not implemented list_nbr = 1 -- playlist number on jffs system of SONOS, You need test it for find interesting list uid = "RINCON_B8E937B01D4E01400" -- find by http://SONOS_IP:1400/status/upnp urlencode = function(str) if (str) then str = string.gsub (str, "\n", "\r\n"); str = string.gsub (str, "([^%w ])", function (c) return string.format ("%%%02X", string.byte(c)) end); str = string.gsub (str, " ", "+"); end return str; end createRequestBody = function(action, schema, data) return string.format("<u:%s xmlns:u=\"%s\">%s</u:%s>", action, schema, data, action); end reponseCallback = function(fnc, args) if (fnc == nil) then return nil; end return fnc(args); end createSocket = function() -- Check IP and PORT before if (ip == nil or port == nil) then fibaro:debug("You must configure IPAddress and TCPPort first"); return; end local socket; local status, err = pcall(function() socket = Net.FTcpSocket(ip, port); socket:setReadTimeout(1000); end); if (status ~= nil and status ~= true) then fibaro:debug("socket status: " .. tostring(status or '')); end if (err ~= nil) then fibaro:debug("socket err: " .. tostring(err or '')); return; end return socket; end disposeSocket = function(socket) if (socket ~= nil) then socket:disconnect(); socket = nil; return true; end return false; end sendSoapMessage = function(url, service, action, args, callback, retry) local socket = createSocket(); if (socket == nil) then return; end retry = retry or 0 -- prepare data local url = "POST " .. url .. " HTTP/1.1"; --local udn = "X-SONOS-TARGET-UDN: uuid:RINCON_B8E937B01D4E01400" -- udn of my SONOS (not need) local soapaction = "SOAPACTION: \"" .. service .. "#" .. action.name .. "\""; local body = createRequestBody(action.name, action.service, tostring(args or "")); local envelope = "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body>" .. body .. "</s:Body></s:Envelope>"; local ctl = "Content-Length: " .. string.len(envelope); --local payload = url .. "\r\n" .. ctl .. "\r\n" .. udn .. "\r\n" .. soapaction .. "\r\n" .. "\r\n" .. envelope; -- with UDN local payload = url .. "\r\n" .. ctl .. "\r\n" .. soapaction .. "\r\n" .. "\r\n" .. envelope; -- write data local bytes, errorcode = socket:write(payload); if (errorcode == 0) then local state, errorcode = socket:read(); if (errorcode == 0) then if (string.len(state or "") > 0) then -- callback if (callback ~= nil) then reponseCallback(callback, state); end -- dispose ... disposeSocket(socket); return true; else fibaro:debug("Error: Invalid response. response length: " .. string.len(state or "")); end else if (retry < 5) then fibaro:debug("retry #"..retry.." action: " .. action.name); return sendSoapMessage(url, service, action, args, callback, (retry + 1)); else fibaro:debug("Error: Code returned "..tostring(errorcode or "")); end end elseif (errorcode == 2) then fibaro:debug("Error: You must check your IP and PORT settings."); else if (retry < 5) then fibaro:debug("retry #"..retry.." action: " .. action.name); return sendSoapMessage(url, service, action, args, callback, (retry + 1)); else fibaro:debug("Error: Code returned "..tostring(errorcode or "")); end end -- dispose ... disposeSocket(socket); -- default response return false; end stop = function() return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "Stop", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID><Speed>1</Speed>", -- callback (options) function(response) fibaro:debug("stop sent"); end); end unMute = function() return sendSoapMessage( -- control url "/MediaRenderer/RenderingControl/Control", -- service type "urn:schemas-upnp-org:service:RenderingControl:1", -- action { name = "SetMute", service = "urn:schemas-upnp-org:service:RenderingControl:1" }, -- soap body data (options) "<InstanceID>0</InstanceID><Channel>Master</Channel><DesiredMute>0</DesiredMute>", -- callback (options) function(response) fibaro:debug("unMute sent"); end); end play = function(duration) return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "Play", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID><Speed>1</Speed>", -- callback (options) function(response) if (duration ~= nil) then fibaro:debug("play sent for " .. duration .. " seconds"); fibaro:sleep(duration); stop(); else fibaro:debug("play sent"); local n = 0; currentTransportState = "TRANSITIONING"; while (currentTransportState == "TRANSITIONING") do if (n > 10) then break end; getTransportState(); fibaro:debug(currentTransportState); fibaro:sleep(5000); n = n + 1; end local i = 0; currentTransportState = "PLAYING"; while (currentTransportState == "PLAYING") do if (i > 10 and PlayUnlimited ~= "Yes") then break end; getTransportState(); fibaro:debug(currentTransportState); fibaro:sleep(2000); i = i + 1; end fibaro:sleep(1000); stop(); end -- update volume with value before tts if different if (ttsVolumeIsDifferent == true) then setVolume(lastVolume); ttsVolumeIsDifferent = false; end end); end sseek = function() return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "Seek", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID>,<Unit>TRACK_NR</Unit>,<Target>1</Target>", -- callback (options) function(response) fibaro:debug("Seek"); end); end que = function() return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "AddURIToQueue", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID>,<EnqueuedURI>file:///jffs/settings/savedqueues.rsq#".. list_nbr.."</EnqueuedURI>,<EnqueuedURIMetaData>&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;SQ:1&quot; parentID=&quot;SQ:&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;".. list_name .."&lt;/dc:title&gt;&lt;upnp:class&gt;object.container.playlistContainer&lt;/upnp:class&gt;&lt;desc id=&quot;cdudn&quot; nameSpace=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;RINCON_AssociatedZPUDN&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;</EnqueuedURIMetaData>,<DesiredFirstTrackNumberEnqueued>1</DesiredFirstTrackNumberEnqueued>,<EnqueueAsNext>1</EnqueueAsNext>", -- callback (options) function(response) fibaro:debug("que"); end); end setVolume = function(value) return sendSoapMessage( -- control url "/MediaRenderer/RenderingControl/Control", -- service type "urn:schemas-upnp-org:service:RenderingControl:1", -- action { name = "SetVolume", service = "urn:schemas-upnp-org:service:RenderingControl:1" }, -- soap body data (options) "<InstanceID>0</InstanceID><Channel>Master</Channel><DesiredVolume>" .. tostring(value) .. "</DesiredVolume>", -- callback (options) function(response) fibaro:debug("Volume set: " .. value); end); end getVolume = function() fibaro:log("Get volume, please wait..."); return sendSoapMessage( -- control url "/MediaRenderer/RenderingControl/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "GetVolume", service = "urn:schemas-upnp-org:service:RenderingControl:1" }, -- soap body data (options) "<InstanceID>0</InstanceID><Channel>Master</Channel>", -- callback (options) function(response) currentVolume = tonumber(response:match("<CurrentVolume>(.+)</CurrentVolume>") or 0); end); end getTransportState = function() return sendSoapMessage( -- control url "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "GetTransportInfo", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID>", -- callback (options) function(response) currentTransportState = response:match("<CurrentTransportState>(.+)</CurrentTransportState>") or ""; end); end playFile= function(volume) return sendSoapMessage( -- control url SOAPACTION: "urn:schemas-upnp-org:service:AVTransport:1#SetAVTransportURI" "/MediaRenderer/AVTransport/Control", -- service type "urn:schemas-upnp-org:service:AVTransport:1", -- action { name = "SetAVTransportURI", service = "urn:schemas-upnp-org:service:AVTransport:1" }, -- soap body data (options) "<InstanceID>0</InstanceID>,<CurrentURI>x-rincon-queue:"..uid.."#0</CurrentURI>,<CurrentURIMetaData></CurrentURIMetaData>", -- zestawienie playlist -- control url --"/MediaServer/ContentDirectory/Control", -- service type --"urn:schemas-upnp-org:service:ContentDirectory:1", -- action --{ name = "Browse", service = "urn:schemas-upnp-org:service:ContentDirectory:1" }, -- soap body data (options) --"<ObjectID>Q:0</ObjectID>,<BrowseFlag>BrowseDirectChildren</BrowseFlag>,<Filter>dc:title,res,dc:creator,upnp:artist,upnp:album,upnp:albumArtURI</Filter>,<StartingIndex>0</StartingIndex>,<RequestedCount>100</RequestedCount>,<SortCriteria></SortCriteria></u:Browse>", -- callback (options) function(response) -- retrieve current transport state getTransportState(); lastTransportState = currentTransportState; -- unmute before unMute(); -- retrieve volume getVolume(); lastVolume = currentVolume; -- set tts volume if <> with current if (volume ~= nil and volume ~= currentVolume) then setVolume(volume); ttsVolumeIsDifferent = true; end sseek(); play(); end); end -- en paramètres: le fichier, puis le volume... que(); playFile(FileVol);
  5. After many test i find that this is problem in LUA interpreter in HC2, when error or information about null data is send in html not classical json data. The Fibaro support confirmed my observation (13.02) and informed that add the patch to one of next system release. (not 4.111 because list of patch for this version is closed) The problem internal ticket number in Fibaro is SFS-340 In this moment I use watchdog for the scene with this problems with delayed restart. Sorry I write answer in English because from phone for me is faster.
  6. I have the same problem when I have more that 30 noreading/delated message in status bar of phone. Reboot phone or delete message Wysłane z mojego EVA-L09 przy użyciu Tapatalka
  7. Same line all the time I'm in b trip for two week without stable access to my HC2. When it's possible I will write in my next post line (commad) with and without double PuSH. Wysłane z mojego EVA-L09 przy użyciu Tapatalka
  8. @pepite , new GEA Scene with old config lines - the same result. Some of GEA.add commands generate double push, not all ex. GEA.add (717, 30*60, "Odłączone media na czas wyjazdu", {{"turnOn",336}}) GEA.add (717, -1, "Podłączono media po wyjazdzie", {{"Inverse"},{"turnOff",336}}) work fine
  9. @pepite, 1. no double line (gea.add command), only one entry in the debug for command and push 2. this applies only to the PUSH command - text in ".." , the right command {turn ON, Off etc} is executed once. 3. with not all gea.add command generate double PUSH 4. today I will run a new copy of the GEA and the old will stop... and see You tomorrow ;-)
  10. J'ai un problème de quelques jours, je changeai rien dans mon GEA, mais le supportvérifiais pourquoi HC2 se bloque. depuis ce temps, une partie du message PUSH je reçois deux fois (pas toutes) ex.: commande GEA: GEA.add({"Alarm", 536}, 1, "Tryb nocny aktywacja", {{"Global", "czy_dzien", "nie"}}) debug (l'image ajoutée) Le message sur le portable: 21:00 PUSH (HC2-xxxxxx) Tryb nocny aktywacja 20:59 PUSH (HC2-xxxxxx) Tryb nocny aktywacja Je même pour (deux identiques message): GEA.add({"Property!", 819, "state", "Closed"}, 30*60, "Garaż otwarty od #duration# minut, #time#", {{"Repeat"},{"Label", 45, "Message", "Garaż otwarty od #duration# minut"}, {"VirtualDevice", 45,1}}) 18:12 PUSH (HC2-xxxxxx) Garaż otwarty od 1h 30m minut, 18:12:46 18:12 PUSH (HC2-xxxxxx) Garaż otwarty od 1h 30m minut, 18:12:38 Bien sûr, travailler un GEA
  11. ça marche! mon problème est "ui.Label1.value" au lieu de "Label1" Avec la version 4.100 marche, et à partir de 4.104 non. Je l'ai testé deux HC 4.100 et 4.104 Merci @pepite pour ton aide
  12. @pepite Oui, aucun problème, maintenant fonctionne uniquement {"VirtualDevice", 45,1} , mais {"Label", 45, "ui.Message.value", "Port over depuis #duration# min."} non. Mais dans le debug tout est ok. Le seul problème est avec le commande {"Label".... 702 - détecteur de la porte
  13. Depuis semaine GEA a arrêté traiter la commande Valeur: GEA.add(702, 1*60, "Port over depuis #duration# min., #time#", {{"Repeat"}, {"Label", 45, "ui.Message.value", "Port over depuis #duration# min."},{"VirtualDevice", 45,1}}) Le virtual device 45 est SONON Say IT GEA.add(702, 1*60, "Port over depuis #duration# min., #time#", {{"Repeat"}, {"Label", 799, "ui.Label1.value", "Port over depuis #duration# min."}}) Le virtual device 799 est test device avec seulement Label1 La commande GEA chez moi ne fonctionne pas, mais d'un autre VD par fibaro:appel (45 "setProperty", "ui.Message.value", "test") marche bien.
  14. Pour les produits (commutateurs) Qubino je obtenu la réponse du support fibaro (officiellement par email, mais bien sûr en polonais, donc je ne cite pas) - en bref "Nous n'améliorer Qubino fonctionnant en HC"
  15. Je vois ce répertoire, mais pas mon HC2, parce qu'ils ne indique pas la mise à jour 4.106