HeatIt Z-Scene Controller, how to use indicator command class

Can you tell me what doesn’t work? Or at least tell me how you’ve tested this? Are you generating your own binding? Or have you somehow modified an existing binding?

Yes, normally for a ZWave + device, only the lifeline is required to communicate with the controller. Some devices require other associations, but most don’t and normally it’s best not to configure them.

Ok,
I’ve added the channel in the Database, exported the openHab2 XML File and edited the JAR-File (with renaming it to ZIP, open in Windows Explorer and replace the scenecontroller_0_0.xml file).
Then I’ve deleted and rediscovered the Device in Paper UI. The new added Channel appears, I linked it to an Item.
openhab.log (30.4 KB)
I’ve added the logfile from device discovery.
Hm, what is, what is not working… when I change the Item through Paper UI, I can read Command for unknown channel zwave:device:a2951589:node5:indicator_level with PercentType in the Logfile and the LED does nothing.

The binding is expecting a number - it should work with the percent, but it might need some changes so I’d try using a number type directly.

Hm, now I’m in trouble.
1st, I’ve tried to create a new number item and link to the channel in paper UI, this does’t work (it’s not a choice).
2nd, I’ve created a new Item in items-File and linked to the channel.

Number lcd_backlight_number {channel="zwave:device:a2951589:node5:indicator_level"}

Then, I’ve send a update and command to this item via karaf console (smarthome:update, smarthome:send), but the ZWave log shows nothing. What I’m doing wrong?

11:36:56.163 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'lcd_backlight_number' received command 100
11:36:56.166 [INFO ] [arthome.event.ItemStatePredictedEvent] - lcd_backlight_number predicted to become 100
11:36:56.168 [INFO ] [smarthome.event.ItemStateChangedEvent] - lcd_backlight_number changed from 1 to 100
11:37:43.192 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'lcd_backlight_number' received command 0
11:37:43.192 [INFO ] [arthome.event.ItemStatePredictedEvent] - lcd_backlight_number predicted to become 0
11:37:43.192 [INFO ] [smarthome.event.ItemStateChangedEvent] - lcd_backlight_number changed from 100 to 0

I wish it was that simple :slightly_smiling_face:

You also need to be sure to remove the old binding. Double check with list -s | grep zwave in the console. You then need to manually install the dependencies, unless you have another binding installed that shares them, like Zigbee. Details are documented here.

Hi @5iver, thanks,

list -s | grep zwave
250 │ Active │  80 │ 2.5.3                   │ org.openhab.binding.zwave
openhab>                                                                   

so I think there is not the problem.
I did a fresh install and only manually installed the zwave binding on developing machine.

I would agree - since the channel is showing up in PaperUI, I think the new binding is running.

Try to export the XML from the database again - I’ve changed the type to PercentType for now.

Now I get following exception:

12:33:28.687 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'ZWaveNode005HeatitZSceneControllerPushButton6Gang_LCDBacklight' received command 13
12:33:28.687 [INFO ] [arthome.event.ItemStatePredictedEvent] - ZWaveNode005HeatitZSceneControllerPushButton6Gang_LCDBacklight predicted to become 13
12:33:28.687 [INFO ] [smarthome.event.ItemStateChangedEvent] - ZWaveNode005HeatitZSceneControllerPushButton6Gang_LCDBacklight changed from NULL to 13
12:33:28.687 [DEBUG] [nding.zwave.handler.ZWaveThingHandler] - NODE 5: Command received zwave:device:a2951589:node5:indicator_level --> 13 [PercentType]
12:33:28.687 [ERROR] [rnal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.zwave.handler.ZWaveThingHandler@1b0d62dd': Name is null
java.lang.NullPointerException: Name is null
        at java.lang.Enum.valueOf(Enum.java:236) ~[?:1.8.0_252]
        at org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveIndicatorCommandClass$IndicatorType.valueOf(ZWaveIndicatorCommandClass.java:1) ~[?:?]
        at org.openhab.binding.zwave.internal.converter.ZWaveIndicatorConverter.receiveCommand(ZWaveIndicatorConverter.java:145) ~[?:?]
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.handleCommand(ZWaveThingHandler.java:1181) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
        at com.sun.proxy.$Proxy306.handleCommand(Unknown Source) [?:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_252]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_252]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

Ok, the Exception results on missing Configuration on Export (type=LCD_BACKLIGHT).
I’ve added this manually to the XML File, now I get no error in thie Logfile.
Unfortanly the LED is not switchable.

(for BUTTON1_INDICATION, therefore 41?).

When I use Z-Wave PC Controller, the Indicator Command works.

The different: I used Property ID Binary. The Z-Wave Binding use MULTILEVEL.

Multilevel doesn’t work…
Edit: also the manual says binary.
What can I do to change this?

Hi @chris,

I had take a look at the source code.
I don’t understand much of them, but possibly BINARY is not yet supported (because I don’t find it)?

Should I create an issue for that?
The next point is, can you delete the newly created INDICATOR channels from the device database if it is really not supports at time? It seems to be a part of waste at the moment.

Hi @chris,
Now I downloaded the source, set up a developement environment and tried to fix the problem by myself.
The initial problem is, that BINARY is not yet supported. This seems not to be a problem to add, only a few lines of code.
To decide, if it is BINARY or MULTILEVEL (as default to keep backward compatibility), I added a second (optional) configuration parameter to the device database (file is manually edited since the database doesn’t export configurations for indicator_level).

  <channel id="indicator_level" typeId="indicator_level">
    <label>LED 1</label>
    <properties>
      <property name="binding:*:PercentType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,property=BINARY</property>
    </properties>
  </channel>

This is to the Endpoint 0 and works fine with my modifications (and my use case).

If I want to use another Endpoint, the property seems not to be parsed correctly (in ZWaveThingHandler.initialiseNode or getZWaveProperties)

  <channel id="indicator_level1" typeId="indicator_level">
    <label>LED 1</label>
    <properties>
      <property name="binding:*:PercentType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,property=BINARY:1</property>
    </properties>
  </channel>

Is the definition correct? When not, what is the correct position for the endpoint (:1)?
It is not possible to bring the second (last) configuration parameter up to the ZWaveIndicatorConverter.

I was not yet able to get the debugger working so it is some kind of blind developing and needs MANY time unfortanly.
Hope you can help, that I do things correct (I’m not a JAVA developer, so I have to learn so much things…).
Thank you for your help,
Daniel

Edit: I’ve found it by myself.
Before the the endpoint a comma is needed

COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,property=BINARY,:1

Sorry, my last post based on a type in the scenecontroller_0_0.xml.
Good news, I got the device working now :partying_face:

But, I need some assistance.

I had modified some code to do the work.

  • I have to check it into github and create a PR (no plan how to do this but I’ll find it) (Done, hope all the things are correct, puh)
  • I have to complete the Z-Wave Device Database (Done, review requested)

@chris Could you fix the export from device database please?
This is what I expect:

  <channel id="indicator_level1" typeId="indicator_level">
    <label>LED 1</label>
    <properties>
      <property name="binding:*:PercentType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,property=BINARY,:1</property>
      <property name="binding:Command:OnOffType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,property=BINARY,:1</property>
    </properties>
  </channel>
  <channel id="indicator_period1" typeId="indicator_period">
    <label>LED 1 (Period)</label>
    <properties>
      <property name="binding:*:DecimalType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,:1</property>
    </properties>
  </channel>
  <channel id="indicator_flash1" typeId="indicator_flash">
    <label>LED 1 (Flash)</label>
    <properties>
      <property name="binding:*:DecimalType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,:1</property>
    </properties>
  </channel>  

All the channels should not be deprecated…

Thank you,
best regards,
Daniel

@danil thanks for looking at this. I’ve updated the exporter - please can you take a look to see if it is now inline with above.

Thanks
Chris

@chris,
thanks for merging my PR and modify the exporter.
I checked the export, it is still not complete.

I get:

  <channel id="indicator_level1" typeId="indicator_level">
    <label>LED 1 (Level)</label>
    <properties>
      <property name="binding:*:PercentType">COMMAND_CLASS_INDICATOR:1</property>
      <property name="binding:Command:OnOffType">COMMAND_CLASS_SWITCH_MULTILEVEL:1</property>
    </properties>
  </channel>
  <channel id="indicator_period1" typeId="indicator_period">
    <label>LED 1 (Period) [Deprecated]</label>
    <properties>
      <property name="binding:*:DecimalType">COMMAND_CLASS_INDICATOR:1</property>
    </properties>
  </channel>
  <channel id="indicator_flash1" typeId="indicator_flash">
    <label>LED 1 (Flash) [Deprecated]</label>
    <properties>
      <property name="binding:*:DecimalType">COMMAND_CLASS_INDICATOR:1</property>
    </properties>
  </channel>

I need:

 <channel id="indicator_level1" typeId="indicator_level">
  <label>LED 1</label>
  <properties>
    <property name="binding:*:PercentType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,property=BINARY,:1</property>
    <property name="binding:Command:OnOffType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,property=BINARY,:1</property>
  </properties>
</channel>
<channel id="indicator_period1" typeId="indicator_period">
  <label>LED 1 (Period)</label>
  <properties>
    <property name="binding:*:DecimalType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,:1</property>
  </properties>
</channel>
<channel id="indicator_flash1" typeId="indicator_flash">
  <label>LED 1 (Flash)</label>
  <properties>
    <property name="binding:*:DecimalType">COMMAND_CLASS_INDICATOR;type=BUTTON1_INDICATION,:1</property>
  </properties>
</channel>  

also, the configuration paramters are still missing (for all three channel types)

The OnOffType needs to be COMMAND_CLASS_INDICATOR
The channels are still marked as deprecated

Thanks,
Daniel

Ok, I’ll take a look at why the properties aren’t exported. Note that you won’t get exactly what you want as your definition is slightly broken.

I’ve added the properties to the export so hopefully this is ok now.

1 Like

Perfect, thank you chris,
I will test it this evening…
btw, what is about the deprecated keyword?
Can I change that or is it your doing?