Skip to content

FHEm module to update the battery state of bluetooth low energy tags

Notifications You must be signed in to change notification settings

mark078/fhem-BleTagBattery

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BleTagBattery

    BleTagBattery - Update batteryLevel for all BLE tags
    This module can be used to update the Reading batteryLevel and battery for all bluetooth low energy tags registered as PRESENCE devices.

    Requirements:
    • Gattool is required to use this module. Be sure that bluez is installed (sudo apt-get install bluez).
    • BLE tags must be registered as PRESENCE devices of type lan-bluetooth.

    Installation:
    • be sure that bluez is installed: sudo apt-get install bluez
    • add the new update site: update add http://raw.githubusercontent.com/mumpitzstuff/fhem-BleTagBattery/master/controls_bletagbattery.txt
    • run the update and wait until finished: update all
    • restart fhem: shutdown restart
    • define a new device: define <name of device> BleTagBattery

    Usage: The module automatically try to reach all BLE tags every 6 hours and to update the reading batteryLevel and battery for each tag directly within the tag device. You can manually trigger the update with: set <name of device> statusRequest.

    Pitfalls: This module does not work well together with lepresenced on a single bluetooth dongle. In the best case lepresenced and this module should run on separate bluetooth dongles. If this is not possible and you do not get any battery readings, try to activate the attribute verbose 5 within this module and analyze the logfile. You can also try to increase the constant RETRY_SLEEP (start with high values like 30 and decrease the value if possible) within the lepresenced deamon (stop the deamon, edit the lepresenced script and restart the deamon). This will give this module more time to retrieve the battery value from the BLE tags before the lepresenced deamon try to restart the bluetooth dongle again. The more BLE tags you are using, the higher the value for RETRY_SLEEP should be.

    Attributes:
    • disable: disable the BleTagBattery device
    • hciDevice: bluetooth device (default: hci0)

    Supported BLE tags:
    • Gigaset G-Tag
    • general handler for many other tags
    • more to come

About

FHEm module to update the battery state of bluetooth low energy tags

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Perl 100.0%