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

Clarify shortcut usage in readme.md #745

Open
elronzo opened this issue May 10, 2024 · 7 comments
Open

Clarify shortcut usage in readme.md #745

elronzo opened this issue May 10, 2024 · 7 comments

Comments

@elronzo
Copy link

elronzo commented May 10, 2024

One does not necessarily need a script. A direct service call is possible:

shortcuts:
  - name: kitchen
    service: mqtt.publish
    service_data:
      topic: valetudo/JustForDemonstration/MapSegmentationCapability/clean/set
      payload: '{"segment_ids": ["2"], "iterations": 1, "customOrder": true}'
@svenove
Copy link

svenove commented May 22, 2024

I struggle a bit with getting this to work.

shortcuts:
  - name: Stue
    icon: mdi:sofa
    service: xiaomi_miio.vacuum_clean_segment
    service_data:
      target:
        device_id: 553a536e86e5b116d6d6f
      data:
        segments: 20

When clicking the icon, I get:
Failed to call service xiaomi_miio/vacuum_clean_segment. extra keys not allowed @ data['target']

Any idea?

@elronzo
Copy link
Author

elronzo commented May 23, 2024

'data:' before 'segements:' is superfluous.

@svenove
Copy link

svenove commented May 23, 2024

'data:' before 'segements:' is superfluous.

Tried removing it, but it still throws the same error. I’ve tried all kinds of variants and believe I’m really close, but can’t seem to get it just right…

service_data:
  target:
    device_id: 553a536e86e5b116d6d6f
    segments: 20

And

service_data:
  target:
    device_id: 553a536e86e5b116d6d6f
  segments: 20

@elronzo
Copy link
Author

elronzo commented May 23, 2024

Your config needs to either look exactly as provided here: https://github.com/denysdovhan/vacuum-card/ (= You need to create a script in HA that makes the MQTT call) or use my variant (= do mqtt.publish directly). But not a mix of both.

@svenove
Copy link

svenove commented May 23, 2024

I’m not trying to do a mqtt.publish, but to call a different service (“service: xiaomi_miio.vacuum_clean_segment”).

Since the mqtt.push-service can be called directly, I expect all kinds of service calls can be called directly?

@elronzo
Copy link
Author

elronzo commented May 23, 2024

Valetudo uses MQTT. So you'll definitely need the MQTT part somewhere.

@svenove
Copy link

svenove commented May 23, 2024

Valetudo uses MQTT. So you'll definitely need the MQTT part somewhere.

I don’t use Valetudo, I use the Xiaomi Miio integration.

The same code works fine when used in an automation. It’s when copying it from an automation and to the shortcut-section of this cards it fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants