OH3 - Fritz Box TR064 Add-on, Binding

Found it. If somebody else needs it:

Bridge tr064:fritzbox:fritzbox "FritzBox" [ host="ip", user="user", password="pass" ] {
    Thing subdeviceLan fritzboxLAN "FritzBox LAN" [ uuid="uuid", macOnline="...", "...", "...", "..." ]
}
2 Likes

Yeah, it works. I tried many options by myself, but not this syntax :slight_smile: BTW:

Thing subdeviceLan LANDevices  [ uuid="uuid:<id>"]  {
  Channels:
    Type macOnline : PC1  [ NewMACAddress="01:23:45:67:89:AB" ]
    Type macOnline : PC2  [ NewMACAddress="01:23:45:67:89:AC" ]
  }

adds the channels, but fails to interpret the parameter. According to code, macOnline parameter from subdeviceLan thing has effect only.

1 Like

That’s the one that‘ll be fixed with the PR I
linked above: OH3 - Fritz Box TR064 Add-on, Binding

2 Likes

so i have to wait for a new release ? or can i install this by my self?

I think it’s included in the latest SNAPSHOT build, you should be able to update with the following command on the karaf/openhab console (’ openhab-cli console’ ):

update org.openhab.binding.tr064 https://ci.openhab.org/job/openHAB-Addons/lastSuccessfulBuild/artifact/bundles/org.openhab.binding.tr064/target/org.openhab.binding.tr064-3.1.0-SNAPSHOT.jar

works thx =)

Hi!
I’ve tried this, but I’m not sure if the update succeeded. At least the binding still shows V3.0.0 in the MainUI!?
Greetz!

1 Like

apparently the GUI is not updated
i have the same symtom
it works
thx

2 Likes

Just to complete MriX information, which is not present yet in the documentation page, the syntax of the channel for a devices whose MAC address is XX:YY:ZZ:XX:YY:ZZ in an item definition is as follows

Switch Pres "[%s]"    {channel="tr064:subdeviceLan:fritzbox:fritzboxLAN:macOnline_XX_3AYY_3AZZ_3AXX_3AYY_3AZZ"}

It should not be a contact, as it used to be for the old v1 binding.
The fastest way to get the complete channel name is to use the paperUI and go into the Channel Details (sometimes the channel name display an underscore instead of the colon while some others the colon is replaced by _3A).

I tried to add the Channels with the syntax specified in your post, but they do not appear in the paperUI. It seems to me that the definition of sub-devices from text files does not work well: only a subdeviceLan can be defined with text file with the macOnline parameter as specified previously.

At present, therefore, I would conclude that the fastest way to setup this binding in a way that allows a faster re-installation is:

  1. define with text files the bridge and the subdeviceLan (with all required macaddress for presence detection) like MriX post. If the phonebook is not required it may be useful to also set phonebookInterval=“0” as an additional parameter, otherwise the phonebook will be downloaded every 10 minutes. (needs to be done once)
  2. manually copy the automatically generated channels links in the items definition files (needs to be done once)
  3. discover by paper ui the other subdevices and add them as things if the corresponding channels are required (e.g. the total downloaded bytes). (should be done at every reinstallation)
  4. manually copy the paperUI generated channel links in the .items file (needs to be done once)

@J-N-K. in the UI, when adding a discovered sub-device as a Thing there is no possibility to specify a UID. The automatically generated UID is unpractically long (the associated channel names sometimes are not fully displayed in the UI unless I maximize the window width), e.g.

UID: tr064:subdevice:fritz7590:uuid_3A75802409_2Dbccb_2D40e7_2D8e69_2D444E6DDDA268

Would it be possible to let the user select a (shorter) UID?

Not a binding issue. If the UI allows it, it‘ll work with the binding.

@J-N-K Thank you for your answer. I’ve seen that it has already been proposed to add the possibility to change the UID at the creation time.

Meanwhile, I’ve tried to manually add the subdevices through the UI (in order to try setting the UID) but I’ve seen that it is only possible to a add a subdeviceLan type. There is not a possibility to specify the type of device ( deviceType=“urn:dslforum-org:device:LANDevice:1” or deviceType=“urn:dslforum-org:device:WANDevice:1” or deviceType=“urn:dslforum-org:device:WANConnectionDevice:1”). Is this going to be fixed or is it a wanted behavior?
Many thanks for your work

Yeah, I’m fighting with this binding too, the old one was described very good, here it’s very small so it makes not easy to figure out how it works. I try also to figure out how I can check the mac id which are online. For me the text looks different like what I read here. I’m not sure which character is the separator if you have more then one. and so on … I’m not sure if I go back to 2.5 at the moment. I fixed a lot of things which are changed in OH3, open some new bugs and replaced a lot of scriting things. The presence detection is one of the basics and is implemented in a lot of rules.

I don’t want cry, I know that all developer do his best and do it in his freettime - respect for this from my end - but some major issues I wondering that these are not tested before. Hope we get in a short while an upgrade :slight_smile:

My approach is to keep my production system in OH2.5: “don’t fix what is not broken”. My feeling is that usability of OH3 will improve considerably so, given my limited skills, it is not worth spending time now in adapting the old 2.5 configuration.

Meanwhile I’m practicing with OH3 on a different raspberry, to figure out how to take advantage of new features, such as this TR-064 binding which allows to monitor more than one fritzbox. I am very grateful to developers for their hard work, done in their free time.

As far as I understand, there is some debate among developers (and with some users too) about the textual configurations we (simple OH1 and OH2 users) are accustomed to. On the one hand OH2 style textual configurations are undoubtedly error-prone and time consuming both for users and developers and forum-helpers; on the other hand, the advantage is that once set up they are very handy.
It seems to me (from my limited point of view, of course) that developers are focusing on the MainUI with automatic discovery first, removing remaining bugs. After that, manual (still with the UI) and “textual” configuration will eventually come. I put “textual” in quotes because it seems to me that there may be more possibilities of text editing than the .things, .items files: for example, copy-pasting the YAML definitions of things or modifying the jsondb databases.

Finally, it’s easy to miss (at least for me) some important points in the documentation. I keep searching in the forum and re-reading the docs to try to understand better.

In summary I believe that, once the dust will set down, transition to OH3 will be much easier, but foe now I keep OH2.5 for production.

What is unclear regarding the separator? It‘s in the fix and also in the parameter description in the UI. Wherr do you miss the Information?

thanks for asking, I understand that I can enter more then one mac adresses into the Mac Online field. but what is the separator between these or is my understanding wrong ?

I enter xx:xx:xx:xx:xx:xx,yy:yy:yy:yy:yy:yy

First I will install the fix

Just press „Enter“ and use the next line. No idea how to do that in .things. Don‘t use them, makes life a lot easier.

Works - I update the binding and it is a good idea to use a second line ! Now both Mac are available. Thanks !

1 Like

.things

Bridge tr064:fritzbox:1 [ host="192.168.178.1", user="uuuuuu" , password="pppppp" ] 
 { Thing subdeviceLan FB_Online [uuid="uuid:12345678-abcd-xxxx-xxxx-1234567890ab", macOnline="XX:XX:XX:XX:XX:X1","XX:XX:XX:XX:XX:X2","XX:XX:XX:XX:XX:X3"]
  }

.items

Switch  FB_MAC1   "MAC1 [%s]" <handy>  (Fritz)  ["Presence"]  {channel="tr064:subdeviceLan:1:FB_Online:macOnline_XX_3AXX_3AXX_3AXX_3AXX_3AX1"}