OpenHAB3 Network Binding Configuration with Text Files on Windows 10 - awake IOS iPhone not detected

Does the private address remain constant of is it randomized?

binding.network:allowSystemPings=true

becomes

binding.network:allowSystemPings=false

Which would disable system ping and cause it to use Java.

Those “ancient” posts are probably still valid. This binding hasn’t changed much in this area for years.

Per the link in my earlier post, it should be constant within the same network.

To improve privacy, iOS 14, iPadOS 14, and watchOS 7 use a different MAC address for each Wi-Fi network. This unique, static MAC address is your device’s private Wi-Fi address, used for that network only.

On a side note, this feature was apparently hidden in Android 9’s developer settings, and is now the default in Android 10.

I can say that for Android at least, when Android 10 installed it immediately created a different MAC for all networks it connected to after the upgrade, including networks that were previously connected to. As a result our phones were no longer detected. The settings can be changed on a per ssid basis on Android.

I have 2 WiFi SSIDs in my home. With limited testing on my iPhone I am finding that the “private address” MAC address holds constant for a SSID but changes among SSIDs.

I am continuing to test my iPhone.
The network binding things configuration documentation states 4 examples:

network:pingdevice:one_device [ hostname="192.168.0.64" ]
network:pingdevice:second_device [ hostname="192.168.0.65", macAddress="6f:70:65:6e:48:41", retry=1, timeout=5000, refreshInterval=60000 ]
network:servicedevice:important_server [ hostname="192.168.0.62", port=1234 ]
network:speedtest:local "SpeedTest 50Mo" @ "Internet" [refreshInterval=20, uploadSize=1000000, url="https://bouygues.testdebit.info/", fileName="50M.iso"]

followed by

Use the following OPTIONS for a network:pingdevice:
hostname: IP address or or or or hostname of the device.
macAddress: MAC address used for waking the device by the Wake-on-LAN action.
retry: After how many refresh interval cycles the device will be assumed to be offline. Default: 1.
timeout: How long the ping will wait for an answer, in milliseconds. Default: 5000 (5 seconds).
refreshInterval: How often the device will be checked, in milliseconds. Default: 60000 (one minute).

Per the one_device example, is it permissible to use the hostname: IP address or or or or hostname of the device. option? IE.,

network:pingdevice:one_device [ hostname="6f:70:65:6e:48:41", retry=1, timeout=5000, refreshInterval=60000 ]

Is it an option or not? The documentation lists it as an option but my testing does not work with OR without it.

Here' my `.things` file
Thing network:pingdevice:RobertRoot [ hostname="e4:9a:dc:6f:88:b2", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:RobertMain [ hostname="7a:74:3e:0f:3d:ac", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:Robert17	[ hostname="1a:bc:16:a8:23:43", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:Robert18	[ hostname="ca:6d:1f:4b:65:57", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:Robert5G	[ hostname="46:c2:74:f6:34:46", retry=10, timeout=2000, refreshInterval=10000 ]

I have not been able to get any of these work.

I also tried:

Thing network:pingdevice:RobertMain [ hostname="7a:74:3e:0f:3d:ac", macAddress="7a:74:3e:0f:3d:ac", retry=10, timeout=2000, refreshInterval=10000 ]

and it does not work.

The only way I have been able to get OH3 to recognize the device is by assigning my iPhone to a router static address and configuring as follows:

Thing network:pingdevice:RobertMain [ hostname="10:0:0:20", retry=10, timeout=2000, refreshInterval=10000 ]

but then if I switch the iPhone to “wifi off” OH3 CONTINUES to discover it!
I have even put the phone in “airplane mode” and it still falsely discovers it.

Either the binding has an issue or I’m doing somethin wrong.
Any suggestions?

Thanks again.

You’re confusing hostname with macAddress. A device would never identify itself on a network as its MAC address. The hostname can only be an IP or the network name you gave the device in its settings.

If you try to use the MAC as the hostname, it will definitely fail. I think what you want to try is to omit the hostname completely.

Thing network:pingdevice:RobertMain [ macAddress="7a:74:3e:0f:3d:ac", retry=10, timeout=2000, refreshInterval=10000 ]

I have no idea if this will work. I was already using static IPs before I got into openHAB, so I’ve never felt the need to dig deeper.

  • Thanks for the clearing up my misinterpretation of “hostname”.

  • The only channel of the following that works is the last channel where IP is the router static IP address.

The first 6 channels set the switch item to OFF. If I turn the switch item ON then OH returns it to OFF after a slight delay. But it never turns it ON.

The 7th channel switch item acts differently. It’s .state is null and if I turn the switch item ON then it stays null, AND OH returns it to OFF after a slight delay, but the .state remains at null no mater what I do.

	Thing network:pingdevice:RobertName [ hostname="RA.Nyholm", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:RobertRoot [ hostname="e4:9a:dc:6f:88:b2", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:RobertMain [ hostname="7a:74:3e:0f:3d:ac", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:Robert17	[ hostname="1a:bc:16:a8:23:43", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:Robert18	[ hostname="ca:6d:1f:4b:65:57", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:Robert5G	[ hostname="46:c2:74:f6:34:46", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:RobertMAC	[ macAddress="7a:74:3e:0f:3d:ac", retry=10, timeout=2000, refreshInterval=10000 ]
	Thing network:pingdevice:RobertIP	[ hostname="10.0.0.20", retry=10, timeout=2000, refreshInterval=10000 ]e only one of the following ```

If I could get only one of the non-working channels to work I would choose the first where the hostname is my device name. With it a wifi connect via any of the SSIDs would be detected, and I would not need to configure my router with static IPs.

Is that too much to hope for?
Any suggestions?

Okay, so that would seem to confirm that you have to have the hostname with an IP address.

But let’s put that aside, because I think you might be overcomplicating this. As I understand it, your goal is to detect your phone regardless of which WiFi it’s on. You can do this with a group:

  1. Create a thing/item for your phone when it’s connected to the first SSID (with a static IP)
  2. Create a thing/item for your phone when it’s connected to the second SSID (with a different static IP)
  3. Create a group that is ON when one of the two items is ON.

Personally, I would install a mesh router to remove the problem entirely, but I’ll look for any excuse for a tech upgrade.

Russ,
Thank you. Your suggestion with static IPs will work.

I’ve been doing further testing since I would really like my devices to be discovered by “Hostname” as the documentation states is achievable. Since I had only failures discovering the iPhone I decided to try my pc.

I found that “Hostname” does work if and only if MyComputer is connected to the router via hardwire. It is discovered almost immediately when plugged in, and undiscovered within ~1-2 minutes.

Thing network:pingdevice:MyComputerChannel [ hostname="MyComputer", retry=10, timeout=2000, refreshInterval=10000 ]

If I connect to MyComputer via WiFi it is not recognized :frowning:
I have tried clean starts by simultaneously rebooting the router and MyComputer, and restarting OH. No matter what I try the binding will not discover MyComputer when connected via WiFi.

My conclusion is that the network binding has issues. It does seem strange that the “Hostname” does not work with WiFi but does with hardwire. I would not think the host’s name to be altered, prefixed, or appended with additional information that might be confusing the binding?

Do you have any thoughts or suggestions?
Do you know how I can report this issue with the binding to its author(s)?

is your computers hostname resolved to it’s IP address within the network when it is connected via WiFi ?

There’s not enough information here to draw any conclusions. I’m not saying you’re wrong, but you’re assuming that there are no issues with your network. And in my experience, that’s just as likely to be the problem.

I don’t consider local hostnames to be reliable. I used to find that one of my Android devices could only resolve my openHAB server by its IP address, and then one day the hostname started working…even though I didn’t change anything. Windows devices tend to be less problematic.

You also have two WiFis in the same space and attached to the same network. I have no idea about your network configuration, but the problem could be that your iPhone identifies itself with the same hostname on two different networks.

I use static IPs because they always work, and I use mesh to avoid having my devices jump between two SSIDs. So, my suggestions remain as above.

Problem solved. :slight_smile:

I have a love / hate relationship with OpenHAB. Way too many “features” that documentation does not address.

Thing network:pingdevice:RobertName [ hostname="RA.Nyholm", retry=10, timeout=2000, refreshInterval=10000 ]

does not work, but

Thing network:pingdevice:RobertName [ hostname="RA-Nyholm", retry=10, timeout=2000, refreshInterval=10000 ]

does.

The binding does not like the decimal in the host name even though it is a very common naming convention. I suppose the author looks for a decimal and assumes it is an IP address?

The documentation needs to be updated to include “The hostname cannot contain any decimals”.
What other characters will it not accept :frowning:

I believe what’s happening is that you’re not familiar with how iOS generates device hostnames.

I assumed that you had intentionally named your iPhone “RA.Nyholm”, in which case that’s how it would identify itself on your network. But if it’s named “RA Nyholm”, then iOS converts that to RA-Nyholm. Spaces become hyphens, and special characters are excluded. So “Robert’s iPhone” would become Roberts-iPhone.

Actually, now I’m not even sure if naming it “RA.Nyholm” would keep the period, or convert to RANyholm. I think the period would stay in that case.

I don’t have an iPhone handy to test, so correct me if I’m wrong, but that’s how hostnames work for the iPads I’ve maintained in my workplace. I can’t find any evidence on the web that Apple has changed this practice.

While this is not a case of the documentation being incorrect or a feature being unaddressed, it is true that it happens, because the docs are maintained by community members like you and me. I’d caution you again about jumping to conclusions that something is broken/incorrect, but I’d also encourage you to submit edits to the docs when you come across something that could be improved. You just need a GitHub account, and once you do it a few times it becomes really easy. The only way the docs will improve is if the people who notice issues improve them.

If you’re interested, I can provide some links to help you get your feet wet.

My NetGear router sees and lists the decimal in the host name. The binding must eliminate or replace the illegal characters. But which characters?

I’m a weekend warrior and am programming new features or new applications every several months to a year. I should attend an online class to understand more.

I am a member of the community and GitHub. I submitted a documentation note to the link at the bottom of the binding documentation. Who reviews the submission to ensure it’s not further misleading casual users like me? Hopefully the author?

Thanks for helping me thru this issue.

Again, I don’t know why you think the binding is at fault. It could just as easily be that your Netgear router is showing you a period (it’s not a decimal) instead of a hyphen. Particularly since the binding works when you use the hyphenated hostname I would expect to see from an iOS device.

Maintainers will review your Pull Request and either approve or return it to you with comments.

Before submitting your conclusion that periods are converted to hyphens, you really should test it to be certain. I suggest that you rename your iPhone and your Windows PC to have periods in their hostnames (no spaces at all), see how your Netgear router displays them, and then see if you can find them with openHAB. After that, change the hostnames to use hyphens instead, and repeat to see the results. Then change them to have spaces.

Testing aside, I appreciate your willingness to contribute. Many people complain about the docs, and then do nothing when we suggest that they try to help.

https://developer.apple.com/forums/thread/133763

2 Likes

The decimal has a very specific meaning in host names. That’s not the binding author, that’s how host names work. Each computer has a “fully qualified domain name”. Everything after the first . is considered the host name. Everything after is the domain name. So RA.Nyholm means hostname “RA” and domain “Nyholm”. Therefore, you can’t have a . in a hostname, only in a FQDN. And if you’ve not set up your network to have a FQDN you can’t use a . at all.

That’s why, as Russ explains, iOS replaces invalid characters with -. And further reading the thread Wolfgang posted it appears that once again this is a place where Apple when their own way and had to go though all sorts of complications to interoperate with the rest of the world.

But all of this is outside of openHAB. openHAB can do a lot but it’s not going to teach you the basics of the technology you are trying to interact with. We simply do not have enough people nor expertise here to document the basics for all the technologies that OH can interact with. So I don’t think documenting how hostnames work in general belong in openHAB’s documentation. Maybe a link to the RFC that defines the way that hostnames work might be appropriate. Or a link to the thread Wolfgang posted with a warning about how Apple “goes their own way.”

The OH docs come from lots of different repos and therefore who reviews it will largely depend on what is being changed. If it’s part of the core docs or developer docs, one of the openhab-docs maintainers will review it. If it’s docs for a binding, usually the binding author or one of the openhab-addons maintainers. There are more sources for various parts of the docs and a good post about that is at [Wiki] How to contribute to the openHAB Documentation.

But the key takeaway is nothing gets added to the docs without at least one person reviewing it for correctness and conformity to style and such. So don’t worry about mucking up the docs. We definitely need the help.

1 Like

After 2 weeks of observation I concur I agree with Russ: I don’t consider local hostnames to be reliable. I have found the only reliable discovery method is to assign the iPhone to a static ip address.

This thread is hereby closed.
Much thanks goes to all that helped me.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.