Hi,
I have a combined Washer and Dryer machine at home. Because I want different notifications for different programms I try to use persistence to figure out which Programm has finished. Washing machine programms always have a power peak which is greater then 800.0. I’ll tried maximumSince start time and look whether there is this peak inside but my condition always is evaluated as true.
Here is the relevant code:
max_leistung = PersistenceExtensions.maximumSince(itemRegistry.getItem("leistungWaschmaschine"), start).state
programm = "Waschmaschine ist"
if max_leistung > 800.0:
#washing machine code here
else:
programm = "Trockner ist"
#dryer code here
waschmaschine.log.info(u"{} ist fertig: start: {} max_leistung: {}, reingung: {}".format(programm, start, max_leistung, reinigung))
Here is the log output for the last dryer run which was wrong detected as washing machine even though max_leistung is below 800.0:
2020-01-14 22:45:23.978 [INFO ] [jsr223.jython.Waschmaschine ] - Waschmaschine ist ist fertig: start: 2020-01-14T19:51:44.000+01:00 max_leistung: 461.41, reingung: 0
Thanks in advantage