Aller au contenu
Barelle

Affichage de l'utilisation des variables globales

Recommended Posts

Scène pour afficher l'utilisation des variables globales

Références croisées (xref)

 

 

Lorsque les développements prennent une certaine ampleur, et en absence d'atelier de développement logiciel, il est utile de de pouvoir rapidement identifier quel morceau de code utilise telle variable (globale dans le cas de la HC2).

Ce sujet avait déjà été abordé il y a maintenant quelque temps :

 

 

Je vous en propose une nouvelle version qui permet :

  • D'obtenir pour chaque variable globale les scènes et VD qui en font usage ;
  • Pour chaque scène et pour chaque VD d'avoir la liste des variables globales utilisées (c'est cela qui est nouveau).

 

Voici un exemple des résultats affichés dans le fenêtre de debug :

image.thumb.png.1911f6217d26267a52bf56ba2da5d71b.png

 

 

La scène est un peu longue  lors de son exécution, je suis preneur d'idées d'algorithmes plus optimisés.

 

Le code de la scène :

--[[
This scene is used to list all the global variables and where they are used.
It's a kind of xref.
-- 07/02/2017: creation
-- 24/10/2019: add scene and virtual devices
--]]

local startTime = os.time();
local globalVariables = api.get("/globalVariables");					-- Get all globals variables
local scenes = api.get("/scenes?type=com.fibaro.luaScene&isLua=true");	-- all the scenes
local devices = api.get("/devices?type=virtual_device");				-- and all the virtual devices since for others types there is no lua code


function round(num, numDecimalPlaces)
	return tonumber(string.format("%." .. (numDecimalPlaces or 0) .. "f", num));
end -- round

function progressBar(progressPct, length)
	if length ~= nil or length == 0 then length = 20; end
	progressPct = math.abs(progressPct);
	progressPct = math.min(progressPct, length);
	return ' [' .. string.rep("*", progressPct) .. string.rep("_", length - progressPct) .. '] ';
end -- progressBar

fibaro:debug('<font color="Gold">Analyzing lua code for ' .. #globalVariables .. ' global variables, ' .. #scenes .. ' scenes, ' .. #devices .. ' virtual devices, this may take a while.</font>');

-- Where each global variable is used
local txt = '<BR><font color="yellow">'.. string.rep('=', 80) .. '<BR>Globals variables ' .. os.date("%d/%m/%y %X") .. '</font><BR>';
local cnt = 0;
for _, glob in pairs(globalVariables) do -- For each global variable
	txt = txt .. '<BR><font color="Orange">Global variable "' .. glob.name .. '":</font>';
	cnt = cnt + 1;
	local used = false;
	
	for _, s in pairs(scenes) do -- For each scene
		local scene = api.get("/scenes/" .. s.id);

		if scene.triggers.globals ~= nil then
			for _, g in pairs(scene.triggers.globals) do -- We look each trigger
				if (g ~= nil) and (g == glob.name) then
					txt = txt .. '<BR><font color="lightgreen">&nbsp&nbsp&nbsp- trigger in scene "' .. scene.name .. '" (id:' .. scene.id .. ')</font>';
					used = true;
				end
			end
		end
		-- Lua code inspection
		if (scene.lua ~= nil) and (string.find(scene.lua, glob.name) ~= nil) then
			txt = txt .. '<BR><font color="Chartreuse">&nbsp&nbsp&nbsp- used in scene "' .. scene.name .. '" (id:' .. scene.id .. ')</font>';
			used = true;
		end
	end -- for _, s in pairs(scenes)

	for _,device in pairs(devices) do -- For each virtual device
		if (device.properties.mainLoop ~= nil) and (string.find(device.properties.mainLoop, glob.name) ~= nil) then -- look in mainloop
			txt = txt .. '<BR><font color="DeepSkyBlue">&nbsp&nbsp&nbsp- used in VD "' .. device.name .. '" mainloop</font>';
			used = true;
		end
		local rows = device.properties.rows;	-- look in buttons
		for _, row in pairs(rows) do
			if (row.type ~= nil) and (row.type == "button") and (row.elements ~= nil) then
				for _,element in pairs(row.elements) do
					if (element.lua ~= nil) and (element.lua == true) then
						if (element.msg ~= nil) and (string.find(element.msg, glob.name) ~= nil) then
							txt = txt .. '<BR><font color="LightSkyBlue">&nbsp&nbsp&nbsp- used in "' .. element.name .. '" btn (id: ' .. element.id .. ') of "' .. device.name .. '" VD (' .. device.id .. ')</font>';
							used = true;
						end
					end
				end
			end
		end
	end -- for _,d in pairs(devices)
	if not used then
		txt = txt .. "<font color='Magenta'> unused</font>";
	end
	local progress = round((cnt / #globalVariables) * 100)
	if (progress % 5) == 0 then
		fibaro:debug('<font color="gray">working,' .. progressBar(progress/5, 20) .. tostring(progress) .. '% done in ' .. (os.time()-startTime) .. ' secondes.</font>');		
	end
end
txt = txt .. '<BR><font color="gray">Total memory in use by Lua (version '.._VERSION..'): ' .. string.format("%.2f", collectgarbage("count")) .. ' KB</font>';
txt = txt .. '<BR><font color="gray">Time for global variables: ' .. (os.time()-startTime) .. ' secondes.</font><BR>';


-- Global variables used by scenes
local sceneTime = os.time();
txt = txt .. '<BR><font color="yellow">'.. string.rep('=', 80) .. '<BR>Global variables used by scene ' .. os.date("%d/%m/%y %X") .. '</font><BR>';

for _, s in pairs(scenes) do -- For each scene
	txt = txt .. '<BR><font color="lightgreen">Scene "' .. s.name .. '" (id:'.. s.id .. '):</font>';
	local used = false;

	local scene = api.get("/scenes/" .. s.id);
	
	if scene.triggers.globals ~= nil then
		for _, g in pairs(scene.triggers.globals) do -- We look each trigger
			for _, glob in pairs(globalVariables) do -- For each global variable
				if (g == glob.name) then
					txt = txt .. '<BR><font color="Orange">&nbsp&nbsp&nbsp- global "' .. glob.name .. ' used as a trigger"</font>';
					used = true;
				end
			end -- for _, glob
		end
	end
	-- Lua code inspection
	if (scene.lua ~= nil) then
		for _, glob in pairs(globalVariables) do -- For each global variable
			if (string.find(scene.lua, glob.name) ~= nil) then
				txt = txt .. '<BR><font color="Coral">&nbsp&nbsp&nbsp- global "' .. glob.name .. '" used</font>';
				used = true;
			end
		end -- for _, glob
	end

	if not used then
		txt = txt .. "<font color='Magenta'> no global variable used</font>";
	end
end -- for _, s in pairs(scenes)

txt = txt .. '<BR><font color="gray">Total memory in use by Lua (version '.._VERSION..'): ' .. string.format("%.2f", collectgarbage("count")) .. ' KB</font>';
txt = txt .. '<BR><font color="gray">Time for scenes: ' .. (os.time()-sceneTime) .. ' secondes.</font><BR>';


-- Global variables used by virtual devices
local deviceTime = os.time();
txt = txt .. '<BR><font color="yellow">'.. string.rep('=', 80) .. '<BR>Global variables used by virtual devices ' .. os.date("%d/%m/%y %X") .. '</font><BR>';

for _,device in pairs(devices) do -- For each virtual device
	txt = txt .. '<BR><font color="DeepSkyBlue">Virtual device "' .. device.name .. '" (id:'.. device.id .. '):</font>';
	local used = false;
	
	if (device.properties.mainLoop ~= nil) then -- look in mainloop
		for _, glob in pairs(globalVariables) do -- For each global variable
			if (string.find(device.properties.mainLoop, glob.name) ~= nil) then
				txt = txt .. '<BR><font color="Orange">&nbsp&nbsp&nbsp- global "' .. glob.name .. '" used in mainloop</font>';
				used = true;
			end
		end
	end

	local rows = device.properties.rows;	-- look in buttons
	for _, row in pairs(rows) do
		if (row.type ~= nil) and (row.type == "button") and (row.elements ~= nil) then
			for _,element in pairs(row.elements) do
				for _, glob in pairs(globalVariables) do -- For each global variable
					if (element.lua ~= nil) and (element.lua == true) then
						if (element.msg ~= nil) and (string.find(element.msg, glob.name) ~= nil) then
							txt = txt .. '<BR><font color="Coral">&nbsp&nbsp&nbsp- global "' .. glob.name .. '" used in btn "' .. element.name .. '" (id:' .. element.id .. ')</font>';
							used = true;
						end
					end
				end
			end
		end
	end

	if not used then
		txt = txt .. "<font color='Magenta'> no global variable used</font>";
	end
end -- for _,device 

txt = txt .. '<BR><font color="gray">Total memory in use by Lua (version '.._VERSION..'): ' .. string.format("%.2f", collectgarbage("count")) .. ' KB</font>';
txt = txt .. '<BR><font color="gray">Time for virtual devices: ' .. (os.time()-deviceTime) .. ' secondes.</font>';
txt = txt .. '<BR><font color="gray">Total elapsed time: ' .. (os.time()-startTime) .. ' secondes.</font><BR>';
fibaro:debug(txt);

Je vous propose l'icône que j'utilise et suis preneur d'une qui serait plus "artistique".

983642344_SceneXref.png.371da1d1c433bcf68b67d5e4a217586e.png

 

A l'approche des frimas, je ne puis que conclure par un...

Chaleureusement.

  • Like 5
  • Thanks 2

Partager ce message


Lien à poster
Partager sur d’autres sites

Ah intéressant ça, j'ai pas mal de vieilles VG dont je veux faire le ménage, ça me permettra de vérifier qu'elles ne sont réellement plus utilisées.



je teste ça à l'occasion :)

Partager ce message


Lien à poster
Partager sur d’autres sites

Super merci. Bonne idée d'évolution. TOP.

Beau boulot. Je teste des que possible.

 

Pas pu m'empecher ;-) magnifique

 [DEBUG] 09:13:59: Analyzing lua code for 55 global variables, 51 scenes, 52 virtual devices, this may take a while.
[DEBUG] 09:14:01: working, [*___________________] 5% done in 3 secondes.
[DEBUG] 09:14:07: working, [***_________________] 15% done in 9 secondes.
[DEBUG] 09:14:09: working, [****________________] 20% done in 11 secondes.
[DEBUG] 09:14:12: working, [*****_______________] 25% done in 14 secondes.
[DEBUG] 09:14:16: working, [*******_____________] 35% done in 18 secondes.
[DEBUG] 09:14:19: working, [********____________] 40% done in 21 secondes.
[DEBUG] 09:14:22: working, [*********___________] 45% done in 24 secondes.
[DEBUG] 09:14:27: working, [***********_________] 55% done in 29 secondes.
[DEBUG] 09:14:29: working, [************________] 60% done in 31 secondes.
[DEBUG] 09:14:32: working, [*************_______] 65% done in 34 secondes.
[DEBUG] 09:14:36: working, [***************_____] 75% done in 38 secondes.
[DEBUG] 09:14:39: working, [****************____] 80% done in 41 secondes.
[DEBUG] 09:14:42: working, [*****************___] 85% done in 44 secondes.
[DEBUG] 09:14:46: working, [*******************_] 95% done in 48 secondes.
[DEBUG] 09:14:49: working, [********************] 100% done in 51 secondes.
[DEBUG] 09:14:50:
================================================================================
Globals variables 25/10/19 09:13:59

Global variable "DeadNodes":
   - used in VD "DeadNodesAnalysis" mainloop
   - used in "DeadNodesAnalysis" btn (id: 1) of "DeadNodesAnalysis" VD (69)
Global variable "FreeSms":
   - trigger in scene "FreeSms-API-Pepite" (id:4)
   - used in scene "FreeSms-API-Pepite" (id:4)
   - used in scene "FreeSmsCanon-API" (id:5)
   - used in scene "GEA" (id:7)
   - used in scene "Reboot HC2" (id:13)
   - used in scene "Backup_HC2" (id:16)
   - used in scene "IDChanged" (id:35)
   - used in "Button11" btn (id: 1) of "Eclairage-Extinction" VD (20)
   - used in "Button21" btn (id: 2) of "Eclairage-Extinction" VD (20)
Global variable "FreeSmsCanon":
   - trigger in scene "FreeSmsCanon-API" (id:5)
   - used in scene "FreeSmsCanon-API" (id:5)
   - used in "Button11" btn (id: 1) of "Eclairage-Extinction" VD (20)
   - used in "Button21" btn (id: 2) of "Eclairage-Extinction" VD (20)
Global variable "GEA_History":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "GEA_Heating_Manager" (id:58)
Global variable "GEA_History_chauffage":
   - used in scene "GEA_Heating_Manager" (id:58)
Global variable "GEA_Plugins":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "GEA_Heating_Manager" (id:58)
Global variable "GEA_Tasks":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "GEA_Heating_Manager" (id:58)
Global variable "GEA_Tasks6":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "GEA_Heating_Manager" (id:58)
Global variable "GEA_Tasks6_chauffage":
   - used in scene "GEA_Heating_Manager" (id:58)
Global variable "GEA_Tasks6_test":
   - used in scene "GEA_Test" (id:8)
Global variable "GEA_Temp_Salon":
   - used in scene "GEA" (id:7)
Global variable "GEA_Test": unused
Global variable "GEA_Trajet_Waze": unused
Global variable "GEA_lavelinge":
   - used in scene "Benchmark_firmware" (id:15)
   - used in scene "Scenetest" (id:19)
Global variable "HomeTable":
   - used in scene "Sauvegarde_IDs" (id:33)
   - used in scene "Netatmo_Station_Mete" (id:36)
Global variable "Icones":
   - used in scene "Icones-Demarrage" (id:9)
Global variable "JourChome":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "GEA_Heating_Manager" (id:58)
   - used in "Button11" btn (id: 3) of "Jour Chome" VD (32)
Global variable "JourChomeJ1":
   - used in "Button11" btn (id: 3) of "Jour Chome" VD (32)
Global variable "MMS":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - trigger in scene "JPI_SMS_MMS" (id:42)
   - used in scene "JPI_SMS_MMS" (id:42)
   - used in scene "GEA_Heating_Manager" (id:58)
   - used in "jpisendsms" btn (id: 3) of "JPI SMS/MMS Gateway" VD (163)
   - used in "jpisendmms" btn (id: 4) of "JPI SMS/MMS Gateway" VD (163)
Global variable "Meteo_Day":
   - used in scene "GEA" (id:7)
   - used in scene "GH_lili2" (id:40)
   - used in VD "YAMS WU" mainloop
   - used in "refresh" btn (id: 13) of "YAMS WU" VD (33)
Global variable "Meteo_Day_Speech":
   - used in VD "YAMS WU" mainloop
   - used in "refresh" btn (id: 13) of "YAMS WU" VD (33)
Global variable "Meteo_In_2_Days":
   - used in VD "YAMS WU" mainloop
   - used in "refresh" btn (id: 13) of "YAMS WU" VD (33)
Global variable "Meteo_In_2_Days_Sp":
   - used in VD "YAMS WU" mainloop
   - used in "refresh" btn (id: 13) of "YAMS WU" VD (33)
Global variable "Meteo_Tomorrow":
   - used in scene "GEA" (id:7)
   - used in scene "GH_lili2" (id:40)
   - used in "Button21" btn (id: 1) of "SONOS_TTS" VD (18)
   - used in VD "YAMS WU" mainloop
   - used in "refresh" btn (id: 13) of "YAMS WU" VD (33)
Global variable "Meteo_Tomorrow_Sp":
   - used in VD "YAMS WU" mainloop
   - used in "refresh" btn (id: 13) of "YAMS WU" VD (33)
Global variable "Mode_Maison":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "GH_lili2" (id:40)
   - used in scene "GEA_Heating_Manager" (id:58)
   - used in "Button11" btn (id: 10) of "Mode_Maison" VD (72)
   - used in "Button21" btn (id: 11) of "Mode_Maison" VD (72)
   - used in "Button31" btn (id: 12) of "Mode_Maison" VD (72)
Global variable "RamFree":
   - used in scene "GEA" (id:7)
   - used in "Button11" btn (id: 11) of "HC2 Diagnostics" VD (37)
Global variable "SMS":
   - used in scene "FreeSms-API-Pepite" (id:4)
   - used in scene "FreeSmsCanon-API" (id:5)
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "Watchdog" (id:11)
   - used in scene "Reboot HC2" (id:13)
   - used in scene "Scenetest" (id:19)
   - used in scene "Push-Interactive" (id:25)
   - used in scene "GH_lili2" (id:40)
   - trigger in scene "JPI_SMS_MMS" (id:42)
   - used in scene "JPI_SMS_MMS" (id:42)
   - used in scene "Sms2Jpi" (id:44)
   - used in scene "WeatherBit2" (id:50)
   - used in scene "GEA_Heating_Manager" (id:58)
   - used in "btnRefresh" btn (id: 11) of "Evenements" VD (14)
   - used in "Button21" btn (id: 2) of "Eclairage-Extinction" VD (20)
   - used in VD "YAMS WU" mainloop
   - used in "refresh" btn (id: 13) of "YAMS WU" VD (33)
   - used in "Button11" btn (id: 1) of "Network Monitor" VD (35)
   - used in "jpisendsms" btn (id: 3) of "JPI SMS/MMS Gateway" VD (163)
   - used in "jpisendmms" btn (id: 4) of "JPI SMS/MMS Gateway" VD (163)
   - used in "Button31" btn (id: 4) of "VD_test" VD (178)
Global variable "Simu_presence":
   - used in VD "Presence Replicator" mainloop
   - used in "Button1" btn (id: 1) of "Presence Replicator" VD (62)
   - used in "Button2" btn (id: 2) of "Presence Replicator" VD (62)
Global variable "SysUpdateOptions":
   - used in VD "Update Notifier 1.0.8" mainloop
   - used in "btnMode" btn (id: 5) of "Update Notifier 1.0.8" VD (74)
   - used in "btnType" btn (id: 6) of "Update Notifier 1.0.8" VD (74)
   - used in "btnDownMin" btn (id: 7) of "Update Notifier 1.0.8" VD (74)
   - used in "btnUpMin" btn (id: 8) of "Update Notifier 1.0.8" VD (74)
Global variable "Tel_Pepite":
   - used in "CheckTel" btn (id: 3) of "Detec_Presence_Pepite" VD (107)
Global variable "VDSoleilAzimut":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilHauteur":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilLuxPon":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilLuxTot":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilOcta":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilRadiDif":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilRadiDir":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilRadiPon":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VDSoleilRadiTot":
   - used in "Button31" btn (id: 12) of "Indicateurs solaire" VD (60)
Global variable "VacScolaire":
   - used in "Button11" btn (id: 1) of "Vacances scolaires" VD (141)
Global variable "VacScolaireJ":
   - used in "Button11" btn (id: 1) of "Vacances scolaires" VD (141)
Global variable "VacScolaireJ1":
   - used in "Button11" btn (id: 1) of "Vacances scolaires" VD (141)
Global variable "VacancesScolaire":
   - used in scene "Vacs_Scolaires" (id:54)
   - used in "update" btn (id: 1) of "Vacances Scolaire" VD (227)
Global variable "Var_WazeTrajet":
   - trigger in scene "Waze_Calcul_Trajet" (id:14)
   - used in scene "Waze_Calcul_Trajet" (id:14)
Global variable "WeatherState":
   - used in scene "Netatmo_Station_Mete" (id:36)
   - used in "Button11" btn (id: 14) of "Outdoor module 2.0" VD (147)
   - used in "Button11" btn (id: 17) of "Main indoor Mod 2.0" VD (164)
Global variable "listeclairage":
   - used in "Button11" btn (id: 1) of "Eclairage-Extinction" VD (20)
   - used in "Button21" btn (id: 2) of "Eclairage-Extinction" VD (20)
Global variable "radio_sonos":
   - used in scene "Telco OCTAN" (id:10)
Global variable "testLabo":
   - used in scene "Scenetest" (id:19)
Global variable "wbit_today_sp":
   - used in scene "GEA" (id:7)
   - used in scene "WeatherBit2" (id:50)
   - used in "Button41" btn (id: 4) of "SONOS_TTS" VD (18)
   - used in "Button42" btn (id: 5) of "SONOS_TTS" VD (18)
Global variable "wbit_tomorrow_sp":
   - used in scene "GEA" (id:7)
   - used in scene "WeatherBit2" (id:50)
   - used in "Button41" btn (id: 4) of "SONOS_TTS" VD (18)
   - used in "Button42" btn (id: 5) of "SONOS_TTS" VD (18)
Global variable "weatherbit_today":
   - used in scene "WeatherBit2" (id:50)
Global variable "weatherbit_tomorrow":
   - used in scene "WeatherBit2" (id:50)
Global variable "x_sonos_object":
   - used in scene "GEA" (id:7)
   - used in scene "GEA_Test" (id:8)
   - used in scene "GEA_Heating_Manager" (id:58)
   - used in "Button21" btn (id: 1) of "SONOS_TTS" VD (18)
   - used in "tempcuisine" btn (id: 2) of "SONOS_TTS" VD (18)
   - used in "Button31" btn (id: 3) of "SONOS_TTS" VD (18)
   - used in "Button41" btn (id: 4) of "SONOS_TTS" VD (18)
   - used in "Button42" btn (id: 5) of "SONOS_TTS" VD (18)
   - used in "anays" btn (id: 6) of "SONOS_TTS" VD (18)
   - used in "Button61" btn (id: 7) of "SONOS_TTS" VD (18)
   - used in "Button62" btn (id: 8) of "SONOS_TTS" VD (18)
   - used in "Button11" btn (id: 1) of "SONOS_STREAM" VD (19)
   - used in "Button21" btn (id: 2) of "SONOS_STREAM" VD (19)
   - used in VD "SONOS Remote v1.0.1" mainloop
   - used in "btnPlay" btn (id: 7) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnPause" btn (id: 8) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnStop" btn (id: 9) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnPrev" btn (id: 10) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnNext" btn (id: 11) of "SONOS Remote v1.0.1" VD (77)
   - used in "lblPowerOff" btn (id: 12) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnSeekLeft" btn (id: 13) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnSeekRight" btn (id: 14) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnMute" btn (id: 16) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnUnMute" btn (id: 17) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnToggleMute" btn (id: 18) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnLoudnessOn" btn (id: 20) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnLoudnessOff" btn (id: 21) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnMyRadioStation1" btn (id: 22) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnMyRadioStation2" btn (id: 23) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnMyRadioStation3" btn (id: 24) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnMyRadioStation4" btn (id: 25) of "SONOS Remote v1.0.1" VD (77)
   - used in "btnMyRadioStation5" btn (id: 26) of "SONOS Remote v1.0.1" VD (77)
   - used in "Process" btn (id: 28) of "SONOS Remote v1.0.1" VD (77)
   - used in VD "SONOS Remote v1.0.1" mainloop
   - used in "btnPlay" btn (id: 7) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnPause" btn (id: 8) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnStop" btn (id: 9) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnPrev" btn (id: 10) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnNext" btn (id: 11) of "SONOS Remote v1.0.1" VD (167)
   - used in "lblPowerOff" btn (id: 12) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnSeekLeft" btn (id: 13) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnSeekRight" btn (id: 14) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnMute" btn (id: 16) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnUnMute" btn (id: 17) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnToggleMute" btn (id: 18) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnLoudnessOn" btn (id: 20) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnLoudnessOff" btn (id: 21) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnMyRadioStation1" btn (id: 22) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnMyRadioStation2" btn (id: 23) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnMyRadioStation3" btn (id: 24) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnMyRadioStation4" btn (id: 25) of "SONOS Remote v1.0.1" VD (167)
   - used in "btnMyRadioStation5" btn (id: 26) of "SONOS Remote v1.0.1" VD (167)
   - used in "Process" btn (id: 28) of "SONOS Remote v1.0.1" VD (167)
Global variable "zwave_48":
   - used in scene "zwave_viewer_monit" (id:49)
Total memory in use by Lua (version Lua 5.2): 5348.66 KB
Time for global variables: 51 secondes.

================================================================================
Global variables used by scene 25/10/19 09:14:49

Scene "FreeSms-API-Pepite" (id:4):
   - global "FreeSms used as a trigger"
   - global "FreeSms" used
   - global "SMS" used
Scene "FreeSmsCanon-API" (id:5):
   - global "FreeSmsCanon used as a trigger"
   - global "FreeSms" used
   - global "FreeSmsCanon" used
   - global "SMS" used
Scene "Generateur ID's" (id:6): no global variable used
Scene "GEA" (id:7):
   - global "FreeSms" used
   - global "GEA_History" used
   - global "GEA_Plugins" used
   - global "GEA_Tasks" used
   - global "GEA_Tasks6" used
   - global "GEA_Temp_Salon" used
   - global "JourChome" used
   - global "MMS" used
   - global "Meteo_Day" used
   - global "Meteo_Tomorrow" used
   - global "Mode_Maison" used
   - global "RamFree" used
   - global "SMS" used
   - global "wbit_today_sp" used
   - global "wbit_tomorrow_sp" used
   - global "x_sonos_object" used
Scene "GEA_Test" (id:8):
   - global "GEA_History" used
   - global "GEA_Plugins" used
   - global "GEA_Tasks" used
   - global "GEA_Tasks6" used
   - global "GEA_Tasks6_test" used
   - global "JourChome" used
   - global "MMS" used
   - global "Mode_Maison" used
   - global "SMS" used
   - global "x_sonos_object" used
Scene "Icones-Demarrage" (id:9):
   - global "Icones" used
Scene "Telco OCTAN" (id:10):
   - global "radio_sonos" used
Scene "Watchdog" (id:11):
   - global "SMS" used
Scene "Reboot HC2" (id:13):
   - global "FreeSms" used
   - global "SMS" used
Scene "Waze_Calcul_Trajet" (id:14):
   - global "Var_WazeTrajet used as a trigger"
   - global "Var_WazeTrajet" used
Scene "Benchmark_firmware" (id:15):
   - global "GEA_lavelinge" used
Scene "Backup_HC2" (id:16):
   - global "FreeSms" used
Scene "Delete_Backup_HC2" (id:17): no global variable used
Scene "CheckAll_IDs" (id:18): no global variable used
Scene "Scenetest" (id:19):
   - global "GEA_lavelinge" used
   - global "SMS" used
   - global "testLabo" used
Scene "Popup" (id:20): no global variable used
Scene "Pushbullet" (id:21): no global variable used
Scene "Push-Interactive" (id:25):
   - global "SMS" used
Scene "Allumage-Bonhomme" (id:26): no global variable used
Scene "Snippets LUA" (id:27): no global variable used
Scene "Swipe-Sonos" (id:28): no global variable used
Scene "Pushbullet_pushingbo" (id:29): no global variable used
Scene "Pushbullet_TEST" (id:30): no global variable used
Scene "Scene Test2" (id:31): no global variable used
Scene "Scène_Babyphone" (id:32): no global variable used
Scene "Sauvegarde_IDs" (id:33):
   - global "HomeTable" used
Scene "IDChanged" (id:35):
   - global "FreeSms" used
Scene "Netatmo_Station_Mete" (id:36):
   - global "HomeTable" used
   - global "WeatherState" used
Scene "Finder" (id:37): no global variable used
Scene "backup" (id:38): no global variable used
Scene "lili" (id:39): no global variable used
Scene "GH_lili2" (id:40):
   - global "Meteo_Day" used
   - global "Meteo_Tomorrow" used
   - global "Mode_Maison" used
   - global "SMS" used
Scene "Simul_Prez" (id:41): no global variable used
Scene "JPI_SMS_MMS" (id:42):
   - global "SMS used as a trigger"
   - global "MMS used as a trigger"
   - global "MMS" used
   - global "SMS" used
Scene "Count_Devices" (id:43): no global variable used
Scene "Sms2Jpi" (id:44):
   - global "SMS" used
Scene "Weatherbit" (id:45): no global variable used
Scene "HC2toJeedom" (id:46): no global variable used
Scene "TelcoSoftRemote" (id:47): no global variable used
Scene "Zwave_Monitor3.0" (id:48): no global variable used
Scene "zwave_viewer_monit" (id:49):
   - global "zwave_48" used
Scene "WeatherBit2" (id:50):
   - global "SMS" used
   - global "wbit_today_sp" used
   - global "wbit_tomorrow_sp" used
   - global "weatherbit_today" used
   - global "weatherbit_tomorrow" used
Scene "FadeOut_Sonos" (id:51): no global variable used
Scene "SonosNode" (id:52): no global variable used
Scene "Scene_sonos_minies" (id:53): no global variable used
Scene "Vacs_Scolaires" (id:54):
   - global "VacancesScolaire" used
Scene "Scene_Nodon_Interr" (id:55): no global variable used
Scene "BotFibaro" (id:56): no global variable used
Scene "httprequest" (id:57): no global variable used
Scene "GEA_Heating_Manager" (id:58):
   - global "GEA_History" used
   - global "GEA_History_chauffage" used
   - global "GEA_Plugins" used
   - global "GEA_Tasks" used
   - global "GEA_Tasks6" used
   - global "GEA_Tasks6_chauffage" used
   - global "JourChome" used
   - global "MMS" used
   - global "Mode_Maison" used
   - global "SMS" used
   - global "x_sonos_object" used
Scene "Xref-VGs" (id:59): no global variable used
Total memory in use by Lua (version Lua 5.2): 3734.58 KB
Time for scenes: 1 secondes.

================================================================================
Global variables used by virtual devices 25/10/19 09:14:50

Virtual device "Clock Sync" (id:4): no global variable used
Virtual device "Variables Globales" (id:13): no global variable used
Virtual device "Evenements" (id:14):
   - global "SMS" used in btn "btnRefresh" (id:11)
Virtual device "Top 10 Power" (id:15): no global variable used
Virtual device "SONOS_TTS" (id:18):
   - global "Meteo_Tomorrow" used in btn "Button21" (id:1)
   - global "x_sonos_object" used in btn "Button21" (id:1)
   - global "x_sonos_object" used in btn "tempcuisine" (id:2)
   - global "x_sonos_object" used in btn "Button31" (id:3)
   - global "wbit_today_sp" used in btn "Button41" (id:4)
   - global "wbit_tomorrow_sp" used in btn "Button41" (id:4)
   - global "x_sonos_object" used in btn "Button41" (id:4)
   - global "wbit_today_sp" used in btn "Button42" (id:5)
   - global "wbit_tomorrow_sp" used in btn "Button42" (id:5)
   - global "x_sonos_object" used in btn "Button42" (id:5)
   - global "x_sonos_object" used in btn "anays" (id:6)
   - global "x_sonos_object" used in btn "Button61" (id:7)
   - global "x_sonos_object" used in btn "Button62" (id:8)
Virtual device "SONOS_STREAM" (id:19):
   - global "x_sonos_object" used in btn "Button11" (id:1)
   - global "x_sonos_object" used in btn "Button21" (id:2)
Virtual device "Eclairage-Extinction" (id:20):
   - global "FreeSms" used in btn "Button11" (id:1)
   - global "FreeSmsCanon" used in btn "Button11" (id:1)
   - global "listeclairage" used in btn "Button11" (id:1)
   - global "FreeSms" used in btn "Button21" (id:2)
   - global "FreeSmsCanon" used in btn "Button21" (id:2)
   - global "SMS" used in btn "Button21" (id:2)
   - global "listeclairage" used in btn "Button21" (id:2)
Virtual device "Jour Chome" (id:32):
   - global "JourChome" used in btn "Button11" (id:3)
   - global "JourChomeJ1" used in btn "Button11" (id:3)
Virtual device "YAMS WU" (id:33):
   - global "Meteo_Day" used in mainloop
   - global "Meteo_Day_Speech" used in mainloop
   - global "Meteo_In_2_Days" used in mainloop
   - global "Meteo_In_2_Days_Sp" used in mainloop
   - global "Meteo_Tomorrow" used in mainloop
   - global "Meteo_Tomorrow_Sp" used in mainloop
   - global "SMS" used in mainloop
   - global "Meteo_Day" used in btn "refresh" (id:13)
   - global "Meteo_Day_Speech" used in btn "refresh" (id:13)
   - global "Meteo_In_2_Days" used in btn "refresh" (id:13)
   - global "Meteo_In_2_Days_Sp" used in btn "refresh" (id:13)
   - global "Meteo_Tomorrow" used in btn "refresh" (id:13)
   - global "Meteo_Tomorrow_Sp" used in btn "refresh" (id:13)
   - global "SMS" used in btn "refresh" (id:13)
Virtual device "Freebox TV" (id:34): no global variable used
Virtual device "Network Monitor" (id:35):
   - global "SMS" used in btn "Button11" (id:1)
Virtual device "HC2 Diagnostics" (id:37):
   - global "RamFree" used in btn "Button11" (id:11)
Virtual device "My Batteries" (id:50): no global variable used
Virtual device "Indicateurs solaire" (id:60):
   - global "VDSoleilAzimut" used in btn "Button31" (id:12)
   - global "VDSoleilHauteur" used in btn "Button31" (id:12)
   - global "VDSoleilLuxPon" used in btn "Button31" (id:12)
   - global "VDSoleilLuxTot" used in btn "Button31" (id:12)
   - global "VDSoleilOcta" used in btn "Button31" (id:12)
   - global "VDSoleilRadiDif" used in btn "Button31" (id:12)
   - global "VDSoleilRadiDir" used in btn "Button31" (id:12)
   - global "VDSoleilRadiPon" used in btn "Button31" (id:12)
   - global "VDSoleilRadiTot" used in btn "Button31" (id:12)
Virtual device "Presence Replicator" (id:62):
   - global "Simu_presence" used in mainloop
   - global "Simu_presence" used in btn "Button1" (id:1)
   - global "Simu_presence" used in btn "Button2" (id:2)
Virtual device "Home->NLG" (id:66): no global variable used
Virtual device "NLG->Home" (id:67): no global variable used
Virtual device "DeadNodesAnalysis" (id:69):
   - global "DeadNodes" used in mainloop
   - global "DeadNodes" used in btn "DeadNodesAnalysis" (id:1)
Virtual device "Imperihome" (id:71): no global variable used
Virtual device "Mode_Maison" (id:72):
   - global "Mode_Maison" used in btn "Button11" (id:10)
   - global "Mode_Maison" used in btn "Button21" (id:11)
   - global "Mode_Maison" used in btn "Button31" (id:12)
Virtual device "Update Notifier 1.0.8" (id:74):
   - global "SysUpdateOptions" used in mainloop
   - global "SysUpdateOptions" used in btn "btnMode" (id:5)
   - global "SysUpdateOptions" used in btn "btnType" (id:6)
   - global "SysUpdateOptions" used in btn "btnDownMin" (id:7)
   - global "SysUpdateOptions" used in btn "btnUpMin" (id:8)
Virtual device "VD test" (id:75): no global variable used
Virtual device "Sun(rise|set)" (id:76): no global variable used
Virtual device "SONOS Remote v1.0.1" (id:77):
   - global "x_sonos_object" used in mainloop
   - global "x_sonos_object" used in btn "btnPlay" (id:7)
   - global "x_sonos_object" used in btn "btnPause" (id:8)
   - global "x_sonos_object" used in btn "btnStop" (id:9)
   - global "x_sonos_object" used in btn "btnPrev" (id:10)
   - global "x_sonos_object" used in btn "btnNext" (id:11)
   - global "x_sonos_object" used in btn "lblPowerOff" (id:12)
   - global "x_sonos_object" used in btn "btnSeekLeft" (id:13)
   - global "x_sonos_object" used in btn "btnSeekRight" (id:14)
   - global "x_sonos_object" used in btn "btnMute" (id:16)
   - global "x_sonos_object" used in btn "btnUnMute" (id:17)
   - global "x_sonos_object" used in btn "btnToggleMute" (id:18)
   - global "x_sonos_object" used in btn "btnLoudnessOn" (id:20)
   - global "x_sonos_object" used in btn "btnLoudnessOff" (id:21)
   - global "x_sonos_object" used in btn "btnMyRadioStation1" (id:22)
   - global "x_sonos_object" used in btn "btnMyRadioStation2" (id:23)
   - global "x_sonos_object" used in btn "btnMyRadioStation3" (id:24)
   - global "x_sonos_object" used in btn "btnMyRadioStation4" (id:25)
   - global "x_sonos_object" used in btn "btnMyRadioStation5" (id:26)
   - global "x_sonos_object" used in btn "Process" (id:28)
Virtual device "Chauffage - Salon" (id:92): no global variable used
Virtual device "Detec_Presence_Pepite" (id:107):
   - global "Tel_Pepite" used in btn "CheckTel" (id:3)
Virtual device "Syslog Synology" (id:110): no global variable used
Virtual device "NestToZXT" (id:114): no global variable used
Virtual device "Google Agenda Pepite" (id:138): no global variable used
Virtual device "Google Agenda Canon" (id:139): no global variable used
Virtual device "GEA Status" (id:140): no global variable used
Virtual device "Vacances scolaires" (id:141):
   - global "VacScolaire" used in btn "Button11" (id:1)
   - global "VacScolaireJ" used in btn "Button11" (id:1)
   - global "VacScolaireJ1" used in btn "Button11" (id:1)
Virtual device "Outdoor module 2.0" (id:147):
   - global "WeatherState" used in btn "Button11" (id:14)
Virtual device "VD Buttons ID" (id:152): no global variable used
Virtual device "Recap_Job_Canon" (id:153): no global variable used
Virtual device "GEA Alarm" (id:154): no global variable used
Virtual device "JPI SMS/MMS Gateway" (id:163):
   - global "MMS" used in btn "jpisendsms" (id:3)
   - global "SMS" used in btn "jpisendsms" (id:3)
   - global "MMS" used in btn "jpisendmms" (id:4)
   - global "SMS" used in btn "jpisendmms" (id:4)
Virtual device "Main indoor Mod 2.0" (id:164):
   - global "WeatherState" used in btn "Button11" (id:17)
Virtual device "SonosPlaylistSpotify" (id:166): no global variable used
Virtual device "SONOS Remote v1.0.1" (id:167):
   - global "x_sonos_object" used in mainloop
   - global "x_sonos_object" used in btn "btnPlay" (id:7)
   - global "x_sonos_object" used in btn "btnPause" (id:8)
   - global "x_sonos_object" used in btn "btnStop" (id:9)
   - global "x_sonos_object" used in btn "btnPrev" (id:10)
   - global "x_sonos_object" used in btn "btnNext" (id:11)
   - global "x_sonos_object" used in btn "lblPowerOff" (id:12)
   - global "x_sonos_object" used in btn "btnSeekLeft" (id:13)
   - global "x_sonos_object" used in btn "btnSeekRight" (id:14)
   - global "x_sonos_object" used in btn "btnMute" (id:16)
   - global "x_sonos_object" used in btn "btnUnMute" (id:17)
   - global "x_sonos_object" used in btn "btnToggleMute" (id:18)
   - global "x_sonos_object" used in btn "btnLoudnessOn" (id:20)
   - global "x_sonos_object" used in btn "btnLoudnessOff" (id:21)
   - global "x_sonos_object" used in btn "btnMyRadioStation1" (id:22)
   - global "x_sonos_object" used in btn "btnMyRadioStation2" (id:23)
   - global "x_sonos_object" used in btn "btnMyRadioStation3" (id:24)
   - global "x_sonos_object" used in btn "btnMyRadioStation4" (id:25)
   - global "x_sonos_object" used in btn "btnMyRadioStation5" (id:26)
   - global "x_sonos_object" used in btn "Process" (id:28)
Virtual device "GEA MultiAlarm" (id:168): no global variable used
Virtual device "VD_test" (id:178):
   - global "SMS" used in btn "Button31" (id:4)
Virtual device "WeatherBit" (id:187): no global variable used
Virtual device "TV Commande" (id:202): no global variable used
Virtual device "SonosHTTP_API" (id:203): no global variable used
Virtual device "Cuisine" (id:204): no global variable used
Virtual device "Vacances Manager" (id:205): no global variable used
Virtual device "Noemie_SONOS" (id:221): no global variable used
Virtual device "Vacances Scolaire" (id:227):
   - global "VacancesScolaire" used in btn "update" (id:1)
Virtual device "Thermostat SdB" (id:242): no global variable used
Virtual device "Chauffage Manager" (id:243): no global variable used
Virtual device "Thermostat Chambres" (id:244): no global variable used
Total memory in use by Lua (version Lua 5.2): 4810.84 KB
Time for virtual devices: 0 secondes.
Total elapsed time: 52 secondes.

 

Partager ce message


Lien à poster
Partager sur d’autres sites

Merci pour le partage, ça fonctionne tip top ;-)

Je suis impressionné par le nombre de variables utilisé par Pepite :blink:....j'ai vraiment une installation minuscule et encore du boulot pour tout intégrer :-)

Partager ce message


Lien à poster
Partager sur d’autres sites

Je viens d'utiliser la scène, c'est nickel, super job @Barelle :60:

Partager ce message


Lien à poster
Partager sur d’autres sites

Essayé également, ca marche au top, et c'est magnifique avec toute ces couleurs :)

Merci

Partager ce message


Lien à poster
Partager sur d’autres sites

Moi je veux bien voir à quoi ressemble la scène Gestion VMC :) Sinon bravo c'est très utile !

 

Mais @pepite qu'est-ce que tu peux bien faire de toutes ces variables ???? :3:

Partager ce message


Lien à poster
Partager sur d’autres sites

hehe, c'est a force de tester et tester les scènes et VDs qui créent automatiquement les variables ;-)

Je vais pouvoir faire le ménage ;-)

Partager ce message


Lien à poster
Partager sur d’autres sites

La scène Gestion VMC permet de ... gérer la VMC.

Elle prend en compte :

  • Des horaires de mise en marche par jour de la semaine et par couleur du jour Tempo EdF (je viens  d'abandonner Tempo pour revenir à un abonnement HPHC, il faudra donc que j'adapte ma scène) ;
  • Elle est associée à une scène VMC climat qui elle peut forcer le fonctionnement de la VMC suivant les températures et les taux d'humidité intérieurs et extérieurs, ainsi que le taux de CO2.

Le plus dur a été de trouver un moyen de comparer les humidités, et plus précisément de convertir les humidités relatives en humidités absolues, je me suis basé sur le site http://www.kefasystem.com/fr/service/taupunktrechner.html

 

Pour l'instant, je ne gère la VMC qu'en marche lente ou arrêt total. A l'occasion de mon changement d'abonnement, il est dans mes intentions de re-concevoir l'ensemble et de prévoir également la gestion de la vitesse rapide.

Pour compliquer le tout, étant donné son plan, ma maison comprend trois VMC, dont une m'est pour l'instant inaccessible, et j'aimerais bien pouvoir les gérer individuellement.

 

Ai-je réussi à satisfaire ta curiosité ?

 

Partager ce message


Lien à poster
Partager sur d’autres sites

×