jaruba / ha-samsungtv-tizen

📺 HomeAssistant - For Samsung TVs 2016+, Includes SmartThings API and Channel List Support
Apache License 2.0
284 stars 64 forks source link

Incorrect MAC address format #182

Open ZAAJR opened 2 years ago

ZAAJR commented 2 years ago

I am getting an "Incorrect MAC address format" error when trying to turn on a Samsung TV. It used to work in previous version, but no longer working in: Home Assistant Core 2022.6.5 Home Assistant Supervisor 2022.05.3 Home Assistant OS 8.1

Full error message shown below. I am not sure what format the MAC address should be in in the configuration.yaml file. I have tried separating with colons (:) and with no separation between the pairs.

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 193, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1704, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1741, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 680, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 964, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 717, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/samsungtv/media_player.py", line 460, in async_turn_on await self.hass.async_add_executor_job(self._wake_on_lan) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/samsungtv/media_player.py", line 450, in _wake_on_lan send_magic_packet(self._mac, ip_address=self._host) File "/usr/local/lib/python3.9/site-packages/wakeonlan.py", line 52, in send_magic_packet packets = [create_magic_packet(mac) for mac in macs] File "/usr/local/lib/python3.9/site-packages/wakeonlan.py", line 52, in packets = [create_magic_packet(mac) for mac in macs] File "/usr/local/lib/python3.9/site-packages/wakeonlan.py", line 31, in create_magic_packet raise ValueError("Incorrect MAC address format") ValueError: Incorrect MAC address format

Configuration.yaml

media_player:
  - platform: samsungtv_tizen
    name: lounge_tv
    host: 192.168.0.62
    mac: 54bd7933954e
    api_key: xxxxxxxxxxxxx
    device_id: xxxxxxxxxxxxxxxx

Also tried

 media_player:
  - platform: samsungtv_tizen
    name: lounge_tv
    host: 192.168.0.62
    mac: 54:bd:79:33:95:4e
    api_key: xxxxxxxxxxxxx
    device_id: xxxxxxxxxxxxxxxx
numbnp commented 2 years ago

Try

 media_player:
  - platform: samsungtv_tizen
    name: lounge_tv
    host: 192.168.0.62
    mac: "54:bd:79:33:95:4e"
    api_key: xxxxxxxxxxxxx
    device_id: xxxxxxxxxxxxxxxx
magyartj commented 2 years ago

I use dashes in my MAC address format. This is my configuration below which works just fine.

`media_player:

I also think using the quotes and colons as @numbnp used is also valid, as I may have used that at one time.