ZWave binding updates

@chris Is using daily zwave heal safe/working as expected in 2.5.8 ?

You will be fine with changed. You’re also probably only concerned with when the Thing goes to OFFLINE, which would simplify things.

The core.rules.rule decorator creates the log attribute for you.

It would be found and executed anywhere under /automation/jsr223/. The directory you stated uses the directory structure that I have recommended for use with the helper libraries.

    zwave_thing_alert.log.warn("things.get(event.thingUID).properties: {}".format(things.get(event.thingUID).properties))

This returns a java.util.Collections.unmodifiableMap(), not a dict. So, you’ll need to use the Map methods.

    zwave_thing_alert.log.warn("things.get(event.thingUID).properties.get(\"modelId\"): {}".format(things.get(event.thingUID).properties.get("modelId")))

You are using Jython, so you can use and access Java classes, interfaces, etc. One of the methods for Map is get, which makes it very easy to think you are dealing with a dict. To be sure of what type of object you are dealing with, just use type

    zwave_thing_alert.log.warn("type(things.get(event.thingUID).properties): {}".format(type(things.get(event.thingUID).properties)))
2020-08-24 17:44:00.878 [WARN ] [jython.Alert: Z-Wave Thing] - type(things.get(event.thingUID).properties): <type 'java.util.Collections$UnmodifiableMap'>
1 Like