Wemo Connect App error

It is now working. I removed from HE the devices that were causing the errors. I updated Wemo Connect and driver code. Wemo Connect rediscovered the devices.

I noted some duplicate Wemo devices in Google Home integration list. Working on resolving that next.

Thank you Jason.

What is the difference between the Wemo Switch and Wemo Insight Switch drivers?

The Insight is an older switch that can detect and report the amount of power used.

Looks like my discovery is seeing the same 9 again (duplicates) and not still not seeing the new mini insights.

How do you find the "12345" part of the IP address? When I look in my wifi router I only see the standard ip address?

Provide an address in the format 192.168.0.10:12345

I tried the ports that my other wemo's were using 49153/49154 but it says - The address was invalid or the device was unreachable. Please try again.

192.168.86.47:49153
192.168.86.47:49154

192.168.86.50:49153
192.168.86.50:49154

192.168.86.33:49153
192.168.86.33:49154

@jason0x43 would running this app on multiple hubs impact anything? before hub mesh was a thing, i did have the app on multiple hubs. haven't really had any issues since moving to the new code, but definitely don't want to cause any issues with constant polling on the devices. i'm most likely going to clean up my devices and only run it on one hub anyway, but just curious

I believe I've only ever seen it in the range 49152-49154, but I don't know of a way offhand to discover it aside from just trying them (that's generally handled by the discovery process). You can use curl, which might be a bit faster:

curl http://92.168.86.47:49153/setup.xml

It shouldn't have a significant impact. If you've added the same device to multiple hubs, each hub will subscribe to update events from the device. There's no polling involved, but the Connect app will periodically (every 5 minutes by default) manually resubscribe to each device you've added. (Subscriptions normally get renewed as the hub communicates with devices, but they can be dropped if there's no communication for a while.)

2 Likes

I do still have some switches going offline randomly, and I'm running the new code. I did update my C-7 hub to 2.2.5.123, so not sure if that might've broke it. I'll try uninstalling and reinstalling later today, but for now I have a handful of switches that are offline

I am having the same issue as well with some outlet devices randomly dropping offline using the latest code. As best I can tell, it appears to be related to the device changing the port number. The app still tries to subscribe using the original port number resulting in a connection refused warning. I can temporarily resolve this by deleting the device and allowing the app to recreate the device using the updated port number. I’ll also note that manually changing the port number in the device preferences appears to have no effect. The app continues to use the original port number set for the device regardless of the port value set in preferences.

this is exactly what i do to fix it as well

there are multiple issues with the updated App.
for example, if I update the port in the preference, it failed.
def hexPort = HexUtils.integerToHexString(*(int)*port,2)
update this line fixed the issue.
but then, the next day, all of them are offline.
because wemo seems to change the port every few hours, and the app is not updating the port during the discovery of the existing device.

in the app code, change
def hexPort = HexUtils.integerToHexString(port, 2)
to
def hexPort = HexUtils.integerToHexString((int)port, 2)

this fix allows you to manually override the port.

Thanks! I tried this and can confirm it allows me to change the port and get the device back online with the app.

what value are you using? do you just test 49152, 49153, 49154 and do a poll after updating to each?

Yes, mine have typically been 49153 or 49154. After changing the port, a Refresh on the device gets it back online.

1 Like

Actually I just had one switch to port 49157 (hex C005). FYI, you can see the current port assignment if you enable debug logging in the Wemo Connect app and then look for a log starting with “handleSetupXml: Discovered devices”. That is how I figured out how it switched to 49157.

So far it is only certain devices that have been changing ports for me. I don’t know what causes it or why it is only certain ones.

looks like the port can be 49xxx for local web service calls. 49152 and 49153 are used most of the time, but numbers can increase.

here's a temp fix to automatically update port if it changed.

in the app code, around after line 470:
discoveredDevice.mac = mac

add this

        discoveredDevice.port = hexIp.split(":")[1]
        getChildDevices().each { if (it.deviceNetworkId == mac && it.getDataValue('port') != discoveredDevice.port ) 
                                {
                                    debugLog ("Update port "+it.getDataValue('port')+ "->"+discoveredDevice.port )
                                    it.updateDataValue('port', discoveredDevice.port) 
                                    it.updateSetting("ipPort", [type:"number", value: hexToInt(discoveredDevice.port)])
                                    it.refresh()
                                } 
                               }
1 Like

There actually was code in the app doing basically that until the last update. I reorganized and consolidated some of the device handling code, and that bit of child update code got lost. :man_facepalming:

I've added that back to the connect app.