diff --git a/homeassistant/components/websocket_api/commands.py b/homeassistant/components/websocket_api/commands.py index cfa132b71eb..4a360b4a43c 100644 --- a/homeassistant/components/websocket_api/commands.py +++ b/homeassistant/components/websocket_api/commands.py @@ -275,10 +275,10 @@ async def handle_call_service( translation_domain=const.DOMAIN, translation_key="child_service_not_found", translation_placeholders={ - "domain": err.domain, - "service": err.service, - "child_domain": msg["domain"], - "child_service": msg["service"], + "domain": msg["domain"], + "service": msg["service"], + "child_domain": err.domain, + "child_service": err.service, }, ) except vol.Invalid as err: diff --git a/tests/components/websocket_api/test_commands.py b/tests/components/websocket_api/test_commands.py index 22e839d84e4..2ddb5c628c7 100644 --- a/tests/components/websocket_api/test_commands.py +++ b/tests/components/websocket_api/test_commands.py @@ -460,10 +460,10 @@ async def test_call_service_child_not_found( "domain_test.test_service which was not found." ) assert msg["error"]["translation_placeholders"] == { - "domain": "non", - "service": "existing", - "child_domain": "domain_test", - "child_service": "test_service", + "domain": "domain_test", + "service": "test_service", + "child_domain": "non", + "child_service": "existing", } assert msg["error"]["translation_key"] == "child_service_not_found" assert msg["error"]["translation_domain"] == "websocket_api"