My Wemo devices recently started using port 49154 instead of 49152 or 49153 which broke you script and hence the whole workflow. You may want to rewrite it and take that into account.