Aller au contenu
Krikroff

Fibaro Hc2 Vd Sonos Remote: Télécommande Pour Diffuseur Sonos

Recommended Posts

Il y a 21 heures, maximelecerf a dit :

Bonjour et merci pour cette réponse. Je migre progressivement de HC Lite vers HC2, donc je découvre la programmation LUA.

Est-ce qu'il faut que je fasse une scène pour lire la valeur du label (et l'envoyer vers une variable globale) ou bien dois-je modifier le programme du Virtual Device ?

Je préfère faire une scène indépendante que de modifier le programme du maître.,surtout si tu débute. 

Perso, je suis incapable de comprendre sa programmation, mais comme ça fonctionne sans bug, je n'y touche pas 

Partager ce message


Lien à poster
Partager sur d’autres sites

Ampli, pas photo avec nos petits SONOS.

J'envisage ampli HC pour future salle HC au sous-sol..quand j'aurai fini l'etage, mais pour la TV,SONOS ca suffit amplement ;-)

  • Upvote 1

Partager ce message


Lien à poster
Partager sur d’autres sites

Je viens de voir que Sonos ne prend pas du tout le décodage DTS, ça n'en fait définitivement pas un produit pour les amateurs de home-cinema, équipés de Bluray ou mkv.
Donc en effet, c'est parfaitement adapté à un usage TV, qui ne diffuse que de la Stéréo ou du Dolby Surround.


@sebcbien malgré les optimisations de Sonos sur la Play5, à un moment la limite elle est physique... Pour déplacer de l'air et remplir un grand salon, y'a pas de mystère, il faut des grands haut parleurs.


Partager ce message


Lien à poster
Partager sur d’autres sites

@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);

 

Modifié par drboss
The forum editor when i paste code replace the special character coding by character ex. &lt with <, &quot with " etc.

Partager ce message


Lien à poster
Partager sur d’autres sites

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);

 

 

Modifié par drboss
The forum editor when i paste code first time replace the special character coding by character ex. &lt with <, &quot with " etc.
  • Upvote 1

Partager ce message


Lien à poster
Partager sur d’autres sites

Hello ce soir impossible de faire du tts 

avec les sonos le code erreurs est fichier mp3 mal coder 

quelqu'un a t'il déjà eu ce probleme

Partager ce message


Lien à poster
Partager sur d’autres sites

Bonsoir,

 

Pas de souci pour moi ce soir, le tTS a fonctionne. Rien dans le debug ?

Partager ce message


Lien à poster
Partager sur d’autres sites

Non rien du tout à part ça 

[DEBUG] 21:28:29: Play Stream request uri: [//api.voicerss.org/?key=633a4c44927b4749ba104099a795999d&hl=fr-FR&c=mp3&f=22khz_8bit_mono&src=Bonjour a vous. Nous sommes le Dimanche 12 mars. Il est 21 heure et 28 minutes. Le thermomètre extérieur est a 10 degré 5, et le temps est pluvieux. ]
[DEBUG] 21:28:29: get current track request
[DEBUG] 21:28:29: Get volume request
[DEBUG] 21:28:29: volume: 32
[DEBUG] 21:28:29: Get mute state request
[DEBUG] 21:28:29: mute: false
[DEBUG] 21:28:29: Get transport state request
[DEBUG] 21:28:29: Set volume to 70
[DEBUG] 21:28:29: Volume set to 70
[DEBUG] 21:28:30: Play request
[DEBUG] 21:28:30: Play TSS with auto stop mode
[DEBUG] 21:28:30: Get transport state request
[DEBUG] 21:28:30: TRANSITIONING
[DEBUG] 21:28:31: Get transport state request
[DEBUG] 21:28:31: TRANSITIONING
[DEBUG] 21:28:32: Get transport state request
[DEBUG] 21:28:32: TRANSITIONING
[DEBUG] 21:28:33: Get transport state request
[DEBUG] 21:28:33: TRANSITIONING
[DEBUG] 21:28:34: Get transport state request

Partager ce message


Lien à poster
Partager sur d’autres sites

Comment puis-je utiliser l'api responsivevoice? Je veux utiliser tts hongrois. Merci d'avance!

Partager ce message


Lien à poster
Partager sur d’autres sites

hello problème resolue c'était l'api key qui avait changer je ne sais pas comment car depuis plusieurs mois je n'y est pas touché

@czdanika regarde le lien le hongrois n'est pas pris en charge par voice rss tu peut toujour essayer de mettre le message en hongrois pour voir si ça fonctionne 

le lien  language pris en charge par voice rss

Partager ce message


Lien à poster
Partager sur d’autres sites

@czdanika Yes' I think its gonna try but it will return you an error view that it will not be able to communicate with the server

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 1 minute, Peter a dit :

@czdanika Yes' I think its gonna try but it will return you an error view that it will not be able to communicate with the server

Problem solved.
The api request url changed, so I updated the Lua code under the process button.

Partager ce message


Lien à poster
Partager sur d’autres sites

bonjour à tous,

 

je rencontre un petit soucis avec l'exemple ci dessous:

 

Annoncer la date du jour, la température extérieure et la météo :

-- 239 is the Virtual Device ID
-- 28 is the Process button ID
local sid, bid = 239, 28
 
local cond = fibaro:getValue(3, "WeatherConditionConverted");
local tempext = fibaro:getValue(33, "value"); -- température extérieure
fibaro:debug ("Température extérieure : "..tempext)
local degre = string.gsub(tempext, '[,]' , ' degré ')
local degre = string.gsub(degre, '[.]' , ' degré ')
local degre = string.gsub(degre, '[-]' , ' moins ')
 
local currentDate = os.date("*t")
local jourL = {"Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"}
local jour = jourL[currentDate.wday]
fibaro:debug ("Jour : "..jour)
 
local moisL = {"janvier", "février", "mars", "avril", "mai", "juin",
               "juillet", "aout", "septembre", "octobre", "novembre", "décembre"}
local mois = moisL[currentDate.month]
fibaro:debug ("Mois : "..mois)
 
local condfr ="";
if( cond == "clear" ) then condfr = "clair"; end
if( cond == "cloudy" ) then condfr = "nuageux"; end
if( cond == "rain" ) then condfr = "pluvieux"; end
if( cond == "snow" ) then condfr = "neigeux"; end
if( cond == "storm" ) then condfr = "tempete"; end
if( cond == "fog" ) then condfr = "brouillard"; end
fibaro:debug ("Conditions météorologiques : "..condfr)
 
fibaro:debug ("Création du TTS")
-- Create TTS params object
local params = {
  -- TTS Message
  message = "Bonjour a vous. Nous sommes le "..jour .." "..currentDate.day .." "..mois ..
            ". Il est ".. currentDate.hour .." heure et ".. currentDate.min .." minutes. "..
            "Le thermomètre extérieur est a "..degre ..
            ", et le temps est  "..condfr ..". ",  
  duration = 'auto',    -- Duration: "auto", xx seconds
  language = "fr-FR",    -- Language: fr-FR
  volume = 40            -- Volume
}
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), { tts = params })
_f:call(sid, "pressButton", bid) 

 

il m'annonce bien la date, l'heure, la température mais pas la condition météo.

 

avez vous déjà rencontré ce problème ?

Partager ce message


Lien à poster
Partager sur d’autres sites

Bonjour, il faut juste corriger la value de ta variable local cond = "weathercondition" et non plus "weatherconditionconverted"
ce qui donne:

local cond = fibaro:getValue(3, "WeatherCondition");


Envoyé de mon iPhone en utilisant Tapatalk

Modifié par 13013

Partager ce message


Lien à poster
Partager sur d’autres sites

Merci ça fonctionne bien maintenant !

Une autre petite question, il est possible de lui faire dire la température du plugin météo ?

Partager ce message


Lien à poster
Partager sur d’autres sites

Oui par exemple en remplacant par local tempext = fibaro:getvalue(3, "Temperature");


Envoyé de mon iPhone en utilisant Tapatalk

Partager ce message


Lien à poster
Partager sur d’autres sites

Tu as toutes les propriete du module YR weather lorsque tu fais une scene dans la liste des périphériques (non assigné ).id 3.


Envoyé de mon iPhone en utilisant Tapatalk

Partager ce message


Lien à poster
Partager sur d’autres sites

J'ai le message suivant :

 

[ERROR] 19:19:20: line 7: attempt to concatenate local 'tempext' (a nil value)

 
J'ai le problème depuis que je suis passé aux beta qui ont suivis la 4.110. Actuellement je suis en 4.120.
 
Est-ce que l'un de vous peut faire un test ?

Partager ce message


Lien à poster
Partager sur d’autres sites

Mon TTS du soir a fonctionne pour moi auj. Suis en 4.120 @MAM

Envoyé de mon Nexus 5X en utilisant Tapatalk

Partager ce message


Lien à poster
Partager sur d’autres sites

est_ce que la variable x_sonos_object existe toujours dans ton panneau de variables ?

si oui détruit la et surtout ne sauve PAS le panneau de variables.

Retourne sur un de tes VD sonos, et sauve le

Partager ce message


Lien à poster
Partager sur d’autres sites

oui elle existe bien avec comme valeur NaN

Partager ce message


Lien à poster
Partager sur d’autres sites

J'ai tenté de décomposer la ligne suivante pour voir sur quelle instruction l'erreur se produit :

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}

Mais maintenant j'ai l'erreur :

   [ERROR] 22:09:29: line 62: attempt to index local 'f' (a nil value)

sur la ligne suivante :

   if f[e]then

Partager ce message


Lien à poster
Partager sur d’autres sites
oui elle existe bien avec comme valeur NaN


Supprime la.
Ensuite save le VD pour la recréer.

Partager ce message


Lien à poster
Partager sur d’autres sites

×