@Sjohn21 wrote:
Hi there,
let me first state I am quite new to Home Assistant and Python in general, but I’m eager to learn. So please be bear with me if I’m doing something stupid.
Running Home assistant 0.106.0 on Raspberry Pi 3B
I have succesfully integrated my Roomba 960 with the Roomba integration. Standard tasks as starting to clean my house when we are not at home are working nicely.
Now I want to extend my automation and I would like to try to send some raw commands to my Roomba.If I understand correctly I should be able to send raw commands to my Roomby by using
vacuum.send_command
From the home assitant component i see:
async def async_send_command(self, command, params=None, **kwargs): """Send raw command.""" _LOGGER.debug("async_send_command %s (%s), %s", command, params, kwargs) await self.hass.async_add_job(self.vacuum.send_command, command, params) return True
The code also includes:
async def async_turn_on(self, **kwargs): """Turn the vacuum on.""" await self.hass.async_add_job(self.vacuum.send_command, "start") self._is_on = True
So I tried to send this start command via the raw command via services in developer tools with the following (as per example which is actually for a xiaomi vacuum):
vacuum.send_command entity_id: vacuum.dusty_dave command: "start"
Sadly this give me an error which I am probably to newby to understand. The following is in the logs:
send_command() takes 2 positional arguments but 3 were given 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 1230, in async_call await asyncio.shield(self._execute_service(handler, service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service await handler.func(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 198, in handle_service self._platforms.values(), func, call, required_features File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 402, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 433, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/roomba/vacuum.py", line 262, in async_send_command await self.hass.async_add_job(self.vacuum.send_command, command, params) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) TypeError: send_command() takes 2 positional arguments but 3 were given
Can somebody point me in the right direction?
Thanks in advance.
Posts: 1
Participants: 1