bitfocus / companion-module-homeassistant-server

MIT License
12 stars 7 forks source link

How do I use "Call Service"? #20

Open ericekidwell opened 1 year ago

ericekidwell commented 1 year ago

Goal: I'm trying to turn off/on TVs that are connected to my Home Assistant.

I'm able to turn them on/off inside Home Assistant. image

Here's how I have it setup in Companion: image

I'm not very proficient at coding yet. Did I write the JSON for this right? { "service": "remote.turn_on" }

Also, is there anything else I should try?

Julusian commented 1 year ago

I don't think you will need anything in the payload for this. The service field is already defined by the dropdown.

Perhaps the home assistant log shows some error describing why it failed?

ericekidwell commented 1 year ago

Thanks for the response. After trying to delete out the payload and pressing the button, it doesn't seem to want to send anything.

The log just says a button was pressed: 22.08.18 15:28:49 device(elgato_plugin-::ffff:127.0.0.1): Button 94.16 released 22.08.18 15:28:49 device(elgato_plugin-::ffff:127.0.0.1): Button 94.16 pressed

Julusian commented 1 year ago

Does the log inside of home assistant show anything?

Im pretty sure companion doesnt log everything it sends to home assistant, not sure about responses

ericekidwell commented 1 year ago

I'm not seeing any responses in Home Assistant logbook.

Could this be a bug?
Or maybe the "Call Service" Companion Action hasn't been fully setup yet?

I do recall it saying under the "homeassistant-server: Call Service" : Please open a feature request, so that useful things are properly supported.

Julusian commented 1 year ago

hmm. I think it is simply incredibly picky about the contents of the payload.

This works: image

But if I remove the payload, or define a property it doesnt expect, then it does nothing