Change of controller role

Discussions about Z-Way software and Z-Wave technology in general
RolfKunkel
Posts: 68
Joined: 03 Jan 2017 18:35

Change of controller role

Post by RolfKunkel »

I have a serious issue with my smart home. I operate two Raspberry Pi in Master/ Slave configuration. Yesterday my Master Raspberry died and I tried to make my Slave Pi (including the slave controller) the Master Pi by preparing a fresh SD card with bullseye OS and latest ZWAY software. .

Before restoring the .zbk file in expert view I clicked on "Controller Factory Default" button to delete the data on the Controller because the Controller form the Slave Pi contains slave data I guess which needs to be removed first.

But the restoration of .zbk file failed and I found out that the controller is still in slave mode. When I list the controller info the parameter Primary Role = NO.

It seems the controller reset to factory defaults did not change the controller role. It is even not possible to add new single devices because the related buttons (Include/ Exclude device) are grey and in the menu there is a note that the controller is a secondary controller and that no devices can be added.

I tried another, older Razberry but the same issue. Flagged as well as secondary controller.

Isn't it possible to change the controller role from secondary to primary? I did not find a button or menu in expert view that makes this role change possible.

Any help appreciated because my network is down (approx. 60 devices) and all my Razberry controller tell me that they are secondary controller which seems to be the problem that the restore of my master backup file failed.
seattleneil
Posts: 232
Joined: 02 Mar 2020 22:41

Re: Change of controller role

Post by seattleneil »

I think the best solution is to fix the problem that's preventing restore of the .zbk (expert UI backup). Try power-cycling your PI (do a graceful shutdown, don't just yank the power out) and trying the restore again.

If that fails, do you haze a .zab backup (from the normal/smarthome UI)? If so, try to restore from the .zab backup (it's a superset of the .zbk).
RolfKunkel
Posts: 68
Joined: 03 Jan 2017 18:35

Re: Change of controller role

Post by RolfKunkel »

I always use the shutdown/ reboot function of the PI OS to boot the Pi.
Nevertheless I did the same procedure again.
Creating a new SD Card with bullseye OS, installing fresh ZWay V4.1.4 SW package.
Restoring the config using .zab file.

When the restoration of .zab finished all rooms are back in the normal GUI but rooms are partly empty (devices missing) and the device list in expert view is completely empty. It seems restoring using only .zab file does not restore the device data. .
seattleneil
Posts: 232
Joined: 02 Mar 2020 22:41

Re: Change of controller role

Post by seattleneil »

Please try to restore the .zbk file from your old master Pi onto your newly rebuilt Pi.

If the restore fails, move the Z-Wave controller from your dead master Pi into your newly rebuilt Pi (safely, with the power off).
RolfKunkel
Posts: 68
Joined: 03 Jan 2017 18:35

Re: Change of controller role

Post by RolfKunkel »

The problem is that after restoring the zab file on my Pi the ZWave GUI is no longer available. When I try to access the expert view I get always the response "the z-way server is not reachable" . That means I cannot restore the zbk file because I cannot access the control menu.
But I tried to do the restore the other way round. Starting with a fresh set up (fresh SD Card + ZWay) I can access ZWAY Service normal GUI and expert view but when I try to restore the zbk file I get an error message that the restore failed. And as I wrote in my initial post even in this fresh zway environment it is not possible to include a device. All buttons that are needed to include or exclude a device are greyed out and there is a note that the controller is a secondary controller. That is the reason why I asked in my initial post if it is possible to change the controller settings to make it a primary controller. Pushing the button "controller factory reset" does not change this controller setting.
RolfKunkel
Posts: 68
Joined: 03 Jan 2017 18:35

Re: Change of controller role

Post by RolfKunkel »

it seems the controller is rejecting any kind of device data because it's role is = secondary and not primary
RolfKunkel
Posts: 68
Joined: 03 Jan 2017 18:35

Re: Change of controller role

Post by RolfKunkel »

Now I am completely lost.

After setting up the system once again from scratch with a new SD Card plus a brand new Razberry board after installing the ZWAY software V4.1.4 in expert view in Control menu there is again the note that the controller is a secondary controller and no devices can be added to the network.
How can it be that the controller "thinks" to be secondary controller when everything is new, the SD Card, the OS, the ZWAY SW and the Razberry HW.


expert view screenshot.png
expert view screenshot.png (134.42 KiB) Viewed 12296 times
seattleneil
Posts: 232
Joined: 02 Mar 2020 22:41

Re: Change of controller role

Post by seattleneil »

Based on your troubleshooting, it looks like communication to your RazBerry card (over the serial port) is not working correctly and the expert UI is not showing you accurate information. As a result, you may be chasing a red herring.

The /var/log/z-way-server.log file will show if there's a problem with serial port communications. The log file can be a bit cryptic, just look for SENDING: and RECEIVED: lines and check for good communication.

Assuming you find a serial communications problem, the next step is to fix the problem. Follow the steps in this post:

Code: Select all

https://forum.z-wave.me/viewtopic.php?f=3422&t=36043&p=99574&hilit=getty#p99574
As for resetting you RazBerry card, if serial communications are working and the z-way-server process is running, you can bypass the expert UI and do a soft reset by running this command:

Code: Select all

curl -u admin:[PASSWORD] --globoff 'http://127.0.0.1:8083/ZWave.zway/Run/SerialAPISoftReset()'
To do a factory reset (dangerous - do an expert UI backup first), run this command:

Code: Select all

curl -u admin:[PASSWORD] --globoff 'http://127.0.0.1:8083/ZWave.zway/Run/SetDefault()'
The /var/log/z-way-server.log file will show you what occurred when you run these commands. These commands are described here: https://z-wave.me/manual/z-way/Function ... rence.html

Be sure to check the firmware of your RazBerry 7 card and upgrade if needed - you want to see the following for the Controller Info:
Firmware
Library Type: Static Controller
SDK Version: 7.21.00
Serial API Version: 07.42
lanbrown
Posts: 373
Joined: 01 Jun 2021 08:06

Re: Change of controller role

Post by lanbrown »

My preferred route of things....have backups and have spare Razberry cards. I do not have have secondary controllers at all in my network as there is no need for them. If a system fails, I have a spare ready to go with a Razberry board already in it. I do run Z-Way as a add-on to HA and can restore HA (I have backups) and can restore Z-Way and the controller (I have backups). I have five Z-Way networks and not a single one has a secondary controller. A secondary controller is the solution looking for a problem. Too many devices will only talk or send update to the primary, so having a secondary is not going to help. Z-Wave was never designed to have more than one active controller where either could be used.

I would start fresh and get a Razberry Pi up and running with Z-Way and you have verified that it is functional (minus the Z-Way devices) before you even start to do a restore. If Z-Way is having issues talking to the controller, a restore will not fix this issue. Just like fi you cannot access the GUI; a restore is not going to fix that either.
seattleneil
Posts: 232
Joined: 02 Mar 2020 22:41

Re: Change of controller role

Post by seattleneil »

Adding/reinforcing what @lanbrown wrote...

Secondary controllers have been deprecated in the Z-Wave standard as they are incompatible with S2 security. They were part of the original Z-Wave specification that envisioned users having a portable/battery-operated controller and a line-powered stationary controller where the portable controller was useful for device inclusion/exclusion. The need for a portable/secondary controller disappeared when Z-Wave added a feature called Network-Wide Inclusion. Your Z-Wave network will be more reliable if you banish secondary controllers from your network.

That being said, if you have devices that require more than 2 routing hops, a much better approach for creating a reliable Z-Wave network is to install multiple primary controllers and link your multiple Z-Wave networks together using either the Z-Way app "Link other Z-Way controller" or a third-party home automaton system such as Home Assistant as done by @lanbrown. Note that Z-Wave Long Range devices have a star topology where communication is always point-to-point. As such, although secondary controllers will continue to work with non-S2 included devices, they are useless with Z-Wave Long Range devices.

Once you get your primary controller up and running and do a network reorganization, you can determine if having additional primary controllers would be beneficial by looking at timing stats and routing stats in the expert UI. If you have devices that are unreachable by your primary controller or routes that require more than 2 hops, adding an additional primary controller in proximity to those devices is recommended. Note that you'll need to exclude/re-include those devices to work with the additional primary controller as each primary controller has a unique Home/Network ID.
Post Reply