Primary a Presence Detector that works with your Fritz!Box. And also lets you add easily other known hosts from your Box to Domoticz.
Attention: With Version 0.7.0 Parameter have changed. So adapt user and password if updating from <0.7.0!
Originally this plugin was just for presence detection. But as I needed a bit more functions from fritzconnection, I extended it step by step.
Instead of pinging the device this presence detector uses the host list from the router to check if device is there or not. Benefit - Normally this also works if devices like smart phones save some battery.
Note: If connection between router and device got lost, this can take some time till router marks it as 'not connected' This plugin only works with Fritz Box.
This plugin is open source.
This is a wrapper around python lib fritzconnection from Klaus Bremer. Person Images are from DomoticzIcons, Domoticz Icon from Domoticz Wiki and Raspberry Pi from Raspberry Foundation.
- set up your Fritz!Box
- enable TR064
- create a user
- set password
- assign rights to this user
- a running Domoticz: 2020.2 or 2021.1 with Python 3.7
- Python >= 3.7 (mainly depending on requirements for fritzconnection)
- install needed python modules:
- fritzconnection version 1.4.0
- urllib3
- or even better use
sudo pip3 install -r requirements.txt
- might be worth testing fritzconnection - just run
fritzconnection
- clone project
- go to
domoticz/plugins
directory - clone the project
cd domoticz/plugins git clone https://github.com/belzetrigger/domoticz-FritzPresence.git
- go to
- or just download, unzip and copy to
domoticz/plugins
- optional: adapt naming convention
- what does it do: tries to scan name for this device for special chunks and pick different images for them
- where: plugin.py
- what: eg
ICON_PI_PREFIXES = ["RASPBERRY", "PI"]
will cause all devices containing PI to use raspberry image
- no need on Raspbian for sys path adaption if using sudo for pip3
- some extra work for Windows or Synology, make sure downloaded modules are in path eg. site-packages python paths or change in plugin.py / fritzHelper.py path
- example adaption:
import sys sys.path sys.path.append('/usr/lib/python3/dist-packages') # for synology python3 from community # sys.path.append('/volume1/@appstore/python3/lib/python3.5/site-packages') # for synology sys.path.append('/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages') # for windows check if installed packages as admin or user... # sys.path.append('C:\\Program Files (x86)\\Python37-32\\Lib\\site-packages')
- example adaption:
- restart Domoticz service
- Now go to Setup, Hardware in your Domoticz interface. There add Fritz!Presence Plugin.
this functions are supported
- add WiFi devices
- add ethernet devices
- add active devices
- add all known devices
Keep in mind, normally a device must have been recent active to have a connection type. Also VPN devices are special, as they might not have a MAC-Address.
To send magic packet just click on an off
device to switch it on. WOL works only for ethernet. And the hardware must support it! For example the network adapter on Raspberry Pi 3 does not support it.
- integrate a threshold, when it is more stress-less for router to get full device list and parse this, instead of getting 20 devices/host information
- at the moment support for python plugin rename a device is quite bad, so we use JSON-API call
- On windows system changing icons for sensors did not work, so it's standard switch icon.
- On windows system "update" the hardware breaks imported python libs. Plugin can not get data from FritzBox. But after restart services it works fine.
Version | Note |
---|---|
0.7.0 | * change handling in case of MAC-List usage. Device names are fetched from Fritz!Box and updated on Heartbeat * Using domoticz special Parameter User/Password - so please reinsert. * avoid overwriting custom images with default icons during start up * better checking if inserted values are MAC-Addresses |
0.6.4 | small stability fixes, a bit restructure and tested with new version of lib for issue#2, avoid resetting images on startup also if MAC-List is used, so custom symbols will be kept |
0.6.3 | button to add/remove know hosts from Fritz!Box to Domoticz and support for "Wake on LAN" |
0.6.2 | supports ';' separated list of MAC and names |
>= 0.6 | works with new fritzconnection 1.2.1 and so without need of lxml but Python >= 3.6 |
<= 0.5 | worked with fritzconnection 0.6.x and 0.8.x, needs lxml |
Under development but main function runs quite stabile.
Based on https://github.com/ffes/domoticz-buienradar/ there are
/blz/fakeDomoticz.py
- used to run it outside of Domoticz/blz/blzHelperInterface.py
starting point for some more structure- unittest under folder
/test
- it's the new entry point for tests- copy
sample_config.ini
tomy_config.ini
and adapt to your liking
- copy