What's wrong with my toggle switch

I create a small script to enable me to lock/unlock my door lock in IOS Home app. I use two toggle switch to do that:

      - data:
          entity_id: switch.kevo_in
        service: switch.toggle
      alias: Kēvo in
      - data:
          entity_id: switch.kevo_out
        service: switch.toggle
      alias: Kēvo out

Since last hassio updates, I get this error in log even if the toggle switches work fine in my IOS Home app…:

homeassistant.exceptions.ServiceNotFound: (ServiceNotFound(...), 'Service switch.toggle not found')

Have any idea what’s wrong?


Do you have more of the error? Nothing in that error indicates that it’s coming from those scripts.

Here is the complete log:

Mon Feb 11 2019 17:25:29 GMT-0500 (heure normale de l’Est nord-américain)
Error executing service <ServiceCall script.kevo_in (c:df068fdbb56d421c9fa77be055120e0b)>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1139, in _safe_execute
    await self._execute_service(handler, service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1152, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/script.py", line 123, in service_handler
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/script.py", line 181, in async_turn_on
    kwargs.get(ATTR_VARIABLES), context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 131, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 210, in _handle_action
    action, variables, context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 299, in _async_call_service
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 85, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1107, in async_call
    raise ServiceNotFound(domain, service) from None
homeassistant.exceptions.ServiceNotFound: (ServiceNotFound(...), 'Service switch.toggle not found')

well that just doesn’t make sense. Is there anything else in the logs before this error?

Got it!

I only declare in “configuration.yaml”:

# Switches

…to add the switch Service!

Thank-you for your support!