{"action":"created","issue":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/1716","repository_url":"https://api.github.com/repos/balloob/home-assistant","labels_url":"https://api.github.com/repos/balloob/home-assistant/issues/1716/labels{/name}","comments_url":"https://api.github.com/repos/balloob/home-assistant/issues/1716/comments","events_url":"https://api.github.com/repos/balloob/home-assistant/issues/1716/events","html_url":"https://github.com/balloob/home-assistant/issues/1716","id":146106551,"number":1716,"title":"Orvibo S20 switch in different subnet","user":{"login":"insertjokehere","id":151027,"avatar_url":"https://avatars.githubusercontent.com/u/151027?v=3","gravatar_id":"","url":"https://api.github.com/users/insertjokehere","html_url":"https://github.com/insertjokehere","followers_url":"https://api.github.com/users/insertjokehere/followers","following_url":"https://api.github.com/users/insertjokehere/following{/other_user}","gists_url":"https://api.github.com/users/insertjokehere/gists{/gist_id}","starred_url":"https://api.github.com/users/insertjokehere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/insertjokehere/subscriptions","organizations_url":"https://api.github.com/users/insertjokehere/orgs","repos_url":"https://api.github.com/users/insertjokehere/repos","events_url":"https://api.github.com/users/insertjokehere/events{/privacy}","received_events_url":"https://api.github.com/users/insertjokehere/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-05T21:07:45Z","updated_at":"2016-04-06T01:28:19Z","closed_at":null,"body":"**Home Assistant release (`hass --version`):**\r\n0.16.1\r\n\r\n**Python release (`python3 --version`):**\r\nPython 3.4.3\r\n\r\n**Component/platform:**\r\nSwitch/Orvibo\r\n\r\n**Description of problem:**\r\nControlling Orvibo S20 switches does not work if the switch is on a different subnet to the Home Assistant host\r\n\r\n**Expected:**\r\nYou should be able to control Orvibo S20 switches as long as you are able to establish a network connection to the switch\r\n\r\n**Additional info:**\r\nI have an Orvibo S20 switch connected to a WiFi network, and that network is accessible from the network my Home Assistant host is running on. I am able to ping the IP of the switch, and get responses. Using the orvibo library, I am able to control the switch by doing:\r\n\r\n```\r\nfrom orvibo.s20 import S20\r\nswitch = S20(\"10.59.1.35\", mac=\"MA:CA:DD:RE:SS:00\")\r\nswitch.on = True\r\nassert switch.on\r\nswitch.on = False\r\nassert not switch.on\r\n```\r\n\r\n(Obviously using the real MAC address)\r\n\r\nIf I modify the source of the orvibo component (diff below) to pass the 'mac' argument as I was doing above, I get the following stack trace:\r\n\r\n```\r\n16-04-05 22:01:14 homeassistant.components.switch.orvibo: S20 at 10.59.1.35 couldn't be initialized\r\nTraceback (most recent call last):\r\n  File \"/opt/homeassistant/venv/lib/python3.4/site-packages/homeassistant/components/switch/orvibo.py\", line 33, in setup_platform\r\n    S20(host, mac=\"MA:CA:DD:RE:SS:00\")))\r\n  File \"/opt/homeassistant/config/lib/orvibo/s20.py\", line 146, in __init__\r\n    self._subscribe()\r\n  File \"/opt/homeassistant/config/lib/orvibo/s20.py\", line 206, in _subscribe\r\n    \"No status could be found for {}\".format(self.host))\r\norvibo.s20.S20Exception: No status could be found for 10.59.1.35\r\n```\r\n\r\nIf I can get this working I will clean it up into a proper pull request.\r\n\r\nAny suggestions as to what might be different between Home Assistant, and calling the library directly?\r\n\r\ndiff of homeassistant/components/switch/orvibo.py:\r\n```\r\n31c31\r\n<                                       S20(host, mac=\"MA:CA:DD:RE:SS:00\")))\r\n---\r\n>                                       S20(host)))\r\n```"},"comment":{"url":"https://api.github.com/repos/balloob/home-assistant/issues/comments/206065003","html_url":"https://github.com/balloob/home-assistant/issues/1716#issuecomment-206065003","issue_url":"https://api.github.com/repos/balloob/home-assistant/issues/1716","id":206065003,"user":{"login":"happyleavesaoc","id":11217032,"avatar_url":"https://avatars.githubusercontent.com/u/11217032?v=3","gravatar_id":"","url":"https://api.github.com/users/happyleavesaoc","html_url":"https://github.com/happyleavesaoc","followers_url":"https://api.github.com/users/happyleavesaoc/followers","following_url":"https://api.github.com/users/happyleavesaoc/following{/other_user}","gists_url":"https://api.github.com/users/happyleavesaoc/gists{/gist_id}","starred_url":"https://api.github.com/users/happyleavesaoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/happyleavesaoc/subscriptions","organizations_url":"https://api.github.com/users/happyleavesaoc/orgs","repos_url":"https://api.github.com/users/happyleavesaoc/repos","events_url":"https://api.github.com/users/happyleavesaoc/events{/privacy}","received_events_url":"https://api.github.com/users/happyleavesaoc/received_events","type":"User","site_admin":false},"created_at":"2016-04-06T01:28:19Z","updated_at":"2016-04-06T01:28:19Z","body":"The home assistant component uses the Orvibo's discovery capability to map the supplied IP to the device MAC address. This process relies on a UDP broadcast, which probably isn't crossing your subnets for whatever reason.\r\n\r\nYour test with the Orvibo module standalone is specifying the MAC address, so there is no discovery step.\r\n\r\nThe solution would be either\r\n- Properly route the UDP broadcast packet on your network\r\n- Modify the Orvibo component to optionally accept a MAC parameter, and use that in the S20 constructor (as your example)."}}