Drawing graphs in EG

Got a good idea? You can suggest new features here.
User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Drawing graphs in EG

Post by kgschlosser » Wed Nov 13, 2019 10:45 pm

just let me know if you have any questions. The hardest thing about programming is learning the syntax and the vocabulary.

This may make it a bit easier to understand how object orientated languages work..
In Basic you had the "goto" in order to redirect what code gets run. This is the mechanism that was used in order to group code together that completes a specific task. It allows the program to run in a non linear fashion. The programs execution can jump from one place to another inside of a specific file or files. The classes allow you to do the same thing. and it gets even more refined inside of the classes by using methods which are code blocks that get run again much like using goto.
If you like the work I have been doing then feel free to Image

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Thu Nov 14, 2019 10:17 pm

I'm sorry, but there is an issue, I did not solve yet. After generating some plots I get a warning:

Code: Select all

22:53:38            C:\Python27\Lib\site-packages\matplotlib\pyplot.py:522: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
Adding plt.close(fig) at the end of your code did not help. It produces a new error message:

Code: Select all

23:09:03            Traceback (most recent call last):
23:09:03              Python script "290", line 70, in <module>
23:09:03                plt.close(fig)
23:09:03              File "C:\Python27\Lib\site-packages\matplotlib\pyplot.py", line 660, in close
23:09:03                _pylab_helpers.Gcf.destroy_fig(arg)
23:09:03              File "C:\Python27\Lib\site-packages\matplotlib\_pylab_helpers.py", line 69, in destroy_fig
23:09:03                cls.destroy(num)
23:09:03              File "C:\Python27\Lib\site-packages\matplotlib\_pylab_helpers.py", line 60, in destroy
23:09:03                manager.destroy()
23:09:03              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1303, in destroy
23:09:03                self.frame.Destroy()
23:09:03              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1262, in Destroy
23:09:03                wxapp.Yield()
23:09:03              File "wx\_core.pyc", line 7916, in Yield
23:09:03            PyAssertionError: C++ assertion "wxThread::IsMain()" failed at ..\..\src\msw\evtloop.cpp(182) in wxGUIEventLoop::Dispatch(): only the main thread can process Windows messages
Some time later EG crashes. I suppose due to lack of memory.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Drawing graphs in EG

Post by kgschlosser » Fri Nov 15, 2019 3:59 am

Which example are you using?

You are not going to be calling plt.show() because you don't want to show it. You want to save it. I will get that portion of the code together for ya.

That warning is taking place because there are a bunch of plots created and not closed.
If you like the work I have been doing then feel free to Image

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Fri Nov 15, 2019 6:47 am

Here is my actual script:

Code: Select all

import matplotlib.pyplot as plt
import numpy as np
import json
from datetime import datetime

params = {
    'legend.fontsize': 16,
    'figure.figsize': (16, 10),
    'axes.labelsize': 16,
    'axes.titlesize': 16,
    'xtick.labelsize': 16,
    'ytick.labelsize': 16,
    'figure.titlesize': 22
}

plt.rcParams.update(params)
# plt.style.use('seaborn-whitegrid')

GeraetePfad = 'C:/Daten/Programmdaten/EventGhost/Geraete/' # Eingabe
WebPfad = 'C:/Daten/Programmdaten/EventGhost/web/'   # Ausgabe
Geraet = 'Sonoff-33'
Modul = 'AM2301'

# Datei öffnen
GeraeteDaten = open(GeraetePfad + Geraet +'_' + Modul + '.txt',"r")
# Zeilen in eine Liste laden
DatenZeilen = GeraeteDaten.readlines()

# Listen für die Grafik erzeugen
x = []
y1 = []
y2 = []

# Listen füllen
for Zeile in DatenZeilen:
     x  += [datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
     y1 += [json.loads(Zeile)["Temperature"]]
     y2 += [json.loads(Zeile)["Humidity"]]
   
# Plot Line1 (Left Y Axis)
fig, ax1 = plt.subplots(1, 1, figsize=(16,9), dpi= 80)
ax1.plot(x, y1, color='tab:red')

# Plot Line2 (Right Y Axis)
ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.plot(x, y2, color='tab:blue')

# Decorations
# ax1 (left Y axis)
ax1.set_xlabel('Zeit', fontsize=20)
ax1.tick_params(axis='x', rotation=45, labelsize=12)
ax1.set_ylabel('Temperatur [C]', color='tab:red', fontsize=20)
ax1.tick_params(axis='y', rotation=0, labelcolor='tab:red' )
ax1.grid(alpha=.4)

# ax2 (right Y axis)
ax2.set_ylabel("Luftfeuchte [%]", color='tab:blue', fontsize=20)
ax2.tick_params(axis='y', labelcolor='tab:blue')
ax2.set_xticks(np.arange(0, len(x), 60))
ax2.set_xticklabels(x[::60], rotation=90, fontdict={'fontsize':10})
ax2.set_title("Temperatur und Luftfeuchte Dachboden (33)", fontsize=22)
fig.tight_layout()

#plt.show()
plt.savefig(WebPfad + Geraet +'_' + Modul, transparent = False)import matplotlib.pyplot as plt
import numpy as np
import json
from datetime import datetime

params = {
    'legend.fontsize': 16,
    'figure.figsize': (16, 10),
    'axes.labelsize': 16,
    'axes.titlesize': 16,
    'xtick.labelsize': 16,
    'ytick.labelsize': 16,
    'figure.titlesize': 22
}

plt.rcParams.update(params)
# plt.style.use('seaborn-whitegrid')

GeraetePfad = 'C:/Daten/Programmdaten/EventGhost/Geraete/' # Eingabe
WebPfad = 'C:/Daten/Programmdaten/EventGhost/web/'   # Ausgabe
Geraet = 'Sonoff-33'
Modul = 'AM2301'

# Datei öffnen
GeraeteDaten = open(GeraetePfad + Geraet +'_' + Modul + '.txt',"r")
# Zeilen in eine Liste laden
DatenZeilen = GeraeteDaten.readlines()

# Listen für die Grafik erzeugen
x = []
y1 = []
y2 = []

# Listen füllen
for Zeile in DatenZeilen:
#    x +=  [str(datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S"))]
     x  += [datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
     y1 += [json.loads(Zeile)["Temperature"]]
     y2 += [json.loads(Zeile)["Humidity"]]
   
#import sys
#sys.exit()

# Plot Line1 (Left Y Axis)
fig, ax1 = plt.subplots(1, 1, figsize=(16,9), dpi= 80)
ax1.plot(x, y1, color='tab:red')

# Plot Line2 (Right Y Axis)
ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.plot(x, y2, color='tab:blue')

# Decorations
# ax1 (left Y axis)
ax1.set_xlabel('Zeit', fontsize=20)
ax1.tick_params(axis='x', rotation=45, labelsize=12)
ax1.set_ylabel('Temperatur [C]', color='tab:red', fontsize=20)
ax1.tick_params(axis='y', rotation=0, labelcolor='tab:red' )
ax1.grid(alpha=.4)

# ax2 (right Y axis)
ax2.set_ylabel("Luftfeuchte [%]", color='tab:blue', fontsize=20)
ax2.tick_params(axis='y', labelcolor='tab:blue')
ax2.set_xticks(np.arange(0, len(x), 60))
ax2.set_xticklabels(x[::60], rotation=90, fontdict={'fontsize':10})
ax2.set_title("Temperatur und Luftfeuchte Dachboden (33)", fontsize=22)
fig.tight_layout()

plt.savefig(WebPfad + Geraet +'_' + Modul, transparent = False)
I changed the data format in the data file, to adjust it to my general data concept. In the dataset some data is missing because of the crashes of EG.

Code: Select all

{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-13T14:22:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-13T14:27:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.9, "Time": "2019-11-13T14:32:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.9, "Time": "2019-11-13T14:37:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.9, "Time": "2019-11-13T14:42:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-13T14:47:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.9, "Time": "2019-11-13T14:52:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.8, "Time": "2019-11-13T14:57:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-13T15:02:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-13T15:07:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-13T15:12:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-13T15:17:35"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.8, "Time": "2019-11-13T15:22:35"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.8, "Time": "2019-11-13T15:27:35"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.9, "Time": "2019-11-13T15:32:35"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 20.9, "Time": "2019-11-13T15:37:35"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 20.9, "Time": "2019-11-13T15:42:35"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 20.9, "Time": "2019-11-13T15:47:35"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.9, "Time": "2019-11-13T15:52:35"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 21.0, "Time": "2019-11-13T15:57:35"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 21.0, "Time": "2019-11-13T16:02:35"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 21.0, "Time": "2019-11-13T16:07:35"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 21.0, "Time": "2019-11-13T16:12:35"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 21.0, "Time": "2019-11-13T16:17:35"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 21.0, "Time": "2019-11-13T16:22:35"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 21.0, "Time": "2019-11-13T16:27:35"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 21.0, "Time": "2019-11-13T16:32:35"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 21.0, "Time": "2019-11-13T16:37:35"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 21.0, "Time": "2019-11-13T16:42:35"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 21.0, "Time": "2019-11-13T16:47:35"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 21.0, "Time": "2019-11-13T16:52:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-13T16:57:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-13T17:02:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-13T17:07:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-13T17:12:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-13T17:17:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 21.1, "Time": "2019-11-13T17:22:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-13T17:27:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 21.1, "Time": "2019-11-13T17:32:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 21.1, "Time": "2019-11-13T17:37:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 21.0, "Time": "2019-11-13T17:42:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 21.0, "Time": "2019-11-13T17:47:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.0, "Time": "2019-11-13T17:52:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.0, "Time": "2019-11-13T17:57:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 21.0, "Time": "2019-11-13T18:02:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 21.0, "Time": "2019-11-13T18:07:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 20.9, "Time": "2019-11-13T18:12:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 21.0, "Time": "2019-11-13T18:17:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 21.0, "Time": "2019-11-13T18:22:35"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 21.0, "Time": "2019-11-13T18:27:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 21.0, "Time": "2019-11-13T18:32:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.0, "Time": "2019-11-13T18:37:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 21.3, "Time": "2019-11-13T18:42:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.1, "Time": "2019-11-13T18:47:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.1, "Time": "2019-11-13T18:52:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 21.1, "Time": "2019-11-13T18:57:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.1, "Time": "2019-11-13T19:02:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 21.2, "Time": "2019-11-13T19:07:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 21.1, "Time": "2019-11-13T19:12:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 21.1, "Time": "2019-11-13T19:17:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.1, "Time": "2019-11-13T19:22:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.1, "Time": "2019-11-13T19:27:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T19:37:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.1, "Time": "2019-11-13T19:42:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.1, "Time": "2019-11-13T19:47:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T19:52:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T19:57:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 21.1, "Time": "2019-11-13T20:02:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.0, "Time": "2019-11-13T20:07:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.0, "Time": "2019-11-13T20:12:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T20:17:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 21.1, "Time": "2019-11-13T20:22:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.0, "Time": "2019-11-13T20:27:35"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 21.0, "Time": "2019-11-13T20:32:35"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 21.1, "Time": "2019-11-13T20:37:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.1, "Time": "2019-11-13T20:42:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.1, "Time": "2019-11-13T20:47:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T20:52:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T20:57:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T21:02:36"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 21.1, "Time": "2019-11-13T21:07:36"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 21.1, "Time": "2019-11-13T21:12:36"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 21.0, "Time": "2019-11-13T21:17:36"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 21.1, "Time": "2019-11-13T21:22:36"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 21.0, "Time": "2019-11-13T21:27:36"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.0, "Time": "2019-11-13T21:32:36"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.0, "Time": "2019-11-13T21:37:36"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 21.0, "Time": "2019-11-13T21:42:36"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 21.0, "Time": "2019-11-13T21:47:36"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 21.1, "Time": "2019-11-13T21:52:36"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.1, "Time": "2019-11-13T21:57:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-13T22:02:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-13T22:07:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.1, "Time": "2019-11-13T22:12:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-13T22:17:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.1, "Time": "2019-11-13T22:22:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-13T22:27:36"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 21.0, "Time": "2019-11-13T22:32:36"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 20.8, "Time": "2019-11-13T22:37:36"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 21.0, "Time": "2019-11-13T22:42:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-13T22:47:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-13T22:52:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-13T22:57:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-13T23:02:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-13T23:07:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-13T23:12:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-13T23:17:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.7, "Time": "2019-11-13T23:22:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.7, "Time": "2019-11-13T23:27:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.7, "Time": "2019-11-13T23:32:36"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.7, "Time": "2019-11-13T23:37:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.7, "Time": "2019-11-13T23:42:36"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.6, "Time": "2019-11-13T23:47:36"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.6, "Time": "2019-11-13T23:52:36"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.5, "Time": "2019-11-13T23:57:36"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.5, "Time": "2019-11-14T00:02:36"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.9, "Time": "2019-11-14T00:07:36"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.5, "Time": "2019-11-14T00:12:36"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.0, "Time": "2019-11-14T00:17:36"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.3, "Time": "2019-11-14T00:22:36"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.4, "Time": "2019-11-14T00:27:36"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.3, "Time": "2019-11-14T00:32:36"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.3, "Time": "2019-11-14T00:37:36"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.3, "Time": "2019-11-14T00:42:36"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.3, "Time": "2019-11-14T00:47:36"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.2, "Time": "2019-11-14T00:52:36"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.2, "Time": "2019-11-14T00:57:36"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.2, "Time": "2019-11-14T01:02:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.1, "Time": "2019-11-14T01:07:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.1, "Time": "2019-11-14T01:12:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.1, "Time": "2019-11-14T01:17:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.1, "Time": "2019-11-14T01:22:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.1, "Time": "2019-11-14T01:27:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.2, "Time": "2019-11-14T01:32:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.0, "Time": "2019-11-14T01:37:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.0, "Time": "2019-11-14T01:42:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.9, "Time": "2019-11-14T01:47:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.9, "Time": "2019-11-14T01:52:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.9, "Time": "2019-11-14T01:57:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.9, "Time": "2019-11-14T02:02:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.8, "Time": "2019-11-14T02:07:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.8, "Time": "2019-11-14T02:12:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.7, "Time": "2019-11-14T02:17:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.7, "Time": "2019-11-14T02:22:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.7, "Time": "2019-11-14T02:27:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.7, "Time": "2019-11-14T02:32:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.7, "Time": "2019-11-14T02:37:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.6, "Time": "2019-11-14T02:42:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.6, "Time": "2019-11-14T02:47:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.6, "Time": "2019-11-14T02:52:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 19.6, "Time": "2019-11-14T02:57:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 19.5, "Time": "2019-11-14T03:02:35"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 19.5, "Time": "2019-11-14T03:07:35"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 19.5, "Time": "2019-11-14T03:12:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 19.4, "Time": "2019-11-14T03:17:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 19.4, "Time": "2019-11-14T03:22:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 19.8, "Time": "2019-11-14T03:27:35"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 19.3, "Time": "2019-11-14T03:32:35"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 19.4, "Time": "2019-11-14T03:37:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 19.4, "Time": "2019-11-14T03:42:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 19.3, "Time": "2019-11-14T03:47:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 19.3, "Time": "2019-11-14T03:52:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 19.2, "Time": "2019-11-14T03:57:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 19.2, "Time": "2019-11-14T04:02:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 19.2, "Time": "2019-11-14T04:07:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 19.2, "Time": "2019-11-14T04:12:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.1, "Time": "2019-11-14T04:17:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.1, "Time": "2019-11-14T04:22:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.1, "Time": "2019-11-14T04:27:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 19.1, "Time": "2019-11-14T04:32:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.1, "Time": "2019-11-14T04:37:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.0, "Time": "2019-11-14T04:42:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 19.0, "Time": "2019-11-14T04:47:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.0, "Time": "2019-11-14T04:52:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 18.9, "Time": "2019-11-14T04:57:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 18.9, "Time": "2019-11-14T05:02:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.9, "Time": "2019-11-14T05:07:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.9, "Time": "2019-11-14T05:12:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.9, "Time": "2019-11-14T05:17:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.9, "Time": "2019-11-14T05:22:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.8, "Time": "2019-11-14T05:27:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.8, "Time": "2019-11-14T05:32:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.8, "Time": "2019-11-14T05:37:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 18.7, "Time": "2019-11-14T05:42:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 18.7, "Time": "2019-11-14T05:47:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 18.7, "Time": "2019-11-14T05:52:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.7, "Time": "2019-11-14T05:57:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.7, "Time": "2019-11-14T06:02:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.7, "Time": "2019-11-14T06:07:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 18.6, "Time": "2019-11-14T06:12:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 18.6, "Time": "2019-11-14T06:17:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.6, "Time": "2019-11-14T06:22:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.5, "Time": "2019-11-14T06:27:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.5, "Time": "2019-11-14T06:32:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.6, "Time": "2019-11-14T06:37:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.5, "Time": "2019-11-14T06:42:35"}
{"TempUnit": "C", "Humidity": 48.9, "Temperature": 18.5, "Time": "2019-11-14T06:47:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.4, "Time": "2019-11-14T06:52:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 18.0, "Time": "2019-11-14T06:57:35"}
{"TempUnit": "C", "Humidity": 48.9, "Temperature": 18.4, "Time": "2019-11-14T07:02:35"}
{"TempUnit": "C", "Humidity": 48.9, "Temperature": 18.4, "Time": "2019-11-14T07:07:35"}
{"TempUnit": "C", "Humidity": 48.9, "Temperature": 18.4, "Time": "2019-11-14T07:12:35"}
{"TempUnit": "C", "Humidity": 49.0, "Temperature": 18.4, "Time": "2019-11-14T07:17:35"}
{"TempUnit": "C", "Humidity": 49.0, "Temperature": 18.5, "Time": "2019-11-14T07:22:35"}
{"TempUnit": "C", "Humidity": 48.8, "Temperature": 18.5, "Time": "2019-11-14T07:27:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 18.6, "Time": "2019-11-14T07:32:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.6, "Time": "2019-11-14T07:37:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 18.7, "Time": "2019-11-14T07:42:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 18.7, "Time": "2019-11-14T07:47:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 18.8, "Time": "2019-11-14T07:52:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 18.8, "Time": "2019-11-14T07:57:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 18.9, "Time": "2019-11-14T08:02:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 19.0, "Time": "2019-11-14T08:07:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 19.0, "Time": "2019-11-14T08:12:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.0, "Time": "2019-11-14T08:17:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.0, "Time": "2019-11-14T08:22:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.2, "Time": "2019-11-14T08:27:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.2, "Time": "2019-11-14T08:32:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.2, "Time": "2019-11-14T08:37:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.2, "Time": "2019-11-14T08:42:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.3, "Time": "2019-11-14T08:47:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.3, "Time": "2019-11-14T08:52:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.4, "Time": "2019-11-14T08:57:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.3, "Time": "2019-11-14T09:02:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 19.4, "Time": "2019-11-14T09:07:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 19.4, "Time": "2019-11-14T09:12:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 19.5, "Time": "2019-11-14T09:17:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.6, "Time": "2019-11-14T09:22:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 19.7, "Time": "2019-11-14T09:27:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 19.8, "Time": "2019-11-14T09:32:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 19.8, "Time": "2019-11-14T09:37:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 19.8, "Time": "2019-11-14T09:42:35"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 19.9, "Time": "2019-11-14T09:47:35"}
{"TempUnit": "C", "Humidity": 48.7, "Temperature": 20.0, "Time": "2019-11-14T09:52:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 20.0, "Time": "2019-11-14T09:57:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 20.1, "Time": "2019-11-14T10:02:35"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 20.1, "Time": "2019-11-14T10:07:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 20.2, "Time": "2019-11-14T10:12:35"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 20.2, "Time": "2019-11-14T10:17:35"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 20.3, "Time": "2019-11-14T10:27:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 20.4, "Time": "2019-11-14T10:32:35"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 20.5, "Time": "2019-11-14T10:37:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 20.5, "Time": "2019-11-14T10:42:35"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 20.6, "Time": "2019-11-14T10:47:35"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 20.7, "Time": "2019-11-14T10:52:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.6, "Time": "2019-11-14T10:57:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.8, "Time": "2019-11-14T11:02:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.7, "Time": "2019-11-14T11:07:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.7, "Time": "2019-11-14T11:12:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.7, "Time": "2019-11-14T11:17:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.8, "Time": "2019-11-14T11:22:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 21.2, "Time": "2019-11-14T11:27:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-14T11:37:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-14T11:42:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-14T11:47:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-14T11:52:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-14T11:57:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-14T12:02:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-14T12:07:35"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.7, "Time": "2019-11-14T12:12:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-14T12:17:35"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.8, "Time": "2019-11-14T12:22:35"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.8, "Time": "2019-11-14T12:27:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-14T12:32:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-14T12:37:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-14T12:42:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-14T12:47:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-14T12:52:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.9, "Time": "2019-11-14T12:57:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 21.0, "Time": "2019-11-14T13:07:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.9, "Time": "2019-11-14T13:12:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.9, "Time": "2019-11-14T13:22:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.9, "Time": "2019-11-14T13:27:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 21.0, "Time": "2019-11-14T13:32:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.9, "Time": "2019-11-14T13:37:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 21.0, "Time": "2019-11-14T13:42:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.9, "Time": "2019-11-14T13:47:35"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.9, "Time": "2019-11-14T13:52:35"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 21.3, "Time": "2019-11-14T13:57:35"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.9, "Time": "2019-11-14T14:02:36"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.9, "Time": "2019-11-14T14:07:36"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.9, "Time": "2019-11-14T14:12:36"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.8, "Time": "2019-11-14T14:17:36"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.8, "Time": "2019-11-14T14:27:36"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 20.8, "Time": "2019-11-14T14:32:36"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 20.8, "Time": "2019-11-14T14:37:36"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.7, "Time": "2019-11-14T14:55:10"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.7, "Time": "2019-11-14T15:00:10"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.7, "Time": "2019-11-14T15:05:10"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.7, "Time": "2019-11-14T15:10:10"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.7, "Time": "2019-11-14T15:15:10"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.7, "Time": "2019-11-14T15:20:10"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 20.7, "Time": "2019-11-14T15:25:10"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.7, "Time": "2019-11-14T15:30:10"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.7, "Time": "2019-11-14T15:33:13"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.8, "Time": "2019-11-14T15:38:13"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.8, "Time": "2019-11-14T15:43:13"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.8, "Time": "2019-11-14T15:48:13"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.8, "Time": "2019-11-14T15:53:13"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-14T15:58:13"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-14T16:03:13"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-14T16:08:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-14T16:13:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-14T16:18:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.9, "Time": "2019-11-14T16:23:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.9, "Time": "2019-11-14T16:28:13"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.9, "Time": "2019-11-14T16:33:13"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.9, "Time": "2019-11-14T16:38:13"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.9, "Time": "2019-11-14T16:43:13"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.9, "Time": "2019-11-14T16:48:13"}
{"TempUnit": "C", "Humidity": 51.3, "Temperature": 20.6, "Time": "2019-11-14T16:48:36"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 21.0, "Time": "2019-11-14T16:53:13"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 21.0, "Time": "2019-11-14T16:58:13"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 21.0, "Time": "2019-11-14T17:03:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 21.0, "Time": "2019-11-14T17:08:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-14T17:13:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-14T17:18:13"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-14T17:23:13"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-14T17:28:13"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-14T17:33:13"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 21.0, "Time": "2019-11-14T17:38:13"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 21.0, "Time": "2019-11-14T17:43:13"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-14T17:48:13"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-14T17:53:13"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.1, "Time": "2019-11-14T17:58:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-14T18:03:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-14T18:08:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 21.0, "Time": "2019-11-14T18:13:13"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-14T18:18:13"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 21.0, "Time": "2019-11-14T18:23:13"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 21.0, "Time": "2019-11-14T18:28:13"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 21.1, "Time": "2019-11-14T18:33:13"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 21.1, "Time": "2019-11-14T18:38:13"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 21.1, "Time": "2019-11-14T18:43:13"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 21.1, "Time": "2019-11-14T18:48:13"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 21.1, "Time": "2019-11-14T18:53:13"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.1, "Time": "2019-11-14T18:58:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 21.1, "Time": "2019-11-14T19:03:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 21.1, "Time": "2019-11-14T19:08:13"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 21.1, "Time": "2019-11-14T19:13:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 21.0, "Time": "2019-11-14T19:18:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 21.0, "Time": "2019-11-14T19:23:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 21.0, "Time": "2019-11-14T19:28:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 21.0, "Time": "2019-11-14T19:33:13"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 21.0, "Time": "2019-11-14T19:38:13"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 20.9, "Time": "2019-11-14T19:43:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.9, "Time": "2019-11-14T19:48:13"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 20.9, "Time": "2019-11-14T19:53:13"}
{"TempUnit": "C", "Humidity": 46.5, "Temperature": 20.8, "Time": "2019-11-14T19:58:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.9, "Time": "2019-11-14T20:03:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.8, "Time": "2019-11-14T20:08:13"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 20.8, "Time": "2019-11-14T20:13:13"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 20.8, "Time": "2019-11-14T20:18:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.7, "Time": "2019-11-14T20:23:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.7, "Time": "2019-11-14T20:28:13"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.7, "Time": "2019-11-14T20:33:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.6, "Time": "2019-11-14T20:38:13"}
{"TempUnit": "C", "Humidity": 46.6, "Temperature": 20.6, "Time": "2019-11-14T20:43:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.6, "Time": "2019-11-14T20:48:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.6, "Time": "2019-11-14T20:53:13"}
{"TempUnit": "C", "Humidity": 46.7, "Temperature": 20.5, "Time": "2019-11-14T20:58:13"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.5, "Time": "2019-11-14T21:03:13"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 20.5, "Time": "2019-11-14T21:08:13"}
{"TempUnit": "C", "Humidity": 46.8, "Temperature": 20.4, "Time": "2019-11-14T21:13:13"}
{"TempUnit": "C", "Humidity": 46.9, "Temperature": 20.4, "Time": "2019-11-14T21:18:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.6, "Time": "2019-11-14T21:23:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.4, "Time": "2019-11-14T21:28:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.3, "Time": "2019-11-14T21:33:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.3, "Time": "2019-11-14T21:38:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.3, "Time": "2019-11-14T21:43:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.3, "Time": "2019-11-14T21:48:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.2, "Time": "2019-11-14T21:53:13"}
{"TempUnit": "C", "Humidity": 47.0, "Temperature": 20.2, "Time": "2019-11-14T21:58:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.2, "Time": "2019-11-14T22:03:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.1, "Time": "2019-11-14T22:18:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.0, "Time": "2019-11-14T22:23:13"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.0, "Time": "2019-11-14T22:28:13"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.0, "Time": "2019-11-14T22:38:38"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.0, "Time": "2019-11-14T22:43:38"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 19.9, "Time": "2019-11-14T22:48:38"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 19.9, "Time": "2019-11-14T22:53:38"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 19.8, "Time": "2019-11-14T22:58:38"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 19.8, "Time": "2019-11-14T23:03:38"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 19.8, "Time": "2019-11-14T23:08:38"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 19.8, "Time": "2019-11-14T23:13:38"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 19.7, "Time": "2019-11-14T23:23:38"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 19.7, "Time": "2019-11-14T23:28:38"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 19.6, "Time": "2019-11-14T23:33:38"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 19.6, "Time": "2019-11-14T23:38:38"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 19.5, "Time": "2019-11-14T23:43:38"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 19.5, "Time": "2019-11-14T23:48:38"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 19.5, "Time": "2019-11-14T23:53:38"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 19.5, "Time": "2019-11-14T23:58:38"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 19.5, "Time": "2019-11-15T00:03:38"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 19.4, "Time": "2019-11-15T00:08:38"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 19.4, "Time": "2019-11-15T00:13:38"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 19.3, "Time": "2019-11-15T00:18:38"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 19.3, "Time": "2019-11-15T00:23:38"}
{"TempUnit": "C", "Humidity": 47.6, "Temperature": 19.3, "Time": "2019-11-15T00:28:38"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.3, "Time": "2019-11-15T00:33:38"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.3, "Time": "2019-11-15T00:38:38"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.2, "Time": "2019-11-15T00:43:38"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.2, "Time": "2019-11-15T00:48:38"}
{"TempUnit": "C", "Humidity": 47.7, "Temperature": 19.2, "Time": "2019-11-15T00:53:38"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.2, "Time": "2019-11-15T00:58:38"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.1, "Time": "2019-11-15T01:03:38"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.1, "Time": "2019-11-15T01:08:38"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.0, "Time": "2019-11-15T01:13:38"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.0, "Time": "2019-11-15T01:18:38"}
{"TempUnit": "C", "Humidity": 47.8, "Temperature": 19.0, "Time": "2019-11-15T01:23:38"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.0, "Time": "2019-11-15T01:28:38"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 19.0, "Time": "2019-11-15T01:33:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.9, "Time": "2019-11-15T01:38:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.9, "Time": "2019-11-15T01:43:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.9, "Time": "2019-11-15T01:48:38"}
{"TempUnit": "C", "Humidity": 47.9, "Temperature": 18.8, "Time": "2019-11-15T01:53:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.8, "Time": "2019-11-15T01:58:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.9, "Time": "2019-11-15T02:03:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.8, "Time": "2019-11-15T02:08:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.7, "Time": "2019-11-15T02:13:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.7, "Time": "2019-11-15T02:18:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.6, "Time": "2019-11-15T02:23:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.7, "Time": "2019-11-15T02:28:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.7, "Time": "2019-11-15T02:33:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.6, "Time": "2019-11-15T02:38:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.6, "Time": "2019-11-15T02:43:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.6, "Time": "2019-11-15T02:48:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.6, "Time": "2019-11-15T02:53:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.5, "Time": "2019-11-15T02:58:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.5, "Time": "2019-11-15T03:03:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.4, "Time": "2019-11-15T03:08:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.4, "Time": "2019-11-15T03:13:38"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 18.5, "Time": "2019-11-15T03:18:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.4, "Time": "2019-11-15T03:23:38"}
{"TempUnit": "C", "Humidity": 48.0, "Temperature": 18.3, "Time": "2019-11-15T03:28:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.3, "Time": "2019-11-15T03:33:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.3, "Time": "2019-11-15T03:38:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.2, "Time": "2019-11-15T03:43:38"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 18.3, "Time": "2019-11-15T03:48:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.2, "Time": "2019-11-15T03:53:38"}
{"TempUnit": "C", "Humidity": 48.1, "Temperature": 18.2, "Time": "2019-11-15T03:58:38"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 18.1, "Time": "2019-11-15T04:03:38"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 18.1, "Time": "2019-11-15T04:08:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 18.1, "Time": "2019-11-15T04:13:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 18.1, "Time": "2019-11-15T04:18:38"}
{"TempUnit": "C", "Humidity": 48.2, "Temperature": 18.0, "Time": "2019-11-15T04:23:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 18.0, "Time": "2019-11-15T04:28:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.9, "Time": "2019-11-15T04:33:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.9, "Time": "2019-11-15T04:38:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 18.0, "Time": "2019-11-15T04:43:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.9, "Time": "2019-11-15T04:48:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.9, "Time": "2019-11-15T04:53:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.8, "Time": "2019-11-15T04:58:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.8, "Time": "2019-11-15T05:03:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.8, "Time": "2019-11-15T05:08:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.8, "Time": "2019-11-15T05:13:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.7, "Time": "2019-11-15T05:18:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.7, "Time": "2019-11-15T05:23:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.7, "Time": "2019-11-15T05:28:38"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 17.7, "Time": "2019-11-15T05:33:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.6, "Time": "2019-11-15T05:38:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.6, "Time": "2019-11-15T05:43:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.6, "Time": "2019-11-15T05:48:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.5, "Time": "2019-11-15T05:53:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.5, "Time": "2019-11-15T05:58:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.5, "Time": "2019-11-15T06:03:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.4, "Time": "2019-11-15T06:08:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.5, "Time": "2019-11-15T06:13:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.4, "Time": "2019-11-15T06:18:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.4, "Time": "2019-11-15T06:23:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.4, "Time": "2019-11-15T06:28:38"}
{"TempUnit": "C", "Humidity": 48.3, "Temperature": 17.4, "Time": "2019-11-15T06:33:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.3, "Time": "2019-11-15T06:38:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.3, "Time": "2019-11-15T06:43:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.3, "Time": "2019-11-15T06:48:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.2, "Time": "2019-11-15T06:53:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.2, "Time": "2019-11-15T06:58:38"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.2, "Time": "2019-11-15T07:03:37"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.2, "Time": "2019-11-15T07:08:37"}
{"TempUnit": "C", "Humidity": 48.4, "Temperature": 17.2, "Time": "2019-11-15T07:13:37"}
{"TempUnit": "C", "Humidity": 48.5, "Temperature": 17.1, "Time": "2019-11-15T07:18:37"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 17.1, "Time": "2019-11-15T07:23:37"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 17.1, "Time": "2019-11-15T07:28:37"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 17.1, "Time": "2019-11-15T07:33:37"}
{"TempUnit": "C", "Humidity": 48.6, "Temperature": 17.1, "Time": "2019-11-15T07:38:37"}
And for smoothing the graph I manipulated the data in the following way:

Code: Select all

import savitzky_golay as sg

y1sg = sg.savitzky_golay(np.array(y1), window_size=27, order=3)
y2sg = sg.savitzky_golay(np.array(y2), window_size=27, order=3)
y1 = y1sg.tolist()
y2 = y2sg.tolist()
The function can be found at

https://scipy-cookbook.readthedocs.io/i ... Golay.html

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Fri Nov 15, 2019 6:55 am

Something went wrong, when copying the code into the post. Here again without any modifications.

Code: Select all

import matplotlib.pyplot as plt
import numpy as np
import json
from datetime import datetime

params = {
    'legend.fontsize': 16,
    'figure.figsize': (16, 10),
    'axes.labelsize': 16,
    'axes.titlesize': 16,
    'xtick.labelsize': 16,
    'ytick.labelsize': 16,
    'figure.titlesize': 22
}

plt.rcParams.update(params)
# plt.style.use('seaborn-whitegrid')

GeraetePfad = 'C:/Daten/Programmdaten/EventGhost/Geraete/' # Eingabe
WebPfad = 'C:/Daten/Programmdaten/EventGhost/web/'   # Ausgabe
Geraet = 'Sonoff-33'
Modul = 'AM2301'

# Datei öffnen
GeraeteDaten = open(GeraetePfad + Geraet +'_' + Modul + '.txt',"r")
# Zeilen in eine Liste laden
DatenZeilen = GeraeteDaten.readlines()

# Listen für die Grafik erzeugen
x = []
y1 = []
y2 = []

# Listen füllen
for Zeile in DatenZeilen:
#    x +=  [str(datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S"))]
     x  += [datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
     y1 += [json.loads(Zeile)["Temperature"]]
     y2 += [json.loads(Zeile)["Humidity"]]
   
#import sys
#sys.exit()

# Plot Line1 (Left Y Axis)
fig, ax1 = plt.subplots(1, 1, figsize=(16,9), dpi= 80)
ax1.plot(x, y1, color='tab:red')

# Plot Line2 (Right Y Axis)
ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.plot(x, y2, color='tab:blue')

# Decorations
# ax1 (left Y axis)
ax1.set_xlabel('Zeit', fontsize=20)
ax1.tick_params(axis='x', rotation=45, labelsize=12)
ax1.set_ylabel('Temperatur [C]', color='tab:red', fontsize=20)
ax1.tick_params(axis='y', rotation=0, labelcolor='tab:red' )
ax1.grid(alpha=.4)

# ax2 (right Y axis)
ax2.set_ylabel("Luftfeuchte [%]", color='tab:blue', fontsize=20)
ax2.tick_params(axis='y', labelcolor='tab:blue')
ax2.set_xticks(np.arange(0, len(x), 60))
ax2.set_xticklabels(x[::60], rotation=90, fontdict={'fontsize':10})
ax2.set_title("Temperatur und Luftfeuchte Dachboden (33)", fontsize=22)
fig.tight_layout()

#plt.show()
plt.savefig(WebPfad + Geraet +'_' + Modul, transparent = False)

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Fri Nov 15, 2019 7:38 am

I forgot to mention: The behavior of the saved figure file is not as I expected. It's creation date never changes. I guess, the file is not overwritten but manipulated or changed in some way.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Drawing graphs in EG

Post by kgschlosser » Fri Nov 15, 2019 9:14 am

here is an updated save routine.

Code: Select all

from io import BytesIO

buf = BytesIO()
plt.savefig(
    buf,
    format='png',
    dpi=600,
    transparent=True,
    bbox_inches='tight',
    pad_inches=0.02
)
 buf.seek(0)
 
 # you can write the image data yourself is you like.
 with open(WebPfad + Geraet + '_' + Modul + '.png', 'wb') as f:
     f.write(buf.read())
     
 # or you can use PIL to handle the image data and saving it.
 from PIL import Image
 
 image = Image.open(buf)
 image.save(WebPfad + Geraet + '_' + Modul + '.png')
 
 

if there is a way for you to alter the data so that the Time is the seconds since epoch (unix time) instead of a string it would make things a wee bit easier.


as far as the corrupted data is concerned. The file you are writing is not a JSON file. It is a text file with lines that are json entries.
what is writing the data to the file? If you have multiple things trying to access the same file at the same time you can end up with a snafu. and because of how the entries are I am assuming that either the file is always in an opened state and when a new reading comes in that single entry is appended to the file. or the file is being opened the line written and then the file closed.

If you have the ability to load the data in the file on startup and hold that data. when a new reading comes in append the new reading to the held data.. write the data to a second file, delete the first file and then rename the second file to the first file. This way you can only have a single thing "writing" to the file and reading from it. if you are reading the file to plot the graph and on the opposite end it tries to delete the file the operating system is not going to allow that to happen and is going to throw an error on the side that is deleting the file. if the file is deleted and the plotting side tries to open a file that does not exist an error is going to be thrown. this can get handled easily and because the dta is already written and only a rename is taking place the data is there instantly and there is no chance of the file being read from while being written to at the same time.

The best practice when dealing with files that can be accessed by more then a single process or portion of a program is to keep the length of time the file is opened to as small a window as possible. So no processing in the context loop, what I mean by that is this.

This is pseudo code. I do not know how you are doing this portion of the program. This is only for example.

Code: Select all

# stored_data is assumed to be the already loaded data set.

with open('data_file.json', 'w') as f:
    for temp_unit, humidity, temperature, time in stroed_data:
        f.write('{"TempUnit": "' + temp_unit + '", "Humidity": ' + ''.join(dec + '.' + frac[0] for dec, frac in [str(humidity).split('.')]))
        f.write(', "Temperature": "''.join(dec + '.' + frac[0] for dec, frac in [str(temperature).split('.')]) + ', "Time": "' + time + '"}\n')
 
This is very bad to do because it is going to keep the file open for a long time.

This would be better to do.

Code: Select all

# stored_data is assumed to be the already loaded data set.


output_data = ''
for temp_unit, humidity, temperature, time in stroed_data:
    output_data += '{"TempUnit": "' + temp_unit + '", "Humidity": ' + ''.join(dec + '.' + frac[0] for dec, frac in [str(humidity).split('.')])
    output_data  += ', "Temperature": "''.join(dec + '.' + frac[0] for dec, frac in [str(temperature).split('.')]) + ', "Time": "' + time + '"}\n'
    
with open('data_file.json', 'w') as f:
	f.write(output_data)
    
 

This is also a better way because if for some reason there is an error in the program it is ot going to get "discovered" part way into writing the file causing data corruption when the program stops. all processing is done first. and if an error exists your saved data is in tact because the error happened before the file was ever opened for writing.

This is what I would do. your data set is really simple. Use csv ditch all the additional markers needed by JSON.

Code: Select all

C,47.2,21.0,2019-11-13T14:22:35
C,47.3,21.0,2019-11-13T14:27:35
C,47.4,20.9,2019-11-13T14:32:35
C,47.3,20.9,2019-11-13T14:37:35
C,47.5,20.9,2019-11-13T14:42:35
C,47.2,20.8,2019-11-13T14:47:35
C,47.4,20.9,2019-11-13T14:52:35

Code: Select all


with open('some_save_file.txt', 'r') as f:
    data = f.read()

# file is now closed. the lower the number of bytes the faster the read process. 
# Do not use readlines() there is quite a bit of additional overhead in order to get the actual EOL
# Take this as an examaple.

# this is a line of text \\n that newline is not the end of the line 

# readlines has to store the last character and if a new line is found then it has to check if the last character is "\"
# This is how it should be done to remove the processing while the file is opened.

data = data.splitlines(False)
for line in data:
    # the _ is the unit which is not used.
    _, humidity, temperature, date = data.split(',')
    x  += [datetime.strptime(date ,"%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
     y1 += [temperature]
     y2 += [humidity]

{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-13T14:22:35"} = 88 characters with newline

C,47.2,21.0,2019-11-13T14:22:35 - 32 characters with newline.

the latter is going to get read almost 3 times faster. because it is almost 1/3 of the number of bytes.

I now this does not seem like a whole lot. But remember the math. (60 / 5) * 24 * 365 = 105120 entries over a single year. I can toss ya a file that has over 100K lines in it and you can open it up in notepad and watch how long it takes if you ant a good example.

It is also pretty easy to test this

Code: Select all

data = '''\
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 21.0, "Time": "2019-11-13T14:22:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 21.0, "Time": "2019-11-13T14:27:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.9, "Time": "2019-11-13T14:32:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.9, "Time": "2019-11-13T14:37:35"}
{"TempUnit": "C", "Humidity": 47.5, "Temperature": 20.9, "Time": "2019-11-13T14:42:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-13T14:47:35"}
{"TempUnit": "C", "Humidity": 47.4, "Temperature": 20.9, "Time": "2019-11-13T14:52:35"}
{"TempUnit": "C", "Humidity": 47.3, "Temperature": 20.8, "Time": "2019-11-13T14:57:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-13T15:02:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.8, "Time": "2019-11-13T15:07:35"}
{"TempUnit": "C", "Humidity": 47.2, "Temperature": 20.9, "Time": "2019-11-13T15:12:35"}
{"TempUnit": "C", "Humidity": 47.1, "Temperature": 20.8, "Time": "2019-11-13T15:17:35"}
'''

data2 = '''\
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
C,47.2,21.0,2019-11-13T14:22:35
'''

with open('test.txt', 'w') as f:
    for _ in range(24*365):
        f.write(data)

with open('test2.txt', 'w') as f:
    for _ in range(24*365):
        f.write(data2)

import time
import json
from datetime import datetime

start = time.time()

with open('test.txt', 'r') as f:
    data = f.readlines()

x = []
y1 = []
y2 = []

for line in data:
     x  += [datetime.strptime(json.loads(line)["Time"],"%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
     y1 += [json.loads(line)["Temperature"]]
     y2 += [json.loads(line)["Humidity"]]

stop = time.time()

print('Number of records:', len(data), 'Duration:', stop - start, 'seconds')

start = time.time()

with open('test2.txt', 'r') as f:
    data = f.read()

data = data.splitlines(False)

x = []
y1 = []
y2 = []

for line in data:
    _, humidity, temp, date = line.split(',')
    x += [datetime.strptime(date, "%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
    y1 += [float(temp)]
    y2 += [float(humidity)]

stop = time.time()
print('Number of records:', len(data), 'Duration:', stop - start, 'seconds')
Number of records: 105120 Duration: 7.909214019775391 seconds
Number of records: 105120 Duration: 4.758008241653442 seconds

The bottom is with using my suggestions. it takes almost 1/2 the time to build x, y1 and y2

and then if you use the unix timestamp instead of the string formatted one.

Number of records: 105120 Duration: 7.784413576126099 seconds
Number of records: 105120 Duration: 1.4820024967193604 seconds

Now that my friend is a HUGE difference
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Drawing graphs in EG

Post by kgschlosser » Fri Nov 15, 2019 9:20 am

there is also the file size as well.

1 year with the json is 9,355,680 bytes
1 year csv with unix timestamps is 2,522,880 bytes
If you like the work I have been doing then feel free to Image

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Fri Nov 15, 2019 12:12 pm

It did not work. The picture is saved 4 times and then I get the error message

Code: Select all

12:59:01            Traceback (most recent call last):
12:59:01              Python script "155", line 78, in <module>
12:59:01                pad_inches=0.02
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\pyplot.py", line 695, in savefig
12:59:01                res = fig.savefig(*args, **kwargs)
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\figure.py", line 2062, in savefig
12:59:01                self.canvas.print_figure(fname, **kwargs)
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 828, in print_figure
12:59:01                filename, *args, **kwargs)
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\backend_bases.py", line 2212, in print_figure
12:59:01                **kwargs)
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 517, in print_png
12:59:01                FigureCanvasAgg.draw(self)
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 429, in draw
12:59:01                self.renderer = self.get_renderer(cleared=True)
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 454, in get_renderer
12:59:01                self.renderer = RendererAgg(w, h, self.figure.dpi)
12:59:01              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 101, in __init__
12:59:01                self._renderer = _RendererAgg(int(width), int(height), dpi)
12:59:01            MemoryError: In RendererAgg: Out of memory
Here the script:

Code: Select all

import matplotlib.pyplot as plt
import numpy as np
import json
from datetime import datetime

params = {
    'legend.fontsize': 16,
    'figure.figsize': (16, 10),
    'axes.labelsize': 16,
    'axes.titlesize': 16,
    'xtick.labelsize': 16,
    'ytick.labelsize': 16,
    'figure.titlesize': 22
}

plt.rcParams.update(params)
# plt.style.use('seaborn-whitegrid')

GeraetePfad = 'C:/Daten/Programmdaten/EventGhost/Geraete/' # Eingabe
WebPfad = 'C:/Daten/Programmdaten/EventGhost/web/'   # Ausgabe
Geraet = 'Sonoff-33'
Modul = 'AM2301'

# Datei öffnen
GeraeteDaten = open(GeraetePfad + Geraet +'_' + Modul + '.txt',"r")
# Zeilen in eine Liste laden
DatenZeilen = GeraeteDaten.readlines()

# Listen für die Grafik erzeugen
x = []
y1 = []
y2 = []

# Listen füllen
for Zeile in DatenZeilen:
#    x +=  [str(datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S"))]
     x  += [datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
     y1 += [json.loads(Zeile)["Temperature"]]
     y2 += [json.loads(Zeile)["Humidity"]]
   
#import sys
#sys.exit()

# Plot Line1 (Left Y Axis)
fig, ax1 = plt.subplots(1, 1, figsize=(16,9), dpi= 80)
ax1.plot(x, y1, color='tab:red')

# Plot Line2 (Right Y Axis)
ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.plot(x, y2, color='tab:blue')

# Decorations
# ax1 (left Y axis)
ax1.set_xlabel('Zeit', fontsize=20)
ax1.tick_params(axis='x', rotation=45, labelsize=12)
ax1.set_ylabel('Temperatur [C]', color='tab:red', fontsize=20)
ax1.tick_params(axis='y', rotation=0, labelcolor='tab:red' )
ax1.grid(alpha=.4)

# ax2 (right Y axis)
ax2.set_ylabel("Luftfeuchte [%]", color='tab:blue', fontsize=20)
ax2.tick_params(axis='y', labelcolor='tab:blue')
ax2.set_xticks(np.arange(0, len(x), 60))
ax2.set_xticklabels(x[::60], rotation=90, fontdict={'fontsize':10})
ax2.set_title("Temperatur und Luftfeuchte Dachboden (33)", fontsize=22)
fig.tight_layout()

#
from io import BytesIO

buf = BytesIO()
plt.savefig(
    buf,
    format='png',
    dpi=600,
    transparent=True,
    bbox_inches='tight',
    pad_inches=0.02
)
buf.seek(0)
 
 # you can write the image data yourself is you like.
with open(WebPfad + Geraet + '_' + Modul + '.png', 'wb') as f:
     f.write(buf.read())
And you are right. I need a more efficient way to store the date. The script runs 30 sec to build a picture.

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Fri Nov 15, 2019 12:24 pm

When I use the plt.show() I get not only one picture but several pictures. When closing the last picture by hand, EG starts new. On the next step I will try the script outside of EG.

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Fri Nov 15, 2019 12:28 pm

Every run of the script creates a new figure and every clothing by hand creates an error like

Code: Select all

13:25:39   Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
13:25:39     File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1243, in _onClose
13:25:39       Gcf.destroy(self.num)
13:25:39     File "C:\Python27\Lib\site-packages\matplotlib\_pylab_helpers.py", line 60, in destroy
13:25:39       manager.destroy()
13:25:39     File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1303, in destroy
13:25:39       self.frame.Destroy()
13:25:39     File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1262, in Destroy
13:25:39       wxapp.Yield()
13:25:39     File "wx\_core.pyc", line 7916, in Yield
13:25:39   PyAssertionError: C++ assertion "wxThread::IsMain()" failed at ..\..\src\msw\evtloop.cpp(182) in wxGUIEventLoop::Dispatch(): only the main thread can process Windows messages

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Fri Nov 15, 2019 5:54 pm

Upgrading to 0.5.0-rc6 changed nothing.

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Drawing graphs in EG

Post by kgschlosser » Sat Nov 16, 2019 6:11 am

you do not want the plt.show() in the script. unless it is for testing purposes.

That will display the plot using wxPython which is the graphics module in EG. That is going to chew up a lot of memory if a bunch of plots are opened up.
so remove that line.

You are also going to need to add plt.close() at the end of the script after you have saved it to a file. This is going to close the current plot. That could be the reason why you are seeing a bunch of them when you run plt.show() because it is going to plot out all of the figures it has that have not been closed.

so edit your script. makes those changes. save EG and restart it. then you should be good to go.

You may have been running into a memory issue because of the number of plots that wee not closed. You have to also remember that plotting is going to consume some memory and the larger the data set the more memory it is going to consume.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Drawing graphs in EG

Post by kgschlosser » Sat Nov 16, 2019 6:14 am

and as far as that last error is concerned. I am not sure what that is all about. I think it is in issue internally to matplotlib. I would have to see if I can replicate the problem, and if I can I would have to report it to the developers of matplotlib


******* EDIT ******

upon investigating that error you are seeing is because of plt.show() not being called from the main thread.

if you change the plt.show() to the code block below it should solve the issue.

Code: Select all

def do():
    plt.show()
    
wx.CallAfter(do)
If you like the work I have been doing then feel free to Image

HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Drawing graphs in EG

Post by HTPCanwender » Sat Nov 16, 2019 2:43 pm

Unfortunately nothing helped yet. Here is the actual code.

Code: Select all

import matplotlib.pyplot as plt
import numpy as np
import json
from datetime import datetime

params = {
    'legend.fontsize': 16,
    'figure.figsize': (16, 10),
    'axes.labelsize': 16,
    'axes.titlesize': 16,
    'xtick.labelsize': 16,
    'ytick.labelsize': 16,
    'figure.titlesize': 22
}

plt.rcParams.update(params)
# plt.style.use('seaborn-whitegrid')

GeraetePfad = 'C:/Daten/Programmdaten/EventGhost/Geraete/' # Eingabe
WebPfad = 'C:/Daten/Programmdaten/EventGhost/web/'   # Ausgabe
Geraet = 'Sonoff-33'
Modul = 'AM2301'

# Datei öffnen
GeraeteDaten = open(GeraetePfad + Geraet +'_' + Modul + '.txt',"r")
# Zeilen in eine Liste laden
DatenZeilen = GeraeteDaten.readlines()

# Listen für die Grafik erzeugen
x = []
y1 = []
y2 = []

# Listen füllen
for Zeile in DatenZeilen:
#    x +=  [str(datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S"))]
     x  += [datetime.strptime(json.loads(Zeile)["Time"],"%Y-%m-%dT%H:%M:%S").strftime("%d.%m.%Y, %H:%M")]
     y1 += [json.loads(Zeile)["Temperature"]]
     y2 += [json.loads(Zeile)["Humidity"]]
   
#import sys
#sys.exit()

# Plot Line1 (Left Y Axis)
fig, ax1 = plt.subplots(1, 1, figsize=(16,9), dpi= 80)
ax1.plot(x, y1, color='tab:red')

# Plot Line2 (Right Y Axis)
ax2 = ax1.twinx()  # instantiate a second axes that shares the same x-axis
ax2.plot(x, y2, color='tab:blue')

# Decorations
# ax1 (left Y axis)
ax1.set_xlabel('Zeit', fontsize=20)
ax1.tick_params(axis='x', rotation=45, labelsize=12)
ax1.set_ylabel('Temperatur [C]', color='tab:red', fontsize=20)
ax1.tick_params(axis='y', rotation=0, labelcolor='tab:red' )
ax1.grid(alpha=.4)

# ax2 (right Y axis)
ax2.set_ylabel("Luftfeuchte [%]", color='tab:blue', fontsize=20)
ax2.tick_params(axis='y', labelcolor='tab:blue')
ax2.set_xticks(np.arange(0, len(x), 60))
ax2.set_xticklabels(x[::60], rotation=90, fontdict={'fontsize':10})
ax2.set_title("Temperatur und Luftfeuchte Dachboden (33)", fontsize=22)
fig.tight_layout()

from io import BytesIO

buf = BytesIO()
plt.savefig(
    buf,
    format='png',
    dpi=600,
    transparent=True,
    bbox_inches='tight',
    pad_inches=0.02
)
buf.seek(0)
 
 # you can write the image data yourself is you like.
with open(WebPfad + Geraet + '_' + Modul + '.png', 'wb') as f:
     f.write(buf.read())
#    
# or you can use PIL to handle the image data and saving it.
#from PIL import Image

#image = Image.open(buf)
#image.save(WebPfad + Geraet + '_' + Modul + '.png')
plt.close()
And here the corresponding extract from the EG log. The lines without a time are my comments, written manually.

Code: Select all

1st run, no errors, calculation time 50 sec
14:44:25         Bild Echtdaten erzeugen
14:45:15         Sonoff-33 AM2301 an Dashboard

2nd run, no errors, calculation tim 42 sec
14:49:25         Bild Echtdaten erzeugen
14:50:07         Sonoff-33 AM2301 an Dashboard

3rd run, no errors, calculation time 44 sec
14:54:25         Bild Echtdaten erzeugen
14:55:09         Sonoff-33 AM2301 an Dashboard

4th run, error: attribute access no longer allowed, calculation time 42 sec
14:59:25         Bild Echtdaten erzeugen
15:00:07            Traceback (most recent call last) (0.5.0-rc6):
15:00:07              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 876, in _onSize
15:00:07                if self._width <= 1 or self._height <= 1:
15:00:07              File "wx\_core.pyc", line 16711, in __getattr__
15:00:07            PyDeadObjectError: The C++ part of the FigureCanvasWxAgg object has been deleted, attribute access no longer allowed.
15:00:08         Sonoff-33 AM2301 an Dashboard

5th run, error: only the main thread can process Windows messages, calculation tim 42 sec
15:04:25         Bild Echtdaten erzeugen
15:05:07            Traceback (most recent call last):
15:05:07              Python script "155", line 90, in <module>
15:05:07                plt.close() 
15:05:07              File "C:\Python27\Lib\site-packages\matplotlib\pyplot.py", line 643, in close
15:05:07                _pylab_helpers.Gcf.destroy(figManager.num)
15:05:07              File "C:\Python27\Lib\site-packages\matplotlib\_pylab_helpers.py", line 60, in destroy
15:05:07                manager.destroy()
15:05:07              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1303, in destroy
15:05:07                self.frame.Destroy()
15:05:07              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1262, in Destroy
15:05:07                wxapp.Yield()
15:05:07              File "wx\_core.pyc", line 7916, in Yield
15:05:07            PyAssertionError: C++ assertion "wxThread::IsMain()" failed at ..\..\src\msw\evtloop.cpp(182) in wxGUIEventLoop::Dispatch(): only the main thread can process Windows messages
15:05:07         Sonoff-33 AM2301 an Dashboard

6th run, error: Out of memory, calculation time 23 sec
15:09:25         Bild Echtdaten erzeugen
15:09:48            Traceback (most recent call last):
15:09:48              Python script "155", line 77, in <module>
15:09:48                pad_inches=0.02
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\pyplot.py", line 695, in savefig
15:09:48                res = fig.savefig(*args, **kwargs)
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\figure.py", line 2062, in savefig
15:09:48                self.canvas.print_figure(fname, **kwargs)
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 828, in print_figure
15:09:48                filename, *args, **kwargs)
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\backend_bases.py", line 2263, in print_figure
15:09:48                **kwargs)
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 517, in print_png
15:09:48                FigureCanvasAgg.draw(self)
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 429, in draw
15:09:48                self.renderer = self.get_renderer(cleared=True)
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 454, in get_renderer
15:09:48                self.renderer = RendererAgg(w, h, self.figure.dpi)
15:09:48              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 101, in __init__
15:09:48                self._renderer = _RendererAgg(int(width), int(height), dpi)
15:09:48            MemoryError: In RendererAgg: Out of memory
15:09:48         Sonoff-33 AM2301 an Dashboard

7th run, error: Out of memory, calculation time 2 sec
15:14:25         Bild Echtdaten erzeugen
15:14:27            Traceback (most recent call last):
15:14:27              Python script "155", line 77, in <module>
15:14:27                pad_inches=0.02
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\pyplot.py", line 695, in savefig
15:14:27                res = fig.savefig(*args, **kwargs)
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\figure.py", line 2062, in savefig
15:14:27                self.canvas.print_figure(fname, **kwargs)
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_wx.py", line 828, in print_figure
15:14:27                filename, *args, **kwargs)
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\backend_bases.py", line 2212, in print_figure
15:14:27                **kwargs)
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 517, in print_png
15:14:27                FigureCanvasAgg.draw(self)
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 429, in draw
15:14:27                self.renderer = self.get_renderer(cleared=True)
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 454, in get_renderer
15:14:27                self.renderer = RendererAgg(w, h, self.figure.dpi)
15:14:27              File "C:\Python27\Lib\site-packages\matplotlib\backends\backend_agg.py", line 101, in __init__
15:14:27                self._renderer = _RendererAgg(int(width), int(height), dpi)
15:14:27            MemoryError: In RendererAgg: Out of memory
15:14:27         Sonoff-33 AM2301 an Dashboard
If nothing helps, I am tending to compile the code to a windows executable an start it from Eventghost.

Post Reply