-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support return_result from HASS services. #1837
Comments
Hello @chatziko, It can work with those services, as all you need to do is to add the “return_result=True” as part of the parameters and it should work. did you try that, and still no luck? kind regards |
Thanks for the response. Yes I did, first I tried with
But
Finally I created a script that returns a response:
When I run it from HASS Developer Tools it returns
The above are tested with HASS 2023.7.1 and AppDaemon addon 0.13.1. |
Ok so it is returning something @chatziko, just not what you would expect. This could be in internal HA issue and not necessarily from AD. Can you kindly try running an external script from AD, and using AD’s credentials call into HA and compare the results if you haven’t already? kind regards |
You're right, I just reported it in HA. You could close this (or maybe leave it open to show that this feature is relevant for AppDaemon). |
Ok cool thanks @chatziko, will close it as it helps us. But glad you figured it out. |
Looked at the issue upstream, but AppDaemon should use the WebSocket for service calls instead. It already has that connect, it will be faster and above all, does support everything Home Assistant has to offer (as our own UI is built on it too). The Home Assistant project does not consider the REST API to be maintained and it is not likely that will get more or new features. Meaning effectively closing this issue, is saying AppDaemon won't support the requested feature. ../Frenck |
Maybe re-open this issue then? In the long run we certainly need to be able to get service responses in AppDaemon. AppDaemon already keeps a websocket to HA open, it shouldn't be hard to use it for service calls. |
Yes, we want to do this when time permits along with some other optimizations so I’ll re-open the issue. |
I am looking into setting up calendar based automations and stumbled upon this issue (service call results in a I am not sure if I am the issue here, since the request seems legit to me, so I figured I would ask here before investing hours into debugging 😅 |
A workaround is to create a simple wrapper script on the HA side, which calls |
Thx @chatziko , I got it working as a POC. It took quite a bit of trial and error though, so - even though it is slightly off-topic for this issue - if anyone is interested, I have created a simple writeup here: https://markusressel.de/blog/post/calendar-integration-between-home-assistant-and-appdaemon |
For anyone interested, I created a generic workaround that overrides list = await self.call_service(
"todo.get_items",
entity_id="todo.shopping_list",
return_result=True,
) https://gist.github.com/chatziko/74a5eacad3fd934d2ec734dab17aa4c0 |
Great!
Thanks, I’m interested and will give it a try.
Greg.
…On Fri, 2 Feb 2024 at 13:15, Kostas Chatzikokolakis < ***@***.***> wrote:
For anyone interested, I created a generic workaround that overrides
call_service and automatically routes the service through a generic
wrapper script when return_result is given. It allows you to simply do:
list = await self.call_service(
"todo.get_items",
entity_id="todo.shopping_list",
return_result=True,
)
https://gist.github.com/chatziko/74a5eacad3fd934d2ec734dab17aa4c0
—
Reply to this email directly, view it on GitHub
<#1837 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIPW6Y6AOR5777IR7EJL35DYRTRIDAVCNFSM6AAAAAA2BZAHZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRTG44DANZQHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks for coming up with a workaround @chatziko. We are looking at this - it means switching from the HASS REST API to using the stream with is a fairly substantial change, but necessary for other reasons. |
Thanks for sharing. I have troubles implementing your workaround. Do you maybe have a full working example? |
Well, the gist does contain a full example, not sure what else you need. Can you describe your troubles? |
I run into the same problem and would appreciate 💙 this being solved! |
Has there been any news on this front? There are some other issues in which related issues have been discussed and some documentation for a 4.5 release has also been written. |
Yes indeed - as you spotted, this will be fixed in 4.5 when it releases. There is currently a working version in dev but it will be rewritten before the final release to accommodate other changes. |
Is there an existing feature request for this?
Your feature request
HASS 2023.07 adds support for returning a response from services. AppDaemon's
call_service
already has areturn_result
option, which works eg withtemplate/render
, but it doesn't seem to work with the newly added services (conversation.process
andcalendar.list_events
). It would be super useful to allow receiving a response from any such service.The text was updated successfully, but these errors were encountered: