I made this simple script just to test izSynth
Code: Select all
--
commandArray = {}
if (devicechanged['Oggi'] == "On") then
giorni = {"Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"}
mesi = {"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"}
mese = os.date("%m")
giorno_sett = os.date("%w")
giorno = os.date("%d")
anno = os.date("%Y")
data = os.date("%d %B %Y")
ora = os.date("%H e %M")
temp = otherdevices_svalues["TempExt"]
pos = string.find(temp, ";")-1
temp = string.sub(temp,1,pos)
message = "Oggi è "..giorni[tonumber(giorno_sett)].." "..tostring(giorno).." "..mesi[tonumber(mese)].." "..tostring(anno).." e sono le "..ora..". La temperatura esterna è "..temp.." gradi centigradi. Buona giornata!"
messaggio2= '/home/pi/domoticz/scripts/izsynth -t "'..message..'"'
prova = os.execute(messaggio2)
commandArray["Oggi"] = "Off"
else
return
end
return commandArray
Don't know if it's right to set to Off the switch that way or if there is something wrong
Any advice?
Thanks