batterylevel contacts Topic is solved

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

michelscholte
Posts: 75
Joined: Friday 08 January 2016 10:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Nederland
Contact:

batterylevel contacts

Post by michelscholte »

Is there a way to show the battery level of door/window contacts on the Dashboard?
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

Not yet.

How would you like to have it presented?
I could show an icon at the upper right of a block, when the battery level is below a certain threshold.

Currently this are the existing font-awesome icons.
battery-level.jpg
battery-level.jpg (8.31 KiB) Viewed 1699 times
Would that be sufficient?
(on the dashboard they will be rotated counter clockwise)
michelscholte
Posts: 75
Joined: Friday 08 January 2016 10:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Nederland
Contact:

Re: batterylevel contacts

Post by michelscholte »

That would be great. Are you using all the 5 icons, so that each level has his own icon or only the empty one when the level is below a certain value? Thanks in advance.
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

I planned to use them all:
>90%: full
>60%: three quarters
>35%: half
>10: quarter
<=10: empty
but only show them if battery level is below the user defined threshold
michelscholte
Posts: 75
Joined: Friday 08 January 2016 10:02
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Nederland
Contact:

Re: batterylevel contacts

Post by michelscholte »

OK. That's nice.
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

ok, implemented first version in latest beta.

Could you test?

Add the following to CONFIG.js to show the battery level for all battery powered devices:

Code: Select all

config['batteryThreshold'] = 100;
The batteryThreshold parameter can also be set on block level.
batterylevel.jpg
batterylevel.jpg (5.07 KiB) Viewed 1642 times
See:
https://dashticz.readthedocs.io/en/beta ... tery-level
User avatar
madpatrick
Posts: 667
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: batterylevel contacts

Post by madpatrick »

Hi Lokonli,

It is working !
Nice add-on
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
red73390
Posts: 16
Joined: Wednesday 30 December 2020 13:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: Belgium
Contact:

Re: batterylevel contacts

Post by red73390 »

Hello,
I try to implement it also (i swithed to the beta branch). I think there's a difference because I use zwave module with 2 or more informations and domoticz didn't manage the battery as he does with a simple battery object (433 for example).
I'm using this plugin in domoticz to have a battery object.
https://www.domoticz.com/wiki/Plugins/BatteryLevel.html
Do you think it's possible to link the battery state you implement to another idx ?
Thank you.
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

red73390 wrote: Thursday 31 December 2020 11:24 Hello,
I try to implement it also (i swithed to the beta branch). I think there's a difference because I use zwave module with 2 or more informations and domoticz didn't manage the battery as he does with a simple battery object (433 for example).
I'm using this plugin in domoticz to have a battery object.
https://www.domoticz.com/wiki/Plugins/BatteryLevel.html
Do you think it's possible to link the battery state you implement to another idx ?
Thank you.
If I read the zwave plugin page, then it seems that the plugin just uses the battery information from the device itself.
If that's true then it doesn't add value to connect to the additional 'battery level' devices created by the plugin.

If you set config['batteryThreshold'] = 256
do you then see battery level info for your zwave devices?
User avatar
madpatrick
Posts: 667
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: batterylevel contacts

Post by madpatrick »

Using

Code: Select all

config['batteryThreshold'] = 100;
gives all the battery info of my zwave devices.
Image

Is it possible to scale the image ?
My block a little bit small :roll:
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

The default battery font size is 15. To reduce it to 10, add the following to custom.css:

Code: Select all

.battery-level {
   font-size: 10px
}
To change the font size for the percentage number: (default is 10)

Code: Select all

.battery-percentage {
  font-size: 5px;
}
User avatar
madpatrick
Posts: 667
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: batterylevel contacts

Post by madpatrick »

The default size was bigger then 15px
I need to go to "font-size: 20px" and add "!important"
Probably due the small screen size of my tablet
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
red73390
Posts: 16
Joined: Wednesday 30 December 2020 13:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: Belgium
Contact:

Re: batterylevel contacts

Post by red73390 »

@madpatrick : Then i have to check again, with config['batteryThreshold'] = 100; or config['batteryThreshold'] = 256; nothing appear
@Lokonli : Yes the plugin battery ask the zwave master, and create a new equipment for each equipment with a battery status. As it works for madpatrick I need to check why it's not working for me.
Spoiler: show
blocks['Astride_Mesure'] =
{
idx: 12,
width: 12,
title: 'Chambre Astride',
batteryThreshold: 256,
last_update: true,
popup: 'popup_Astride_Temp_SP'

}
Image
Image
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

Device 11 and 12 seem to have battery level info.

Double check that you run the latest Dashticz beta version. Update with 'git pull' in the Dashticz folder. There should be no errors reported.
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

madpatrick wrote: Thursday 31 December 2020 13:30 The default size was bigger then 15px
I need to go to "font-size: 20px" and add "!important"
Probably due the small screen size of my tablet
or you changed the icon font size in custom.css already? (or font size for .fas)
User avatar
madpatrick
Posts: 667
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: batterylevel contacts

Post by madpatrick »

Lokonli wrote: Thursday 31 December 2020 13:48 or you changed the icon font size in custom.css already? (or font size for .fas)
yep.....
.fas was set to 26px :roll:
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
red73390
Posts: 16
Joined: Wednesday 30 December 2020 13:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: Belgium
Contact:

Re: batterylevel contacts

Post by red73390 »

Lokonli wrote: Thursday 31 December 2020 13:45 Device 11 and 12 seem to have battery level info.

Double check that you run the latest Dashticz beta version. Update with 'git pull' in the Dashticz folder. There should be no errors reported.
Yes device 11 and 12 have battery info, in fact it's 1 equipment with many devices.

I tried it again in dashticz folder, git pull -> it say already up to date (french translate)
In the info on dasthicz folder i'm in version 3.7.2 beta you are running latest version
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

Can you post the output of:

Code: Select all

http://domoticz ip:port/json.htm?type=devices&rid=11
red73390
Posts: 16
Joined: Wednesday 30 December 2020 13:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: Belgium
Contact:

Re: batterylevel contacts

Post by red73390 »

Lokonli wrote: Thursday 31 December 2020 18:36 Can you post the output of:

Code: Select all

http://domoticz ip:port/json.htm?type=devices&rid=11
Spoiler: show
{
"ActTime" : 1609436787,
"AstrTwilightEnd" : "18:48",
"AstrTwilightStart" : "06:44",
"CivTwilightEnd" : "17:26",
"CivTwilightStart" : "08:06",
"DayLength" : "08:02",
"NautTwilightEnd" : "18:08",
"NautTwilightStart" : "07:24",
"ServerTime" : "2020-12-31 18:46:27",
"SunAtSouth" : "12:46",
"Sunrise" : "08:45",
"Sunset" : "16:47",
"app_version" : "2020.2",
"result" :
[
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 82,
"CustomImage" : 0,
"Data" : "17.0",
"Description" : "",
"Favorite" : 1,
"HardwareID" : 2,
"HardwareName" : "Zwave",
"HardwareType" : "OpenZWave USB",
"HardwareTypeVal" : 21,
"HaveTimeout" : false,
"ID" : "0000701",
"LastUpdate" : "2020-12-31 18:44:23",
"Name" : "Zwave_Cons_Radiateur_Astride",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" :
[
0
],
"Protected" : false,
"SetPoint" : "17.0",
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "SetPoint",
"Timers" : "true",
"Type" : "Thermostat",
"TypeImg" : "override_mini",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "11"
}
],
"status" : "OK",
"title" : "Devices"
}
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: batterylevel contacts

Post by Lokonli »

Just as double check, can you add the following to CONFIG.js:

Code: Select all

config['batteryThreshold'] = 256;
Do you see any battery level?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest