Zwave-JS-UI in place of OH Zwave binding

Does anyone have any idea how I can show in OH that Z-Wave ui js is also running?

Try the zwave/driver/status topic

1 Like

A heads up to the GitHub… someone is/can developing an official binding…

Note that at this point, that issue is a feature request, and no one has committed to working on it yet.

I have tested this but it looks for me not reliable. I had many cases where the status was true, but the serial connection has been lost. The “auto recovery” via soft reset seems not to help. What I’m now trying is to check the output in the logfile (“Performing soft reset…”).
Unfortunately until I have implemented it, I have no troubles with the connection :wink:

Interesting. I don’t use that topic, but I can see in HA configs that topic is used to turn the state of the node “offline” (I don’t us the HA configs either but noticed its use in a test environment). If the controller is dropping off while ZUI is still running maybe use the controller status topic. (edit: or both)

FYI News on Zwave-js-ui certification: Nabu Casa joins the Z-Wave Alliance - Home Assistant (home-assistant.io)

I tried setting the payload type to Just value under settings → gateway and it seems that then the json transformation is no longer necessary :slight_smile:

grafik

Example:

Thing mqtt:topic:zwave-node_41 "Node41" (mqtt:broker:localhost)
{
    Channels:
    Type switch : switch [
        stateTopic  = "zwave/nodeID_41/switch_binary/endpoint_0/currentValue",
        commandTopic= "zwave/nodeID_41/switch_binary/endpoint_0/targetValue/set",
        on="true", off="false"
    ]

    Type number : power       [stateTopic="zwave/nodeID_41/sensor_multilevel/endpoint_0/Power"]
    Type number : energy      [stateTopic="zwave/nodeID_41/meter/endpoint_0/value/65537"]
}
1 Like

Great, same as in Zigbee2MQTT. Now its time to switch :grinning:

You might need either a MAP transform or metadata to convert the numbers.
ie

** Thermostat Status Metadata-State description
0=Idle
1=Heating
2=Cooling

and

 ** Door.map
22=OPEN
23=CLOSED

etc.

Are you guys using Named topics or ValueID topics ?
I sometimes have a hard time building the appropriate topic name and think switching to value id would be much easier …

At this point I have used all the available options :wink: Right now my systems need the JSON conversion because I was testing how far I could get with the HA configs. However, I started (first post) with ValueID and just value. I next converted to Named topics because I felt that more people would understand that. The valueID assumes knowledge of the enums for the Zwave CC, but it is quite short.!
Your KWH topic would be zwave/41/50/0/value/65537

Edit: was meaning to add to the first post that a “device level” time (since that is missing with just value) with the ~/lastActive to a dateTime item.

I use ValueID topics and just value for payloads, since I set this up. No transforms required and pretty direct configuration of the mqtt channels.

As I rebuilt my network, everytime I configured something with a new channel type, I just recorded that channel type config in my tracking system:

By the time I was 1/3 of the way through my setup I could just add a new device, add the thing in OH, copy over the relevant channels, add the correct node ID number and it was done. The longest step was excluding from the old network. On devices where I had the dsk saved already it was 3 - 5 minutes per device at most.

The only three issues I’ve encountered are

  1. the battery reporting issue that’s already come up
  2. I decided to try this with an 800 series controller because I could. It seems that zwave-js is still working on associations for 800 series controllers, so the few places where I had direct associations, I had to shift that function over to OH with a follow profile (added another 1 minute to the process).
  3. This was the big one for me: On multi-button scene controllers where the OH binding would provide all the values on the same channel as [Button #].[Event value], Zwave js splits all these into separate MQTT topics and just provides [Event value]. Rather than reconfigure all my remotes with additional items for each button, I just created a quick js-script transform:
(function(data) {
  var returnValue = zButton + "." + data
  return returnValue
})(input)

And I link each of the different button channels to the same item:

And each link has a Script profile:

I have a HEM node which I frequently find needs a manual refresh of the values read.
In the OH Zwave binding I just issued a “REFRESH” item command to the node.
How do I issue a manual refresh of all values of the specific node now with MQTT thing command?

And another question;
The node has a “RESET accumulated values” button on the UI.
How do I “push” this button through a MQTT thing command?

I collect a midnight KWH reading for mysql persistance in DSL it looks like this; There is documentation on the zwave-js-ui github about these API commands.

rule "HEM KWH Refresh"
when 
    Time cron "0 58 23 ? * * *"
then
    getActions('mqtt', 'mqtt:broker:f06f8352c2').publishMQTT('zwave2/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui2/api/refreshCCValues/set', '{"args":[3,50]}', 'TRUE' === 'TRUE')
    Thread::sleep(1000)
    getActions('mqtt', 'mqtt:broker:f06f8352c2').publishMQTT('zwave2/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui2/api/refreshCCValues/set', '{"args":[2,50]}', 'TRUE' === 'TRUE')
    Thread::sleep(1000)
    getActions('mqtt', 'mqtt:broker:f06f8352c2').publishMQTT('zwave2/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui2/api/refreshCCValues/set', '{"args":[6,50]}', 'TRUE' === 'TRUE')
    Thread::sleep(1000)
etc...

I download into Excel and do the subtraction there, so am not sure about the refresh command.
Could just be topic/set like a configuration item. e.g.
zwave/25/50/0/reset (/set, or /0 or blank or 255 ?)

But I’m just guessing. Could ask on the zwave-js-ui github discussion/question tab.

That’s how I reset the power plug values.
Topic depends on your config. I use “zwave/location/device/50/0/reset”
Use a switch channel and link a switch item to that channel. Item needs an expire time of 2 sec.

Did anyone get a color channel working? I’m struggling using my fibaro dimmers in color mode.
I tried hexColor but openHAB provides r,g,b which does not work.

I use this with a ja transformation

const rgbToHex = (r, g, b) => {
  return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
}


Can post the real syntax tomorrow…

I figured it out with a quick and dirty HABApp hack :smiley: !
Also if some wonders how to set a transition time - here is what I found out:

{
    "value": "000000",
    "options": {
        "transitionDuration": "10s"
    }
}

I switch the following config off
grafik
so I can properly name my nodes in zwave-js-ui

I too moved to Zwave-JS-UI on docker.
Manually configured all nodes into MQTT things through a “.things” file.
Now a week into the move and all is working as usual.
It sometimes feels the response time has improved slightly.

Thing mqtt:topic:zwave-node17 "DoorSensor"  (mqtt:broker:mymqtt) 
{
    Type contact : Door_state [stateTopic="zwave/nodeID_17/113/0/Access_Control/Door_state_simple", transformationPattern="MAP:door.map"]
	Type switch : Door [stateTopic="zwave/nodeID_17/48/0/Door-Window", off="true", on="false"]
	Type number : Battery_Level [stateTopic="zwave/nodeID_17/128/0/level"]
}
Thing mqtt:topic:zwave-node20 "WallPlug3"  (mqtt:broker:mymqtt) 
{
    Type switch : switch
	[ 
		stateTopic="zwave/nodeID_20/37/0/currentValue",
		commandTopic="zwave/nodeID_20/37/0/currentValue/set",
		on="true", 
		off="false"
	]
}
Thing mqtt:topic:zwave-node25 "HEM"  (mqtt:broker:mymqtt) 
{
 	Type number : Total_Current [stateTopic="zwave/nodeID_25/50/0/value/66817"]
	Type number : Total_Watt [stateTopic="zwave/nodeID_25/50/0/value/66049"]
	Type number : Total_KWH [stateTopic="zwave/nodeID_25/50/0/value/65537"] 
	Type number : Total_Volts [stateTopic="zwave/nodeID_25/50/0/value/66561"]

 	Type number : PH1_Current [stateTopic="zwave/nodeID_25/50/1/value/66817"]
	Type number : PH1_Watt [stateTopic="zwave/nodeID_25/50/1/value/66049"]
	Type number : PH1_KWH [stateTopic="zwave/nodeID_25/50/1/value/65537"] 
	Type number : PH1_Volts [stateTopic="zwave/nodeID_25/50/1/value/66561"]

 	Type number : PH2_Current [stateTopic="zwave/nodeID_25/50/2/value/66817"]
	Type number : PH2_Watt [stateTopic="zwave/nodeID_25/50/2/value/66049"]
	Type number : PH2_KWH [stateTopic="zwave/nodeID_25/50/2/value/65537"] 
	Type number : PH2_Volts [stateTopic="zwave/nodeID_25/50/2/value/66561"]

 	Type number : PH3_Current [stateTopic="zwave/nodeID_25/50/3/value/66817"]
	Type number : PH3_Watt [stateTopic="zwave/nodeID_25/50/3/value/66049"]
	Type number : PH3_KWH [stateTopic="zwave/nodeID_25/50/3/value/65537"] 
	Type number : PH3_Volts [stateTopic="zwave/nodeID_25/50/3/value/66561"]
	
}
Thing mqtt:topic:zwave-node2 "MotionSensor"  (mqtt:broker:mymqtt) 
{
    Type switch : Motion [stateTopic="zwave/nodeID_2/113/0/Home_Security/Motion_sensor_status", transformationPattern="MAP:motion.map"]
	Type number : Air_temperature [stateTopic="zwave/nodeID_2/49/0/Air_temperature"]
	Type number : Battery_Level [stateTopic="zwave/nodeID_2/128/0/level"]
}
Thing mqtt:topic:zwave-node16 "FloodSensor1"  (mqtt:broker:mymqtt) 
{
	Type switch : Water_Alarm [stateTopic="zwave/nodeID_16/48/0/Water", off="false", on="true"]
	Type number : Battery_Level [stateTopic="zwave/nodeID_16/128/0/level"]
}
Thing mqtt:topic:zwave-node4 "BasementLightSwitch"  (mqtt:broker:mymqtt) 
{
    Type switch : BasementLightSwitch
	[ 
		stateTopic="zwave/nodeID_4/37/1/currentValue",
		commandTopic="zwave/nodeID_4/37/1/targetValue/set",
		on="true", 
		off="false"
	]
	Type number : BasementLightSwitchWatts [stateTopic="zwave/nodeID_4/50/1/value/66049"]
}
2 Likes