Je voudrais afficher les phases de chauffage sur le Dashboard.
J'ai crée un hardware dummy, puis
j'ai crée un virtual sensor de type text, nommé Phases.
Il apparaît bien dans la table des devices avec comme data hello world.
Je crée un script time LUA pour afficher Diurne ou Nocturne selon l'heure.
Code : Tout sélectionner
commandArray = {}
ttidx=otherdevices_idx['Phases']
print (ttidx)
if (tonumber(os.date('%H')) >= 22 and tonumber(os.date('%H')) <= 6) then
print ("Nocturne");
commandArray['Phases']=ttidx..'|0|'.."Nocturne"
elseif (tonumber(os.date('%H')) >= 13 and tonumber(os.date('%H')) <= 17) then
print ("Diurne");
commandArray['Phases']=ttidx..'|0|'.."Diurne"
end
return commandArrayExplication et/ou tuto et/ou solution avec plaisir ...