Code: Select all
eg.plugins.ClimateDataCalculation.TempDataCapture(u'Ute', u'60160', 1, 20.0, 5, False, 2.0, False, u'equal-less-greater')Code: Select all
eg.plugins.ClimateDataCalculation.TempDataCapture(u'Ute')Code: Select all
eg.plugins.ClimateDataCalculation.TempDataCapture(u'Ute', u'60160', 1, 20.0, 5, False, 2.0, False, u'equal-less-greater')Code: Select all
eg.plugins.ClimateDataCalculation.TempDataCapture(u'Ute')Code: Select all
eg.plugins.ClimateDataCalculation.TempDataCapture(u'Living room', u'livingroom', 1, 20.0, 5, False, 2.0, False, u'equal-less-greater')
I will look into this. Just moved everything from a win 7 32bit to a win 7 64bit machine so some tweaking has to be donekrambriw wrote:If you would like to try, you could modify the code in the CreateComboHtml.py file. In the current implementation I insert a 'null' when an expected data point is missing. This will then be presented as a gap (or broken line) in the graph, this is how HighCharts is handling this and I think it is good in general.
In this case where you are sampling only once per hour, it will however not look so good. The idea here is to fill the gaps with last known value instead of the 'null'
If you look at the code (the part below starting from line 188) you see the part that is looping through your data points and appending found values to the data that is going to be used in the graph. If a data point is expected but missing, a 'null' is inserted.
If we instead would insert the last known value, the code could look like this:
Code: Select all
for row in rows: rd = float("%.2f" % row[pos]) if bFirstDone: rd_old = float("%.2f" % row_old[pos]) diff, d = days_hours_minutes( datetime.strptime(str(row[0][:-3]), '%Y-%m-%d %H:%M') - datetime.strptime(str(row_old[0][:-3]), '%Y-%m-%d %H:%M') ) if diff > 0: for i in range(diff-1): data.append(rd_old) diff = 0 if rd == 0.0: data.append('null') else: data.append(rd) else: s, d = days_hours_minutes( d1 - datetime.strptime(str(rows[0][0][:-3]), '%Y-%m-%d %H:%M') ) if sedt[0] - s > 0: for i in range(sedt[0] - s): data.append('null') data.append(rd) bFirstDone = True row_old = row
If you change, please note that this modification needs be repeated for all chart types you would like to behave like this (MakeChart. MakeChart_10 etc...)
BR
No, that is not the way. We have to replace the ',' with '.'Im pretty sure if I exchange float for int it will be fine
Code: Select all
t = '17,5'
Code: Select all
t = '17,5'.replace(',','.')
Code: Select all
if eg.event.suffix.find('.ZWave/')!= -1: #For Z-Wave
A = re.split(r'["]\s*', eg.event.payload)
B = re.split(r'[.]\s*', eg.event.suffix)[1].split('/')[1]
if B == deviceCode and A[3] == 'Sensor.Temperature':
addr = B
t = A[7].replace(',','.')
temperature = float("%.2f" % float(t))
print 'temperature:', temperature
This is golden.krambriw wrote:I would assume this code should work. Please try and replace
Best regards, Walter
Code: Select all
if eg.event.suffix.find('.ZWave/')!= -1: #For Z-Wave A = re.split(r'["]\s*', eg.event.payload) B = re.split(r'[.]\s*', eg.event.suffix)[1].split('/')[1] if B == deviceCode and A[3] == 'Sensor.Temperature': addr = B t = A[7].replace(',','.') temperature = float("%.2f" % float(t)) print 'temperature:', temperature
Code: Select all
08:44:17 Exception in thread Thread-46873:
08:44:17 Traceback (most recent call last):
08:44:17 File "threading.pyc", line 532, in __bootstrap_inner
08:44:17 File "threading.pyc", line 484, in run
08:44:17 File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\__init__.py", line 1566, in CaptureTemp
08:44:17 rule
08:44:17 File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\__init__.py", line 624, in SaveTempData
08:44:17 saveTempThread.start()
08:44:17 File "threading.pyc", line 474, in start
08:44:17 error: can't start new thread
08:44:17 Code: Select all
09:30:20
09:30:20 Exception in thread Thread-43669:
09:30:20 Traceback (most recent call last):
09:30:20 File "threading.pyc", line 532, in __bootstrap_inner
09:30:20 File "threading.pyc", line 484, in run
09:30:20 File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\__init__.py", line 1558, in CaptureTemp
09:30:20 rule
09:30:20 File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\__init__.py", line 617, in SaveTempData
09:30:20 saveTempThread.start()
09:30:20 File "threading.pyc", line 474, in start
09:30:20 error: can't start new thread
09:30:20
09:30:20 RFXtrx.Type: Viking 02811 id: 6144 ' temperature: +7.1 deg C signal: 5 battery: 9'
09:30:22 RFXtrx.Type: Viking 02811 id: 26368 ' temperature: +11.1 deg C signal: 5 battery: 9'
09:30:22 Biljardrom.: Temperatur: 11.1, termostattemperatur: 5, tidspunkt: Kl. 09:30, den 29.12.
09:30:22
09:30:23 RFXtrx.Type: Viking 02811 id: 57088 ' temperature: +17.9 deg C signal: 5 battery: 9'
09:30:23 Hjørnesoverom.: Temperatur: 17.9, termostattemperatur: 20, tidspunkt: Kl. 09:30, den 29.12.
09:30:23
09:30:23 Traceback (most recent call last) (1706):
09:30:23 File "C:\Program Files (x86)\EventGhost\eg\Classes\Scheduler.py", line 158, in MainLoop
09:30:23 Exception in thread Thread-43677:
09:30:23 func(*args, **kwargs)
09:30:23 Traceback (most recent call last):
09:30:23 File "C:\Program Files (x86)\EventGhost\eg\Classes\Scheduler.py", line 52, in LongTask
09:30:23 File "threading.pyc", line 532, in __bootstrap_inner
09:30:23 thrd.start()
09:30:23 File "threading.pyc", line 474, in start
09:30:23 error: can't start new thread
09:30:23 File "threading.pyc", line 484, in run
09:30:23 File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\__init__.py", line 1558, in CaptureTemp
09:30:23 rule
09:30:23 File "C:\Program Files (x86)\EventGhost\plugins\ClimaDataCalculation\__init__.py", line 617, in SaveTempData
09:30:23 saveTempThread.start()
09:30:23 File "threading.pyc", line 474, in start
09:30:23 error: can't start new thread
09:30:23