Skip to content
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

[Bug]: Unable to call service #25

Closed
SKis274 opened this issue Oct 10, 2022 · 3 comments
Closed

[Bug]: Unable to call service #25

SKis274 opened this issue Oct 10, 2022 · 3 comments
Assignees
Labels
bug Something isn't working stale

Comments

@SKis274
Copy link

SKis274 commented Oct 10, 2022

What happened?

Hi there,

I'm trying to call a service inside the area-card. Here is an example.

type: custom:minimalistic-area-card
title: Esszimmer
image: >-
  image/serve/5514b9769af14cdd146c0946070c0a05/512x512
background_color: null
tap_action:
  action: navigate
  navigation_path: /lovelace-mushroom/dinner-room
state_color: true
entities:
  - entity: sensor.klimaanlage_esszimmer_temperature
  - entity: sensor.klimaanlage_esszimmer_humidity
  - entity: vacuum.puck_3_0_eg
    tap_action:
      action: call-service
      confirmation:
        text: Soll das Esszimmer jetzt gereinigt werden?
      service: xiaomi_miio.vacuum_clean_segment
      target:
        entity_id: vacuum.puck_3_0_eg
      data:
        segments: 17

After the confirmation the following error occurs:
Fehler beim Aufrufen des Diensts xiaomi_miio/vacuum_clean_segment. required key not provided @ data['segments']

The service is correct, it works perfect with a pure entities card like this with the same formatting:

type: entities
entities:
  - entity: vacuum.puck_3_0_eg
    tap_action:
      action: call-service
      confirmation:
        text: Soll das Esszimmer jetzt gereinigt werden?
      service: xiaomi_miio.vacuum_clean_segment
      target:
        entity_id: vacuum.puck_3_0_eg
      data:
        segments: 17

Any idea why it doesn't work? Thanks a lot :-)

Card Version

1.0.6

HomeAssistant Version

2022.10.2

Relevant javascript log output

No response

@SKis274 SKis274 added the bug Something isn't working label Oct 10, 2022
@junalmeida
Copy link
Owner

My first thought would be a possible misalignment with yaml spaces around data:, but based on what you are providing it seems correct. I will try to look for a service here to test.

@zSprawl
Copy link

zSprawl commented Oct 12, 2022

Sometimes I have to use service_data instead of plain data. Like this:

  tap_action:
  action: call-service
  haptic: heavy
  service: remote.send_command
  service_data:
    command: menu
    entity_id: remote.office

@stale
Copy link

stale bot commented Nov 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants