Open joshuar opened 2 weeks ago
Hey @eleektro,
Firstly thanks for trying out Go Hass Agent!
Now, I believe that the custom D-Bus command code is non-functional right now, some regressions have crept in. For example, the code currently won't pass any arguments you give to the D-Bus method you call. So I think that is likely, at least part of your problem.
I am working on fixing this, it likely won't make it into the next release (v10.1) but in a subsequent patch release (likely 10.1.1).
In the meantime, if you are looking to send notifications through Go Hass Agent, it should already support it OOTB. The agent exposes a notify.mobile_app_HOSTNAME
(replace HOSTNAME
with the short hostname of the device running the agent) service in Home Assistant you can use. For example in Developer Tools->Services in Home Assistant:
Hey @eleektro, so I've spent some time looking into this issue. It took me down a rabbit hold of D-Bus internals and introspection, and I believe I've come out the other side with a fix to this issue. The next version of the agent will have the fix (v10.2).
For background, there is nothing wrong with your inputs or invocation. There was a regression in Go Hass Agent whereby specified arguments to a command were not being passed to D-Bus. Fixed. There was also a subtle issue in the way the arguments are converted from what is provided over MQTT to what is needed by D-Bus. Also fixed.
Thank you for reporting this issue, that was a fun one to look into :p
Hey @eleektro, I've just released v10.2 which contains a fix for your problem with the custom D-Bus command feature. For me, your example of sending a notification works, as as should any other D-Bus command you throw in there. Please try it out when you get a chance and report back!
Thanks for resolving the issue so quickly. I've reviewed the changes made to the code and I see that the topic has changed when publishing a command to D-Bus. I'm trying to send a notification from HAss, but I'm unable to do so—I get the following error:
And this is the JSON message I'm publishing in the
gohassagent/<my-computer-name>/dbuscommand
topic:I think it might be that I'm not correctly typing the parameters for the Notify method. It works fine from a D-Bus explorer on my system.
Is it due to my incompetence, or could there be an issue mapping JSON values to Go's native types?
Thanks a lot, and sorry if I went off-topic too much.
Originally posted by @eleektro in https://github.com/joshuar/go-hass-agent/issues/249#issuecomment-2307081070