Garluk ha scritto:Marco tranquillo.
I csv dovrebbero sistemarsi da soli al cambio giorno.
Che LCD hai usato e collegato?
ciao ho usato un OLED1306 ma puoi usare anche un lcd2004
ho cambiato lo script con cui inviavo i valori all'lcd ora leggo il json generati da metern
ho aggiunto anche il json per leggere i valori di temperatura dei sensori collegati ad espeasy con i nuovi FW che hanno json
riporto lo script se serve a qualcuno:)
per virtmet garluk quando puoi vediamo se riusciamo a sistemare anche per chi ha il meter produzione e consumi invertiti?
grazie!!
Codice: Seleziona tutto
#!/bin/sh
### lcd
curl -s http://192.168.0.195/control?cmd=oledcmd,clear
curl -s http://192.168.0.198/control?cmd=lcdcmd,clear
curl -s "http://192.168.0.195/control?cmd=oled,1,3,Via.Ancona"
# import live consumi
x2=`cat /dev/shm/mN_LIVEMEMORY.json | python -c "import sys, json; print(json.load(sys.stdin)['Consumi1'])"`
curl -s "http://192.168.0.195/control?cmd=oled,2,2,Consumi+$x2+W"
curl -s "http://192.168.0.198/control?cmd=lcd,2,1,Consumi+$x2+W"
# import live produzione
x1=`cat /dev/shm/mN_LIVEMEMORY.json | python -c "import sys, json; print(json.load(sys.stdin)['Produzione2'])"`
x4=`cat /dev/shm/mN_LIVEMEMORY.json | python -c "import sys, json; print(json.load(sys.stdin)['Immissioni4'])"`
curl -s "http://192.168.0.195/control?cmd=oled,3,2,Produz.+$x1+W"
curl -s "http://192.168.0.198/control?cmd=lcd,3,1,Prod+$x1+W%20Im+$x4+W"
# import live prelievi
x3=`cat /dev/shm/mN_LIVEMEMORY.json | python -c "import sys, json; print(json.load(sys.stdin)['Prelievi3'])"`
curl -s "http://192.168.0.195/control?cmd=oled,4,2,Prelievi+$x3+W"
# import live immissioni
x4=`cat /dev/shm/mN_LIVEMEMORY.json | python -c "import sys, json; print(json.load(sys.stdin)['Immissioni4'])"`
curl -s "http://192.168.0.195/control?cmd=oled,5,2,Immisio+$x4+W"
#importo temp MANSARDA e lo pubblico su LCD in corridoio
tMANS=`curl -s http://192.168.0.198/json?tasknr=3 | python -c "import sys, json; print(json.load(sys.stdin)['TaskValues'][0]['Value'])"`
hMANS=`curl -s http://192.168.0.198/json?tasknr=3 | python -c "import sys, json; print(json.load(sys.stdin)['TaskValues'][1]['Value'])"`
curl -s "http://192.168.0.195/control?cmd=oled,6,2,1P+$tMANS%20+$hMANS+%"
#importo accumulo solare
AC=`cat /dev/shm/mN_LIVEMEMORY.json | python -c "import sys, json; print(json.load(sys.stdin)['Temperatura Boiler11'])"`
curl -s "http://192.168.0.195/control?cmd=oled,8,2,Boiler:%20$AC+C"