bitfocus / companion-module-homeassistant-server

MIT License
12 stars 7 forks source link

[BUG] homeassistant-server call service to input_button:press doesn't seem to work #37

Closed mdimatul closed 2 months ago

mdimatul commented 4 months ago

Is this a bug in companion itself or a module?

Is there an existing issue for this?

Describe the bug

I created an input_button type in home assistant and am trying to simulate a button press in companion pi but can't get the button to work. The button works fine when I click it in the home assistant UI and when I call it from the API directly using curl:

curl -v -X POST -H "Authorization: Bearer <TOKEN>" -H "Content-Type: application/json" -d '{"entity_id": "input_button.my_button"}' http://a.b.c.d:8123/api/services/input_button/press

Steps To Reproduce

  1. Create an input button in home assistant (https://www.home-assistant.io/integrations/input_button/)
  2. Create an automation that triggers on the input_button press (Trigger -> Entity -> State, enter entity, then as an action do something like send a notification to test)
  3. Confirm the button works when pressed in home assistant
  4. In companion pi, add a new button
  5. Press action: homeassistant-server: Call Service
  6. Set Service to input_button: Press
  7. Set entity to input_button created in step 1
  8. Clear payload field

Expected Behavior

No response

Environment (please complete the following information)

- OS: Companion PI
- Browser: Chrome
- Companion Version: 3.2.1+6676-stable-fa981d25

Additional context

When trying to debug within home assistant, I see this error whenever I try to press the button in companion: The service homeassistant.turn_on cannot be called without a target

Julusian commented 2 months ago

I believe this is fixed by #38 which will be in the betas shortly