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

Not working (Error code -5001 invalid params) #3

Open
joshix3m opened this issue Jan 29, 2020 · 8 comments
Open

Not working (Error code -5001 invalid params) #3

joshix3m opened this issue Jan 29, 2020 · 8 comments

Comments

@joshix3m
Copy link

I have installed the addon through hacs, and i have installed the philips android TV plugin. Gotten password and username from the TV. I can control the TV with the media player function.

I have then added this switch plugin in the configuration.yaml with username/password as described, but when turning on the switch in HA i get an error message:

"Could not call service: switch/turn_on {'code': -5001, 'message': 'invalid params'}"

Anyone else seen this issue?

@joshix3m joshix3m changed the title Nort working (Error code -5001 invalid params) Not working (Error code -5001 invalid params) Jan 29, 2020
@joshix3m
Copy link
Author

This is the complete error in the log:

{'code': -5001, 'message': 'invalid params'}
Traceback (most recent call last):
File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 119, in follow_tv
if ambiSetting['styleName'] == "FOLLOW_VIDEO":
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1251, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 201, in handle_service
self._platforms.values(), func, call, service_name, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 335, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 357, in _handle_service_platform_call
await getattr(entity, func)(**data)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 83, in turn_on
self.follow_tv(self._position, 0.05) # 0.05ms is the 'sleep' time between refresh cycles
File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 325, in follow_tv
self.turn_off()
File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 88, in turn_off
self._bulb.stop_music() # disables (more intensive) music mode afterward
File "", line 2, in stop_music
File "/usr/local/lib/python3.7/site-packages/yeelight/main.py", line 114, in _command
result = self.send_command(method, params).get("result", [])
File "/usr/local/lib/python3.7/site-packages/yeelight/main.py", line 441, in send_command
raise BulbException(response["error"])
yeelight.main.BulbException: {'code': -5001, 'message': 'invalid params'}

@vicvancooten
Copy link

vicvancooten commented Apr 8, 2020

I second this problem. The component is fantastic when it works (incredible job, dev!), but this error is there 75% of the time. I can usually fix it by first turning on the TV (from power, not standby) and then rebooting home assistant core. The ambilights component has the same problem and shows as unavailable. I would love if this component would be fixed for this problem.

Traceback (most recent call last):
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 119, in follow_tv
    if ambiSetting['styleName'] == "FOLLOW_VIDEO":
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1232, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1255, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    self._platforms.values(), func, call, required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 412, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 600, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 443, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 625, in async_turn_on
    await self.hass.async_add_job(ft.partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 83, in turn_on
    self.follow_tv(self._position, 0.05) # 0.05ms is the 'sleep' time between refresh cycles
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 325, in follow_tv
    self.turn_off()
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 88, in turn_off
    self._bulb.stop_music() # disables (more intensive) music mode afterward
  File "<decorator-gen-16>", line 2, in stop_music
  File "/usr/local/lib/python3.7/site-packages/yeelight/main.py", line 128, in _command
    result = self.send_command(method, params).get("result", [])
  File "/usr/local/lib/python3.7/site-packages/yeelight/main.py", line 455, in send_command
    raise BulbException(response["error"])
yeelight.main.BulbException: {'code': -5001, 'message': 'invalid params'}

@jomwells
Copy link
Owner

Hi all, I apologise for the long delay, I have taken a long break from Home Assistant due to both University exams and then COVID/Lockdown. Is this issue still present?

@tuzin1992
Copy link

Yep, it still present...

@HydrelioxGitHub
Copy link

HydrelioxGitHub commented Sep 27, 2020

I have the same issue but not the same log :

Traceback (most recent call last):
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 143, in follow_tv
    r_sum = r_sum + ((pixel['r']) ** 2)
TypeError: string indices must be integers

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 137, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1315, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1350, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await self.hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 459, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 655, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 490, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 681, in async_turn_on
    await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 83, in turn_on
    self.follow_tv(self._position, 0.05) # 0.05ms is the 'sleep' time between refresh cycles
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 325, in follow_tv
    self.turn_off()
  File "/config/custom_components/philips_ambilight+yeelight/switch.py", line 88, in turn_off
    self._bulb.stop_music() # disables (more intensive) music mode afterward
  File "<decorator-gen-16>", line 2, in stop_music
  File "/usr/local/lib/python3.8/site-packages/yeelight/main.py", line 125, in _command
    result = self.send_command(method, params).get("result", [])
  File "/usr/local/lib/python3.8/site-packages/yeelight/main.py", line 495, in send_command
    raise BulbException(response["error"])
yeelight.main.BulbException: {'code': -5001, 'message': 'invalid params'}```

@jomwells
Copy link
Owner

Okay, it looks like it shouldn't be too hard for me to find the issue here. I'm just in the process of moving into a new flat for the start of the academic year, I expect within a week or two I will have my smart home back up and running, and I will aim to get straight on this! If you are still having an issue and haven't heard from me in that time, don't hesitate to comment again here to remind me!

@HydrelioxGitHub
Copy link

Any progress on this ?

@marquedragon
Copy link

Hello,

I am also getting this error when I try to switch each bulb on.

My logs and details are similar to previous ones here, only additional note I could add would be that I am using the odroid n2+

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants