diff --git a/get-sensors.py b/get-sensors.py index 80880a9..bc10628 100644 --- a/get-sensors.py +++ b/get-sensors.py @@ -55,7 +55,7 @@ p = re.compile("([a-fA-F0-9]{2}:?){8}") sensors = collections.defaultdict(list); for key in json_data: - if "uniqueid" in json_data[key]: + if "uniqueid" in json_data[key] and json_data[key]['state']: if p.search(json_data[key]['uniqueid']): if json_data[key]['type'] == 'ZLLPresence': sensors[json_data[key]['uniqueid'][:-8]].insert(0, key)