Précédemment j'avais soulevé le problème avec les icônes perso.
Avec cette commande json :
Code : Tout sélectionner
https://192.168.0.x/json.htm?type=command¶m=getcustomiconsetJ'ai corrigé cela hier et ce matin c'est impeccable !
Merci à tous
Code : Tout sélectionner
https://192.168.0.x/json.htm?type=command¶m=getcustomiconsetCode : Tout sélectionner
local scriptName = 'script_device_Nbr_Jours_TEMPO'
local scriptVersion = ' 1.0'
local NbrJBleu = 300 -- Tout au long de l’année
local NbrJBlanc = 43 -- Tout au long de l’année, hors dimanche
local NbrJRouge = 22 -- Du 1er novembre au 31 mars, hors week-end et jours fériés
local function text_color(text,color) -- Fonction pour écriture du texte en fonction de la couleur TEMPO.
if color == "ROUGE" then text = '<FONT COLOR=#FF0000>' .. text .. '</FONT>' end
if color == "BLEU" then text = '<FONT COLOR=#0000FF>' .. text .. '</FONT>' end
if color == "GRIS" then text = '<FONT COLOR=#708090>' .. text .. '</FONT>' end
if color == "BLANC" then text = '<FONT COLOR=#000000>' .. text .. '</FONT>' end
return text
end
return {
on = { variables = { 'Tempo_J_*' }, -- variables Nbr jour Tempo.
},
logging = { -- La section de journalisation facultative vous permet de remplacer le paramètre de journalisation globale de dzVents.
-- comme défini dans Configuration> Paramètres> Autre> Système d'événements> Niveau de journalisation dzVents.
-- Cela peut être pratique lorsque vous voulez que ce script ait une journalisation de débogage étendue pendant que le reste de votre script s'exécute en mode silencieux.
level = domoticz.LOG_ERROR, -- domoticz.LOG_INFO, domoticz.LOG_MODULE_EXEC_INFO, domoticz.LOG_DEBUG or domoticz.LOG_ERROR, domoticz.LOG_FORCE,
marker = scriptName..' v'..scriptVersion
},
execute = function(domoticz, item)
Nbr_Jours_Blancs = domoticz.variables('Tempo_J_Blanc').value
Nbr_Jours_Rouges = domoticz.variables('Tempo_J_Rouge').value
Nbr_Jours_Bleus = domoticz.variables('Tempo_J_Bleu').value
color = "BLEU"
local Texte_Bleu = text_color('Nbr de jours "BLEU" restants: '..Nbr_Jours_Bleus..'/'..NbrJBleu..'<br>','BLEU')
color = "BLANC"
local Texte_Blanc = text_color('Nbr de jours "BLANC" restants: '..Nbr_Jours_Blancs..'/'..NbrJBlanc..'<br>','BLANC')
color = "ROUGE"
local Texte_Rouge = text_color('Nbr de jours "ROUGE" restants: '..Nbr_Jours_Rouges..'/'..NbrJRouge..'<br>','ROUGE')
local texte = Texte_Bleu..Texte_Blanc..Texte_Rouge
domoticz.devices('Nombre de jours TEMPO').updateText(texte)
end
}
Code : Tout sélectionner
-- Envoi de mail pour information Jour Rouge demain
if tempoDay.J1 == "ROUGE" and nowDate.hour > 10 then -- demain jour ROUGE
message = 'Demain le: '..DateTempoJ1..' la couleur TEMPO sera: ROUGE'
domoticz.notify("Alerte TEMPO jour ROUGE", message, domoticz.PRIORITY_EMERGENCY)
elseif tempoDay.J1 == "ROUGE" and nowDate.hour < 10 then -- demain jour ROUGE
message = 'Demain le: '..DateTempoJ1..' la couleur provisoire TEMPO sera: ROUGE'
domoticz.notify("Alerte TEMPO provisoire jour ROUGE", message, domoticz.PRIORITY_EMERGENCY)
end