How to extend/change existing service's parameters?

Hi All,

I have a custom component based on manual alarm panel and I want to add some new parameters to its alarm_arm_xxx services.
How can I do that?
Tried hass.services.async_register(DOMAIN, SERVICE_ALARM_ARM, async_alarm_arm_away, EXTENDED_ALARM_SERVICE_SCHEMA)
but HA ignores my schema and complains when I try to call the service with an extra parameter from frontend (“no extra keys allowed”) and it shows a standard service’s description from services.yaml.
I cannot even remove the service, can still see it after hass.services.async_remove(DOMAIN, SERVICE_ALARM_ARM_AWAY) in the list of available services in fronted.

However, everything works just fine if I choose another name for my service.
I.e I can ADD a new service, but cannot REPLACE a service that already registered even though I’m doing it with my own custom component, not a standard HA one.

Any hints?

You’re not providing a custom alarm_control_panel component, you’re providing an integration that includes an alarm_control_panel platform that uses the standard alarm_control_panel component. I don’t think you really want to customize the standard alarm_control_panel component.

What you should do is to register your own service(s) under your integration’s domain name. E.g., `bwalarm.xyz’, and then provide a services.yaml file in your integration.

Spot on!
Just changed DOMAIN value to ‘bwalarm’, registered all necessary service calls and corrected appropriate service calls in HA.

For some reason the author of that component customised the standard alarm_control_panel by adding some service calls to it.
Now it’s all separated and works well, happy days!

1 Like