hi
I have some battery devices conected to domoticz, they report info about battery and radio level.
Is it possible to get info about those lvl to set alarm or using them in scripts in other way?
ty in advance
Battery level info
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Battery level info
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 33
- Joined: Friday 31 August 2018 12:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Battery level info
yes, but i cant understand how i read this battery lvl 
i try
but w/o success, so im really dont have idea how i can read batterylevel device's test_ds 

i try
Code: Select all
local test = domoticz.devices('test_ds').batteryLevel

-
- Posts: 97
- Joined: Friday 05 December 2014 22:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Battery level info
Hello
You can install battery level plugin and the manipulate the level via dzvents
You can install battery level plugin and the manipulate the level via dzvents
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
-
- Posts: 97
- Joined: Friday 05 December 2014 22:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Battery level info
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
-
- Posts: 33
- Joined: Friday 31 August 2018 12:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Battery level info
this plugin works only for z-wave, and i have EasyESP and mysensor nodes
-
- Posts: 531
- Joined: Saturday 02 June 2018 11:05
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2022.1
- Location: Echt, Netherlands
- Contact:
Re: Battery level info
I am running this script for getting the battery status and set it to a dummy
Using it for a Xiaomi device, which has the battery inside its open/close status.
Now i can use it for other scripts on each value it has.
you need to fill in IP-address and IDX number of the dummy
I am running json for a local set a local dummy. I should be changing it to a local command and not json.
But it works and at the moment i am working on other things that i still didn't changed it.
Using it for a Xiaomi device, which has the battery inside its open/close status.
Now i can use it for other scripts on each value it has.
you need to fill in IP-address and IDX number of the dummy
I am running json for a local set a local dummy. I should be changing it to a local command and not json.
But it works and at the moment i am working on other things that i still didn't changed it.
Code: Select all
--[[
updateBatterylevel
]] --
return {
on = {
devices = { 'Garage poort'} ,
timer = { 'at 10:00' },
httpResponses = { 'setBatterylevel' }
},
execute = function(domoticz, trigger)
local debug = true
function debug_print(myLine)
if debug then print("***** updateBatterylevel ****** " .. myLine) end
end
if trigger.isHTTPResponse then
if (trigger.ok) then -- statusCode == 2xx
local setting = trigger.json.status
end
else
local batteryDevice = domoticz.devices("Garage poort")
local newBatterylevel = batteryDevice.batteryLevel
local myUrl = "http://xxx.xxx.xxx.xxx:xxxx/json.htm?type=command¶m=switchlight&idx=XXX&switchcmd=Set%20Level&"
myUrl = myUrl .. "level=" ..newBatterylevel
domoticz.openURL({
url = myUrl,
callback = "setBatterylevel"
})
end
end
}
Thin-client --> Docker Domoticz main environment
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
Pi3A+ --> Google home (GAssistPi)
Pi3B+ --> Docker (P1monitor, Domoticz test environment, Ubiquity controller)
-
- Posts: 33
- Joined: Friday 31 August 2018 12:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Battery level info
tyvm!
it works quite nice
it works quite nice

Who is online
Users browsing this forum: No registered users and 1 guest