This has been a known issue for a while, and would require an update to the binding to resolve permanently. Here is a patch that can be applied to make it work. I hope that it can be included in a future release.
Stelpro Ki STZW402+: sending outdoor temperature to the display (Z-Wave binding patch)
The STZW402+ can show the outdoor temperature instead of the setpoint, if the controller sends it a temperature over Z-Wave. The openHAB Z-Wave binding’s definition for this device (opensmarthouse database entry #315) has no channel that can send a value to the thermostat.
The binding already supports this through the sensor_report channel type, which the Eurotronic and Aeotec Spirit thermostats use. The patch below copies that channel into the Stelpro definition inside the binding jar. It changes no Java code.
Tested on: openHAB 5.0.3 / Z-Wave binding 5.0.3.
Thermostat notes
- Turn on advanced setting 4 (Outdoor temperature display). Hold UP+DOWN for 3 s, step to 4, press UP+DOWN once, choose On, press UP+DOWN once to confirm, then hold UP+DOWN for 3 s to exit.
- The outdoor value replaces the setpoint on the display.
- The display rounds to the nearest 0.5 °C.
- If no value arrives for 4 hours, the setpoint comes back, so resend periodically.
Steps
This replaces the running Z-Wave binding bundle. The change is lost on any openHAB upgrade or cache clean, so re-apply it afterwards. Back up first.
-
Find your binding jar. On a standard Linux install it’s at:
/var/lib/openhab/tmp/kar/openhab-addons-<ver>/org/openhab/addons/bundles/org.openhab.binding.zwave/<ver>/org.openhab.binding.zwave-<ver>.jar -
Copy it to a working folder, save the script below as
patch_stelpro.py, and run:python3 patch_stelpro.py org.openhab.binding.zwave-<ver>.jar PATCHED-org.openhab.binding.zwave-<ver>.jarThe original jar is not modified.
-
Put the patched jar (and a copy of the original, for rollback) somewhere the
openhabuser can read, e.g./var/lib/openhab/zwave-patch/. -
In the Karaf console (
openhab-cli console):bundle:list -s | grep -i zwave bundle:update <ID> file:/var/lib/openhab/zwave-patch/PATCHED-org.openhab.binding.zwave-<ver>.jarUse
-s: the plain list shows the name as “Z-Wave”, whichgrep zwavewon’t match. The Z-Wave network restarts and takes about a minute to come back. -
Each STZW402 thing should now have an External temperature (
sensor_report) channel. Link a Number item to it; any number you send it appears on the display in °C.
Rollback: run the same bundle:update command, pointing at the original jar.
patch_stelpro.py (Python 3, standard library only):
# patch_stelpro.py - add a sensor_report (external temperature) channel to the
# Stelpro STZW402 thing definition inside the openHAB Z-Wave binding jar.
#
# Copies the original jar entry-by-entry into a new jar, replacing only
# OH-INF/thing/stelpro/stzw402_0_0.xml with a version that has a sensor_report
# channel inserted after sensor_temperature. The channel block is the same one
# the binding uses for the Eurotronic/Aeotec Spirit, so the binding's existing
# multilevel-sensor converter sends a SENSOR_MULTILEVEL temperature report
# (scale 0 = Celsius) to the thermostat. The original jar is never written.
#
# Usage: python3 patch_stelpro.py <original.jar> <patched.jar>
import sys
import zipfile
SRC, DST = sys.argv[1], sys.argv[2]
ENTRY = "OH-INF/thing/stelpro/stzw402_0_0.xml"
ANCHOR = """ <property name="binding:*:QuantityType">COMMAND_CLASS_SENSOR_MULTILEVEL;type=TEMPERATURE</property>
</properties>
</channel>
"""
BLOCK = """ <channel id="sensor_report" typeId="sensor_report">
<label>External temperature</label>
<properties>
<property name="binding:*:DecimalType">COMMAND_CLASS_SENSOR_MULTILEVEL;type=TEMPERATURE</property>
</properties>
</channel>
"""
MARKER = """<!-- LOCAL PATCH: added sensor_report channel (External temperature,
COMMAND_CLASS_SENSOR_MULTILEVEL type=TEMPERATURE) after sensor_temperature.
Block copied from the binding's eurotronic/spirit_0_0.xml. -->
"""
with zipfile.ZipFile(SRC) as zin:
xml = zin.read(ENTRY).decode("utf-8")
if 'typeId="sensor_report"' in xml:
sys.exit("already patched")
if xml.count(ANCHOR) != 1:
sys.exit("anchor not found exactly once")
xml = xml.replace(ANCHOR, ANCHOR + BLOCK, 1)
decl_end = xml.index("?>") + 2
xml = xml[:decl_end] + "\n" + MARKER + xml[decl_end + 1:]
with zipfile.ZipFile(DST, "w") as zout:
for info in zin.infolist():
data = xml.encode("utf-8") if info.filename == ENTRY else zin.read(info.filename)
zout.writestr(info, data)
print("patched ->", DST)
The script exits without writing anything if the jar is already patched, or if the device definition doesn’t match what it expects (for example, if a future binding release changes it).
The permanent fix is to add this channel to opensmarthouse database entry #315, after which it would ship in a future binding release.