Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WOL stopped working on 0.112.3 #37623

Closed
tjhiwa opened this issue Jul 7, 2020 · 11 comments
Closed

WOL stopped working on 0.112.3 #37623

tjhiwa opened this issue Jul 7, 2020 · 11 comments

Comments

@tjhiwa
Copy link

tjhiwa commented Jul 7, 2020

The problem

After updating to 0.112.3 (from 0.112.2), the wake on LAN no longer works, with error. It's called from LG WebOsTv integration.

Environment

  • Home Assistant Core release with the issue: 0.112.3
  • Last working Home Assistant Core release (if known): 0.112.2
  • Operating environment (OS/Container/Supervised/Core): VM
  • Integration causing this issue: WebOsTv
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/webostv/

Problem-relevant configuration.yaml

webostv:
host: 192.168.x.x
name: LG Smart TV
turn_on_action:
service: wake_on_lan.send_magic_packet
data:
mac: 2C-2B-xx-xx-xx-xx
broadcast_address: 192.168.x.x

Traceback/Error logs

Log Details (ERROR)
Logger: homeassistant.components.websocket_api.http.connection.140102368585616
Source: components/wake_on_lan/init.py:46
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 2:14:25 AM (3 occurrences)
Last logged: 2:15:16 AM

an integer is required (got type NoneType)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/webostv/media_player.py", line 331, in async_turn_on
await self._on_script.async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 831, in async_run
await run.async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 555, in async_run
await self._async_run()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 572, in _async_run
await self._async_step(log_exceptions=not propagate_exceptions)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 153, in _async_step
self, f"async{cv.determine_script_action(self._action)}_step"
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 656, in _async_call_service_step
*self._prep_call_service_step(), blocking=True, context=self._context
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/wake_on_lan/init.py", line 46, in send_magic_packet
port=broadcast_port,
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.7/site-packages/wakeonlan.py", line 79, in send_magic_packet
sock.connect((ip, port))
TypeError: an integer is required (got type NoneType)

Additional information

@frenck
Copy link
Member

frenck commented Jul 7, 2020

Hi there @tjhiwa,

Thanks for opening up an issue! When creating an issue, an issue template is presented. Could you please update your issue description so it uses that template?

Thanks already! 👍

@tjhiwa
Copy link
Author

tjhiwa commented Jul 7, 2020

Hi there @tjhiwa,

Thanks for opening up an issue! When creating an issue, an issue template is presented. Could you please update your issue description so it uses that template?

Thanks already!

Updated.

@neskorodev
Copy link

Same issue with 0.112.3 on HassOS 4.11 kvm appliance.

@kurtdorsey
Copy link

I had this issue too.
Added
broadcast_port: 9
to work around

@treforparr
Copy link

where do I add this

@kurtdorsey
Copy link

kurtdorsey commented Jul 8, 2020

where do I add this

This fixed the issue for my WebOS TV
Added it in the data block after mac
turn_on_action:
service: wake_on_lan.send_magic_packet
data:
broadcast_address: !secret gameroomtv_ip
mac: "FF:FF:FF:FF:FF:FF"
broadcast_port: 9
`

@probot-home-assistant
Copy link

Hey there @bendavid, mind taking a look at this issue as its been labeled with an integration (webostv) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@stshontikidis
Copy link
Contributor

stshontikidis commented Jul 8, 2020

This is not an issue with the WebOS integration, it is an issue in the wake_on_lan integration and was introduced in 112.0. This most likely duplicates #37399 and #37107 I have a PR #37387 that should take care of this, as I also use WOL for my LG tv. @frenck can you remove the webostv integration label

@kurtdorsey
Copy link

Agree, WebOS is just one of the integrations that uses WOL, looks like the addition of the broadcast_port is having issues as it is sending None to media_player.turn_on where media_player.turn_on is expecting an in

2020-07-07 08:35:38 INFO (MainThread) [homeassistant.components.wake_on_lan] Send magic packet to mac FF:FF:FF:FF:FF:FF (broadcast: 192.168.0.187, port: None)
2020-07-07 08:35:38 ERROR (MainThread) [homeassistant.helpers.script] Error executing script. Unexpected error for call_service at pos 1: an integer is required (got type NoneType)
Traceback (most recent call last):
File "/opt/homeassistant/lib64/python3.8/site-packages/homeassistant/helpers/script.py", line 152, in _async_step
await getattr(
File "/opt/homeassistant/lib64/python3.8/site-packages/homeassistant/helpers/script.py", line 655, in _async_call_service_step
await self._hass.services.async_call(
File "/opt/homeassistant/lib64/python3.8/site-packages/homeassistant/core.py", line 1260, in async_call
task.result()
File "/opt/homeassistant/lib64/python3.8/site-packages/homeassistant/core.py", line 1295, in _execute_service
await handler.func(service_call)
File "/opt/homeassistant/lib64/python3.8/site-packages/homeassistant/components/wake_on_lan/init.py", line 41, in send_magic_packet
await hass.async_add_job(
File "/usr/lib64/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/opt/homeassistant/lib64/python3.8/site-packages/wakeonlan.py", line 79, in send_magic_packet
sock.connect((ip, port))
TypeError: an integer is required (got type NoneType)

@golles
Copy link
Contributor

golles commented Jul 8, 2020

Same issue here, it does work when adding the earlier suggested broadcast_port: 9.

Either the docs on https://www.home-assistant.io/integrations/wake_on_lan/ and developer-tools/service mention that broadcast_port is an optional parameter, so that seems to be wrong at this moment.

@stshontikidis
Copy link
Contributor

This should be fixed in 0.112.4 via #37387

@balloob balloob closed this as completed Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants