Page 1 of 2

How do I get batterylevels back?

Posted: Saturday 02 August 2025 20:53
by Doler
Sinds some time I'm missing the battery level report on Z-wave devices. It concerns motion sensors from Fibar/Neo and doorsensors from Neo. I am checking battery levels with a Lua script using:

Code: Select all

local function getDevices()
	local  url = dz.settings['Domoticz url'] .. "/json.htm?type=command&param=getdevices&used=true&displayhidden=1" 
	dz.openURL({ url = url, method = "GET", callback = CALLBACK })
end

local function processDevices(result)
	for index in pairs(result) do
		local deviceName = result[index].Name
		local batteryLevel = result[index].BatteryLevel
		
		dz.log(format('Device: %s, Battery level %s %%', deviceName, batteryLevel), dz.LOG_INFO)
		if batteryLevel and batteryLevel ~= 255  then
			dz.globalData.batteryLevels[deviceName] = batteryLevel
		end
	end
end
and in another script checking the retrieved values against a threshold level. This works for all battery operated devices (like Zigbee) but not, sinds some time, for the mentioned Z-wave devices.

The discovery configs are all like this:

Code: Select all

FMS1
temperature_air
config = {"value_template":"{{ value_json.value }}","unit_of_measurement":"°C","state_class":"measurement","device_class":"temperature","state_topic":"zwave/FMS1/49/0/Air_temperature","availability":[{"payload_available":"true","payload_not_available":"false","topic":"zwave/FMS1/status","value_template":"{{'true' if value_json.value else 'false'}}"},{"topic":"zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status…
illuminance
config = {"value_template":"{{ value_json.value }}","unit_of_measurement":"lx","state_class":"measurement","device_class":"illuminance","state_topic":"zwave/FMS1/49/0/Illuminance","availability":[{"payload_available":"true","payload_not_available":"false","topic":"zwave/FMS1/status","value_template":"{{'true' if value_json.value else 'false'}}"},{"topic":"zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status","v…
battery_level
config = {"value_template":"{{ value_json.value }}","unit_of_measurement":"%","device_class":"battery","state_topic":"zwave/FMS1/128/0/level","availability":[{"payload_available":"true","payload_not_available":"false","topic":"zwave/FMS1/status","value_template":"{{'true' if value_json.value else 'false'}}"},{"topic":"zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status","value_template":"{{'online' if value_js…
And the report for the battery_level like this:

Code: Select all

128
0
isLow = {"time":1753016911001,"value":false,"nodeName":"FMS1","nodeLocation":"Living"}
level = {"time":1753639020819,"value":100,"nodeName":"FMS1","nodeLocation":"Living"}
In this example the battery level appears on the FMS1 MultiSensor device, on other hardware devices (if reported) on Low Battery. After enabling new devices and restarting the Z-wave AD hardware new devices '...128-0-level' were created, something that (imho) should not be.

Code: Select all

71	  ZWave-AD	zwavejs2mqtt_0xfe88fc1e_14-156-0-state-0	1	FMS1 | MultiSensor		    Light/Switch	Switch		  Off	    -	
72	  ZWave-AD	zwavejs2mqtt_0xfe88fc1e_14-48-0-Any  		1	FMS1 | Motion Living		  Light/Switch	Switch		  Off	    -	-
73	  ZWave-AD	zwavejs2mqtt_0xfe88fc1e_14-49-0-Illuminance	    1	FMS1 | Lux Living		      Lux		        Lux		      9 Lux	  -	-
74	  ZWave-AD	zwavejs2mqtt_0xfe88fc1e_14-49-0-Air_temperature	1	FMS1 | Temperature Living	Temp	THR128/138, THC138	24.3 C	-	-
75	  ZWave-AD	zwavejs2mqtt_0xfe88fc1e_14-128-0-isLow		      1	FMS1 | Low Battery		    Light/Switch	Switch		  Off	    -	-
1030	  ZWave-AD	zwavejs2mqtt_0xfe88fc1e_14-128-0-level		      1	FMS1 | Battery Level		  General	      Percentage	100%	  -	-
Could there be a connection with the commit on June 15?

Re: How do I get batterylevels back?

Posted: Sunday 03 August 2025 9:37
by waltervl
You are not mentioning on what version of Domoticz and Zwave-JS-Ui you are.

Re: How do I get batterylevels back?

Posted: Sunday 03 August 2025 11:24
by Doler
All latest version (see my signature).

I forgot to mention that the newly created devices (Battery_level) are NOT updated.

Re: How do I get batterylevels back?

Posted: Friday 08 August 2025 8:19
by gizmocuz
All your above config payloads are truncated and you also need to post the complete topics

Re: How do I get batterylevels back?

Posted: Friday 08 August 2025 11:29
by Doler
The not truncated configs for FMS1:

Code: Select all

zwave-ad/sensor/FMS1/temperature_air/config
{
  "value_template": "{{ value_json.value }}",
  "unit_of_measurement": "°C",
  "state_class": "measurement",
  "device_class": "temperature",
  "state_topic": "zwave/FMS1/49/0/Air_temperature",
  "availability": [
    {
      "payload_available": "true",
      "payload_not_available": "false",
      "topic": "zwave/FMS1/status",
      "value_template": "{{'true' if value_json.value else 'false'}}"
    },
    {
      "topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status",
      "value_template": "{{'online' if value_json.value else 'offline'}}"
    },
    {
      "payload_available": "true",
      "payload_not_available": "false",
      "topic": "zwave/driver/status"
    }
  ],
  "availability_mode": "all",
  "json_attributes_topic": "zwave/FMS1/49/0/Air_temperature",
  "device": {
    "identifiers": [
      "zwavejs2mqtt_0xfe88fc1e_node14"
    ],
    "manufacturer": "Fibargroup",
    "model": "Motion Sensor (FGMS001)",
    "name": "FMS1",
    "sw_version": "2.7"
  },
  "name": "FMS1_temperature_air",
  "unique_id": "zwavejs2mqtt_0xfe88fc1e_14-49-0-Air_temperature"
}

zwave-ad/sensor/FMS1/illuminance/config
{
  "value_template": "{{ value_json.value }}",
  "unit_of_measurement": "lx",
  "state_class": "measurement",
  "device_class": "illuminance",
  "state_topic": "zwave/FMS1/49/0/Illuminance",
  "availability": [
    {
      "payload_available": "true",
      "payload_not_available": "false",
      "topic": "zwave/FMS1/status",
      "value_template": "{{'true' if value_json.value else 'false'}}"
    },
    {
      "topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status",
      "value_template": "{{'online' if value_json.value else 'offline'}}"
    },
    {
      "payload_available": "true",
      "payload_not_available": "false",
      "topic": "zwave/driver/status"
    }
  ],
  "availability_mode": "all",
  "json_attributes_topic": "zwave/FMS1/49/0/Illuminance",
  "device": {
    "identifiers": [
      "zwavejs2mqtt_0xfe88fc1e_node14"
    ],
    "manufacturer": "Fibargroup",
    "model": "Motion Sensor (FGMS001)",
    "name": "FMS1",
    "sw_version": "2.7"
  },
  "name": "FMS1_illuminance",
  "unique_id": "zwavejs2mqtt_0xfe88fc1e_14-49-0-Illuminance"
}

zwave-ad/sensor/FMS1/battery_level/config
{
  "value_template": "{{ value_json.value }}",
  "unit_of_measurement": "%",
  "device_class": "battery",
  "state_topic": "zwave/FMS1/128/0/level",
  "availability": [
    {
      "payload_available": "true",
      "payload_not_available": "false",
      "topic": "zwave/FMS1/status",
      "value_template": "{{'true' if value_json.value else 'false'}}"
    },
    {
      "topic": "zwave/_CLIENTS/ZWAVE_GATEWAY-zwave-js-ui/status",
      "value_template": "{{'online' if value_json.value else 'offline'}}"
    },
    {
      "payload_available": "true",
      "payload_not_available": "false",
      "topic": "zwave/driver/status"
    }
  ],
  "availability_mode": "all",
  "json_attributes_topic": "zwave/FMS1/128/0/level",
  "device": {
    "identifiers": [
      "zwavejs2mqtt_0xfe88fc1e_node14"
    ],
    "manufacturer": "Fibargroup",
    "model": "Motion Sensor (FGMS001)",
    "name": "FMS1",
    "sw_version": "2.7"
  },
  "name": "FMS1_battery_level",
  "unique_id": "zwavejs2mqtt_0xfe88fc1e_14-128-0-level"
}
Is this enough info?

Re: How do I get batterylevels back?

Posted: Friday 08 August 2025 15:59
by gizmocuz
Thank you, and could you also post the content of

zwave/FMS1/128/0/level

Re: How do I get batterylevels back?

Posted: Friday 08 August 2025 18:20
by Doler

Code: Select all

zwave/FMS1/128/0/isLow
{
  "time": 1753016911001,
  "value": false,
  "nodeName": "FMS1",
  "nodeLocation": "Living"
}
zwave/FMS1/128/0/level
{
  "time": 1754261342547,
  "value": 100,
  "nodeName": "FMS1",
  "nodeLocation": "Living"
}

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 7:34
by gizmocuz
I think the topic "zwave/FMS1/128/0/isLow" should have been "zwave/FMS1/128/0/level"

I added support for the battery isLow indication (boolean) in beta 16757

When it is 'true', I set all device battery levels to zero, you should be able to see this in the device overview

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 8:30
by Doler
Hmm,

After updating Domoticz won't start anymore. Status message:

Code: Select all

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /home/pi/domoticz/domoticz)
What to do?

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 10:34
by waltervl
Doler wrote: Tuesday 12 August 2025 8:30 Hmm,

After updating Domoticz won't start anymore. Status message:

Code: Select all

/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /home/pi/domoticz/domoticz)
What to do?
Are you running Ubuntu? Then you need 24.04 to get it running. Ubuntu 22.04 that has openssl3 but wrong version of glibc viewtopic.php?p=325831#p325831

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 11:44
by Doler
No, I'm running Debian Bookworm on a virtual machine (AMD64).

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 12:17
by waltervl
Then it seems you run a different version of bookworm than the Domoticz build system...

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 13:50
by Doler
Never had problems before. My bookworm version number is:

Code: Select all

cat /etc/debian_version
12.11

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 14:23
by gizmocuz
The build system was updated to Trixy.... Maybe that is causing the issue?

Seems like the Docker (compose) AMD64 has no issues with it... running fine

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 14:26
by gizmocuz
You could upgrade your system with

Code: Select all

sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
sudo apt update
sudo apt full-upgrade
sudo apt modernize-sources
sudo apt autoremove
sudo reboot

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 14:28
by gizmocuz
Seems this error has already been reported in 2023... ... so don't think (hope) it has anything to do with Trixy

https://www.reddit.com/r/linux4noobs/co ... und_error/

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 14:50
by waltervl
gizmocuz wrote: Tuesday 12 August 2025 14:23 The build system was updated to Trixy.... Maybe that is causing the issue?

Seems like the Docker (compose) AMD64 has no issues with it... running fine
Possibly not AMD64 but also update issues on Docker viewtopic.php?f=6&t=43859

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 14:58
by Doler
I'm running the virtual machine on Proxmox that is still running on Debian bookworm. There is a Proxmox upgrade 8 to 9 that is based on Trixy but other than running a script checking if Proxmox is ok for an upgrade. I did nothing else since I wanted the problem with Domoticz be solved first. So I have no idea what changed.

I'm not running Domoticz in Docker.

Question is where the requirement for GLIBC comes from?

I'll try to switch to Trixy on my test system and see if it works.

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 15:27
by Doler
Doler wrote: Tuesday 12 August 2025 14:58 I'll try to switch to Trixy on my test system and see if it works.
Ok, Domoticz updated fine. Going to do the same on my live system (backup first) and see if the Z-wave problem is solved. Thanks sofar.

Re: How do I get batterylevels back?

Posted: Tuesday 12 August 2025 15:43
by gizmocuz
I was just going to say I am trying to build a schroot environment on build server to build for bookworm again...