[SOLVED] Heatit z-trm2 anyone tried it in OH2?

Sorry - I didn’t realise that it works in PaperUI, and doesn’t work if you use a rule. To me, I would suggest that this is not a binding issue.

I would suggest to check the logs for both types to see what the difference is. Please provide the logs so we can see what is happening.

Sorry my msitake. It does not. But in PaperUI I can see that the UI does not pickup the correct type for setpoints (QuantityType) either. For temperature everything looks fine. Check this screenshot:Capture

As you can see, both mapped and defined items for temperature are shown correctly in PaperUI for the temperature channel:

<channel id="sensor_temperature" typeId="sensor_temperature">
        <label>Sensor (temperature)</label>
        <properties>
          <property name="binding:*:QuantityType">COMMAND_CLASS_SENSOR_MULTILEVEL;type=TEMPERATURE</property>
        </properties>
</channel>

But for the setpoint channel (the second one), only the defined one in the items file seems to be displayed correctly. The mapped item from the channel definition did not pick up the correct type, so it is shown without any units, although in the channel definition the QunatityType has been set:

<channel id="thermostat_setpoint_heating" typeId="thermostat_setpoint">
        <label>Setpoint (heating)</label>
        <properties>
          <property name="binding:*:QuantityType">COMMAND_CLASS_THERMOSTAT_SETPOINT;type=HEATING</property>
        </properties>
 </channel>

Somehow I think for the typeId="thermostat_setpoint" the QunatityType defintion is not being matched in the OH2 core.

Maybe @Kai can support here. Thanks

What do you mean?

The binding is receiving a QuantityType - correct?

Sorry - I’m not really sure I understand your configuration completely. Also, what version of the binding are you now using? Are you still using your version or the supplied version? I’m not sure it will make any difference, but I would like to understand.

Please provide a log as requested. The only way I can see in the software that it would not return a QuantityType is if there is no scale provided -:

        switch (setpointEvent.getScale()) {
            case 0:
                return new QuantityType<>(value, SIUnits.CELSIUS);
            case 1:
                return new QuantityType<>(value, ImperialUnits.FAHRENHEIT);
            default:
                logger.debug("NODE {}: Unknown temperature scale {}", event.getNodeId(), setpointEvent.getScale());
                break;
        }

As you see, there would also be a debug message reported.

@chris

for the display issue in PaperUI this has been solved by modifiying the channels.xml and rebuilding the binding like this:

<!-- Heating Setpoint Channel -->
    <channel-type id="thermostat_setpoint">
        <item-type>Number:Temperature</item-type>
        <label>Heating Setpoint</label>
        <description>Sets the thermostat setpoint</description>
        <category>Temperature</category>
        <state readOnly="false" pattern="%.1f %unit%" />
        <config-description>
            <parameter name="config_scale" type="text">
                <label>Scale</label>
                <description>Select the scale to use for setpoints.</description>
                <default>0</default>
                <options>
                    <option value="0">Celsius</option>
                    <option value="1">Fahrenheit</option>
                </options>
            </parameter>
        </config-description>
    </channel-type>

so now it is showing correctly as it should:

Capture

As for the original issue, the problem is still occurring. attached a complete log for this. It occurs with nodes 5,6,7,8,11 and 13.

Logs

Could you please send me link to your latest dev binding so I can test it tonight? Thanks

Is it just the state with the %unit% you added or was there something else ? I guess this could also be added in your items file? I forget why I didn’t add this when I updated the channels - there was a reason at the time, but I forget what it was now :roll_eyes:.

It is always available on the first post of the dev binding thread.

@chris

Yes only this line:

I guess I found something in the code why the issue occurring. I am building it at the moment to see if it works.

Strange - this was updated quite a while ago I thought :confused: .

@chris
just tested the change. It is throwing an exception now.

2018-07-24 20:20:56.234 [ome.event.ItemCommandEvent] - Item 'spHeatRoomSensor2' received command 12 °C

==> /var/log/openhab2/openhab.log <==

2018-07-24 20:20:56.247 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.zwave.handler.ZWaveThingHandler@16dfc00': org.eclipse.smarthome.core.library.types.QuantityType cannot be cast to org.eclipse.smarthome.core.library.types.DecimalType

java.lang.ClassCastException: org.eclipse.smarthome.core.library.types.QuantityType cannot be cast to org.eclipse.smarthome.core.library.types.DecimalType

	at org.openhab.binding.zwave.internal.converter.ZWaveThermostatSetpointConverter.receiveCommand(ZWaveThermostatSetpointConverter.java:133) [239:org.openhab.binding.zwave:2.4.0.201807241749]

	at org.openhab.binding.zwave.handler.ZWaveThingHandler.handleCommand(ZWaveThingHandler.java:1078) [239:org.openhab.binding.zwave:2.4.0.201807241749]

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [94:org.eclipse.smarthome.core:0.10.0.201807081340]

	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [94:org.eclipse.smarthome.core:0.10.0.201807081340]

	at com.sun.proxy.$Proxy182.handleCommand(Unknown Source) [239:org.openhab.binding.zwave:2.4.0.201807241749]

	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [101:org.eclipse.smarthome.core.thing:0.10.0.201807081340]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [101:org.eclipse.smarthome.core.thing:0.10.0.201807081340]

	at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [94:org.eclipse.smarthome.core:0.10.0.201807081340]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [94:org.eclipse.smarthome.core:0.10.0.201807081340]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?] 

I will test your binding tomorrow early and give you feedback.
Cheers

@chris: I believe it is solved now with this simple change

cheers

Ok, I’ll check this to see if how this is different to what’s in the binding at the moment. From a quick look, it looks similar, but I’ll check when I get a chance.

Thanks
Chris

I checcked the current binding and I think it’s pretty similar -:

        BigDecimal value;
        if (command instanceof QuantityType) {
            QuantityType<?> quantity = (QuantityType<?>) command;
            if (quantity.getUnit() == SIUnits.CELSIUS) {
                scale = 0;
            } else if (quantity.getUnit() == ImperialUnits.FAHRENHEIT) {
                scale = 1;
            }
            value = quantity.toBigDecimal();
        } else if (command instanceof DecimalType) {
            value = ((DecimalType) command).toBigDecimal();
        } else {
            logger.debug("NODE {}: Thermostat command received with unsupported type {}", node.getNodeId(),
                    command.getClass().getSimpleName());

            return null;
        }

Do you want to try this code in your version, or try the latest development version to see if it is working?

Online User Manual now available:

There they boast a 2.9 firmware. My device has 2.6.
@chris what is the best Firmware upgrade route do you think? Any plans to support OTA in OH2?

IC.
I have also contacted the manufacturer for advice.
Will report back when they reply.

The situation is pretty much as the post @sihui linked to. There are currently no known manufacturers who supply the updates - once a few start to release the binary files, then I’m happy to look at OTA in the binding (I’ve already implemented it in ZigBee where suppliers are more open to providing the binaries).

Jury is still out regarding the firmware file.
In the mean time, my local z-wave pusher had a 18% discount on the z-trm2 so I bought a few more :slight_smile:

Two of my thermostats are mounted as Power regulators (1-10 setting ON/OFF duty), mounted in another room.
The z-trm2 also supports this mode, but only as parameter 12 (even though doc states it does not)
image

Since I’m planning on monitoring the temperature using Aeon multisensor6 in the actual rooms I will need to set this parameter from a rule.

@chris Is it possible to make parameter 12 available via a channel, or is it possible to send new parameter values from a rule?

Yes, I will add this.

Unfortunately ESH doesn’t provide this feature (at the moment at least).

Nice.
While you’re at it:
image

Will make it possible to turn off display in bedroom at night :slight_smile:

Done…

I’ll do a binding update tonight or tomorrow…

1 Like

Did the new channels make it to?: