Page 1 of 1

Battery low level highlight does not respect setting

Posted: Sunday 21 September 2025 12:31
by domja
Version: 2025.1 both stable and beta (build 16782)
Platform: Raspberry Pi / ODroid (Docker)
Plugin/Hardware: dummy/percentage device
Description:

According to the wiki https://wiki.domoticz.com/Application_S ... _Low_Level when Battery Low level is set, a notification is sent and highlight color yellow is shown when the battery level is reached.

To test I created a dummy/percentage device and set the percentage to 25% (via api call /json.htm?type=command&param=udevice&idx=19&svalue=25&battery=25)
When in settings->other, the battery low level percentage is set to 30%, a notification is sent... however the device widget is NOT colored yellow.

After some digging I found:
- div.item.statusLowBattery is responsible for the yelllow color
- div.item.statusLowBattery is controlled by www/app/DashboardController.js (and possibly www/app/app.js?)

In both situations the low level value is hardcoded to 10:

Code: Select all

 var BatteryLevel = parseInt(item.BatteryLevel);
 if (BatteryLevel != 255) {
	if (BatteryLevel <= 10) {
		$(id + " #name").removeClass('statusNormal');
		$(id + " #name").addClass('statusLowBattery');
	}
The code should respect the value as set in the settings.

Thanks in advance!