I upgraded an HA/AD system from something old (I don’t have the versions handy and I assume they are not relevant) to the latest versions. As part of the upgrade, I’m trying to get my old appdaemon apps working again. I cannot seem to get the call_service() function to work.
I think that I figured out that the service name uses a “/” delimiter between the domain and service now rather than “.” which was used in the older versions. The current documentation does contradict itself on that subject in the API reference section:
For listed services, the part before the first period is the
domain , and the part after is the ``service name`. For instance, light/turn_on has a domain of light and a service name of turn_on.
However, with that change, I have moved on from the first problem to the next one. This call to a service named “set_variable” provided by a custom component called “variable” still fails.
self.call_service('variable/set_variable', entity_id='variable.sunrise', value=localtime)
The error message in the appdaemon error log looks like this:
2020-08-29 11:00:01.010688 WARNING HASS: Error calling Home Assistant service default/variable/set_variable 2020-08-29 11:00:01.011040 WARNING HASS: Code: 400, error: 400: Bad Request
My questions are thus:
- Where does the “default” element in the service name come from?
- Is appdaemon sending the service name with “/” delimiters when HA seems to use “.”
- Does the 400/Bad Request result tell us something else?