Bindings fail after Pi general software upgrade

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
ScotsDon
Posts: 50
Joined: 28 Jul 2015 20:55

Bindings fail after Pi general software upgrade

Post by ScotsDon »

I use a Fibaro FGMS-001 PIR multi-sensor to turn on the heating in an area of my house when someone is detected in there. I have written my own Python system so no third party app is involved (such as Home Assistant). This has been working for several years, using Zway on a Raspberry Pi 3. I now use a Razberry 7 on my Pi, as of last July (2023). I use Raspian Bullseye on the Pi, and version 4.1.0 of Zway (build date 25/07/2023). I don't know when I last did a Pi Upgrade but possibly last May (2023). I ran an upgrade a week or so ago, as follows:

sudo apt update
sudo apt upgrade

This ran for around 20 minutes, so a lot of upgrades went on. Afterwards, the Fibaro PIR no longer triggered my Python program to activate the heating.

I had saved an SD Card image file before the upgrade, so restored that and everything worked again. The problem is re-producible.

This is what I did after the Upgrade to try to de-bug it (this comes from notes I made a while ago). Note that I have a second Fibaro PIR which also didn't work. Also note that the PIR changes, temperatures etc were coming though on the App and also to the Smarthome website, but not the bindings activation:
_____________________________________________________________
SETTING UP FIBARRO MOTION SENSOR:

Check that:
.syscommands is in /opt/z-way-server/automation. Check permissions are owner root, View Anyone, Change Only Owner, Excecute Nobody.

Check both Fibaro_Bindings_1.js and Fibaro_Bindings_2.js are in /opt/z-way-server/automation/MyFolder/.

Check their premissions are: Pi, Pi, Anyone, Only Owner, Only Owner. Can also be owned by root.

Check the following python files are in the Pi Documents folder:
Code_PIR_Action.py (Activates the heating on PIR detection)
Code_PIR2_Action.py
Code_Save_Fibaro_Sensor_Data.py (Logs temperature, luminescence, battery, tamper alarm)
Code_Save_Fibaro_Sensor2_Data.py
with permissions: pi, pi, Anyone, Only owner, Only owner (I don't think in fact that the Execute needs to be set).

On Windows, go to ZWay UI
http://192.168.1.xx:8083/smarthome/#/apps/instance
and under Load Custom Javascript File, check there are two entries with file name to be executed:
/MyFolder/Fibaro_Bindings_2.js
/MyFolder/Fibaro_Bindings_1.js

In Expert UI, under Configuration / Association, check the associations for devices 3 and 8 (being the Fibaro devices) are as per the screenshots in C:\Users\donal\Documents\Raspberry Pi-3a\Setup House Control.
___________________________________________________________________
Everything checked out OK, so no changes appear to have been made to the setup.

I can carry on without the Upgrade, but I think this needs investigation.
seattleneil
Posts: 172
Joined: 02 Mar 2020 22:41

Re: Bindings fail after Pi general software upgrade

Post by seattleneil »

It sounds like you have a complicated configuration. You may want to use the Easy Scripting app instead of adding your own bindings. This is a very useful app for creating complicated rules in JavaScript. Assuming your heater is a virtual device within Z-Way, you could have Easy Scripting logic that triggered whenever motion is detected (i.e., use the app to bind to your PIR sensor) that would check if the heater was turned on, and if not on, it would turn the heater on. Alternatively, you could simply create an automation If/Then rule (if PIR is on, turn heater on [select the option "Don't send On command, if device is already turned On, similarly for Off]). To automatically turn off the heater off when the room became unoccupied, I would use the Automated Switch Off app that would trigger after 30 minutes of the PIR sensor turning on.

As for upgrading your Pi to Bullseve (presumably from Buster), you would have a much cleaner setup if you did a Z-Way backup, then created a clean SD with Bullseye and installed a clean version of Z-Way using "wget -qO - https://storage.z-wave.me/RaspbianInstall | sudo bash". After you have a clean OS and a clean Z-Way, you can do a Z-Way restore and copy whatever files you want to preserve from your old SD card. It seems unlikely that anyone on this forum is going to troubleshoot your python binding issue from an irreproducible setup.
Post Reply