I have installed the binding, created a corresponding user in the FritzBox and set it up via the binding’s cfg file.
First, when loading the cfg file, I see the following message in the log:
[WARN ] [ing.fritzboxtr064.internal.Tr064Comm] - No tr064 service found for service id urn:WLANConfiguration-com:serviceId:WLANConfiguration3
I don’t know what that means but this, however, does not seem to stop the binding from generally working, I can get values for items like this:
String fboxName “FBox Model [%s]” {fritzboxtr064=“modelName”}
String fboxSerial “FBox Serial [%s]” {fritzboxtr064=“serialNumber”}
Switch fboxWifi24 “2,4GHz Wifi” {fritzboxtr064=“wifi24Switch”}
However, what does not work is to check for presence of a device by providing its MAC address:
Contact cFboxMacOnline “Presence (WiFi) [%s]” {fritzboxtr064=“maconline:XX-XX-XX-XX-XX-XX”}
(XX replaced by the MAC) keeps staying OFF, even though the web interface of the FritzBox clearly shows that it’s online. Also changing the item type from Contact to Switch does not help.
Any ideas or workarounds for a presence detection?
i´m using the TR064 for presence detection and have no problems like you described.
My items are using the Contact definition Contact fbMichael "Michael [MAP(presence.map):%s]" <presence> (gPersist) {fritzboxtr064="maconline:AA-BB-CC-DD-EE-FF"}
I´ve never seen the message No tr064 service found for service id... in my logs.
There was a discussion about this error some years ago at Github.
Please change the log level to DEBUG through the console:
(please read everything before starting )
sudo openhab-cli console
// Login with your user
// Wait for the console to load
log:set DEBUG org.openhab.binding.fritzboxtr064
// Check if the log level was set to DEBUG for the TR064 binding
log:get
// Restart the binding to get new logs
bundle:restart org.openhab.binding.fritzboxtr064
// or use
bundle:list | grep Fritzbox
// remember the id from the beginning of this line
bundle:restart <ID>
Now you can check the logs and should see some more detailled messages.
What does your log say right after the No tr064 service found error?
Please post it here.
And by the way, please have a look at this thread to learn how to put your code and logs in tags so it´s easier to read
Thank you. Yes, I had seen that posting at Github already when trying to fix the problem but it didn’t help me. Concerning the questions there, the Fritzbox returns the SOAP request successfully and the setting in the WebUI is enabled.
I have tried enabling the debug logging but it does not work for me: the DEBUG level is not enabled, maybe the path is wrong?
openhab> log:set DEBUG org.openhab.binding.fritzboxtr064
openhab> log:get
Logger │ Level
───────────────────────────────────────────────────┼──────
ROOT │ WARN
javax.jmdns │ ERROR
org.apache.karaf.jaas.modules.audit │ INFO
org.apache.karaf.kar.internal.KarServiceImpl │ ERROR
org.apache.karaf.shell.support │ OFF
org.eclipse.smarthome │ INFO
org.jupnp │ ERROR
org.openhab │ INFO
org.openhab.binding.hue │ INFO
org.ops4j.pax.url.mvn.internal.AetherBasedResolver │ ERROR
org.ops4j.pax.web.pax-web-runtime │ OFF
smarthome.event │ INFO
smarthome.event.InboxUpdatedEvent │ ERROR
smarthome.event.ItemAddedEvent │ ERROR
smarthome.event.ItemRemovedEvent │ ERROR
smarthome.event.ItemStateEvent │ ERROR
smarthome.event.ThingAddedEvent │ ERROR
smarthome.event.ThingRemovedEvent │ ERROR
smarthome.event.ThingStatusInfoEvent │ ERROR
No the path is correct and for me it works, but it´s not shown with log:get.
Looks like a bug…
Please have a look at your log and restart the bundle as described before.
I had a look at the source and WLANConfiguration3 is the guestwifi.
I don´t think this message is responsible for your problem.
The log says MAC not known to FritzBox!
It sounds like you used the wrong MAC address.
Please double check the address you used in your item and the one that´s displayed in the FritzBox UI.
Yes, I see the log entry, however, the MAC is definitely correct and also listed as Online in the FritzBox’s WebUI. The only difference is that on the WebUI it’s listed with the normal “:” as separators and I have used “-” separators as required by the binding. Otherwise it’s identical.
I see another thing though:
the device with this MAC is not directly connected to the FritzBox’s Wifi but the FritzBox is connected via cable to another access point which in turn connects to the device. This normally should not be a problem and the WebUI shows the device as Online, however it shows it as Online and connected to LAN, not WIFI. Is that possible the cause of the problem? Is “maconline” only looking for devices connected to WiFi (directly, no Access Point in between)? If yes, is it possible to also look for all devices instead?
No, I just verified: even when I put my phone next to the FritzBox and it directly connects to the WiFi (also shown on the WebUI) the binding still displays “MAC not known”.
I made a quick test and added my PC as an item and it´s working.
The item switched from null to OPEN and back to CLOSED when disconnected.
2019-01-13 23:27:10.965 [vent.ItemStateChangedEvent] - fbMacPro changed from NULL to OPEN
2019-01-13 23:45:25.864 [vent.ItemStateChangedEvent] - fbMacPro changed from OPEN to CLOSED
Just to compare, i´m using version 1.13.0 of the binding.
I´m out of ideas and would suggest to open an Github issue for this. @tensberg do you have any ideas?
Seems to be a relatively frequent problem with that binding, there are a lot of people complaining about similar problems with that binding. Does not seem to work for me. Any proposal what alternative to use best instead? Is it a good idea to use the network binding and look for the IP instead or is that less reliable?
What mobile devices are you using?
There are some solutions for Android devices and some others for iOS devices.
iOS devices are a little bit difficult because the stop answering pings after some time.
That´s why i´m not using any ping solution in my oH and stick to the FritzBox maconline or iCloud location solutions.
Actually both. I need to check for an Android as well as for an iOS device (my wife’s). So a combination of network binding and iCloud location would be best?
Have you tried different MAC addresses with the binding?
There should be a solution for this.
Are you able to create a Github issue? Otherwise i would create it for you.
Yeah because it‘s not the official repo, just the repo of the user Gitbock.
I know he worked at the binding but it‘s better to create an issue in the openhab1-addons repo.
Edit: And add an link to this discussion in your issue
If I uninstall the binding and then reinstall it, it works again for a while. (about one hour).
Pressing the save button into Configuration>Bindings>FritzboxTR064 also helps
My configuration openjdk version “1.8.0_252” / openhab 2.5.4 on a raspberryPI