- Code: Select all
Z-Wave received "Weather Station" sensor update to 21%
Z-Wave received "Weather Station" sensor update to 88%
the lines are identical. There is no way to separate them besides sequence.
(and by the way battery also has a %)
and
if re.search(searchLine + ".*%", logevent):
only looks for anything+% and it takes the first (= last occurrence in the log file)
if the sequence is always the same we could do something, if not I don't know how to solve this.
to find the first and last one with %:
- Code: Select all
found = False
for logevent in reversed(log):
if logevent.find(searchLine) > -1:
if logevent.find("%") > -1:
if not found
found = True
luftfuktighet = logevent.split(" ")[7] # [69:72]
indigo.server.log(" Weather Station Luftfuktighet found in eventLog: ["+luftfuktighet+"]")
indigo.variable.updateValue(386320416, value=luftfuktighet ) # "WSluftfuktighet"
else:
otherValue = logevent.split(" ")[7] # [69:72]
indigo.server.log(" otehr line found : ["+otherValue+"]")
indigo.variable.updateValue(123123123, value=otherValue ) # "otherValue"
break
this will do 2 lines with %
first = humidity and 2. with a % for your other variable
if I understand this correctly
Karl