je cherche à réaliser un script pour ma femme,
afin d'afficher l'état HC sur le panneau.
Je récupère les infos par /dev/ttyAMA0
mais l'idée serait analyser la trame en 1 seule lecture et afficher ensuite.
Mon script est un essai, mais plus que perfectible.
Code : Tout sélectionner
--Script EDF analyse retour teleinfo pour Affichage HC
commandArray = {}
EC_success=os.execute('head /dev/ttyAMA0 | grep -Z "PTEC HC.."')
if EC_success then
--Affiche Etat sur S3 piface
if(otherdevices['Tarif HC']=='Off') then
commandArray['Tarif HC']='On'
print("Tarif en HC")
end
else
--Affiche sur piface en S3
if(otherdevices['Tarif HC']=='On') then
commandArray['Tarif HC']='Off'
print("Tarif en HP")
end
end