In my network meanwhile around 30 ESP8266 Wemos D1, Sonoff and Blitzwolf devices are doing its jobs to fullfill my needs and wishes. I have integrated various old systems which never knew, that something like a networks exists, ie an 25 years old gas central heating, a WDE weatherstation, a WS2310 weatherstation a.s.o.
The last wish I wanted to be satisfied was a phone call list. This is done by now and I only have to design the Gui on my Nextion display.
The display I am using is a NX8048K070_11, a 7.0 inch, 32MB Nextion display attached to a Wemos D1 Mini Pro.
The pictures I made are not the best quality, but may give an overview what I have done up to now:
The solar and the batterie inverters are read using a python script on a RPI, using modbus protocol, the call list is filled up by reading the call monitor of a Fritz!Box with a small python script, too.
At least the possibility of switching the heating and the AC depending on the readings of my solar panel, giving an idea when it makes sense to start the dihwasher and the calling list out of the Fritz!Box using the different pages on my Nextion by just tipping raised the WAF dramatically. In the past every time a small package arrived from China I got a harsh comment what for I did spend my small pocket money. Nowadays I am asked, which nice feature I would add.....
For those, who are interested in: I have found the sources of a small Fritz!Box monitor on github and modified it for my needs:
Code: Select all
import socket
import sys
import time
import http.client
import json
import pycurl
FRITZBOX_ADDRESS = "xxx.xxx.xxx.xxx"
def left(s,amount):
return s[:amount]
def right(s,amount):
return s[-amount:]
while True:
while True:
print("Verbindung aufbauen...\n")
try:
sock = socket.create_connection((FRITZBOX_ADDRESS,1012))
sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPIDLE, 60)
sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPINTVL, 60)
sock.setsockopt(socket.SOL_TCP, socket.TCP_KEEPCNT, 2)
except:
print("Verbindungsaufbau fehlgeschlagen\n")
time.sleep(60)
continue
break
print("Verbunden\n")
while True:
try:
data = sock.recv(1024)
except:
break
ret = data.decode('utf8').split(";")
if (ret[1] == "RING"):
sentence = (ret[0])
sentence = ''.join(sentence.split())
datum = left(sentence,8)
uhrzeit=right(sentence,8)
uhrzeit=left(uhrzeit,5)
c = pycurl.Curl()
Aufruf='http://192.168.xxx.yyy/control?cmd=Di,page4.t13.txt="'+uhrzeit+'"'
c.setopt(c.URL, Aufruf)
c.perform()
Aufruf='http://192.168.xxx.yyy/control?cmd=Di,page4.t14.txt="'+datum+'"'
c.setopt(c.URL, Aufruf)
c.perform()
Aufruf='http://192.168.xxx.yyy/control?cmd=Di,page4.t12.txt="'+ret[3]+'"'
c.setopt(c.URL, Aufruf)
c.perform()
c.close
else:
continue
Code: Select all
Dummy ~ # python3 ESPFritzmon/ESPFritzmon.py > /dev/null 2>&1 &
[1] 14539
Dummy ~ # disown 14539