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

Support for SwitchBot K10+ #797

Open
ntimo opened this issue Aug 31, 2024 · 2 comments
Open

Support for SwitchBot K10+ #797

ntimo opened this issue Aug 31, 2024 · 2 comments

Comments

@ntimo
Copy link

ntimo commented Aug 31, 2024

Is your feature request related to a problem? Please describe.
Currently the card does not support the switchbot vaccums.

Describe the solution you'd like
I would like to use the card to control my Switchbot K10+ using switchbot mqtt https://github.com/hsakoh/switchbot-mqtt

Additional context
The vaccum needs to be integrated via into HomeAssistant https://github.com/hsakoh/switchbot-mqtt

@git849376
Copy link

+1

@ThePastPlayer
Copy link

ThePastPlayer commented Oct 24, 2024

Here's what i ended up doing to make it work for my K10+
be sure to replace DEVICE_ID with your actual device id

configuration.yaml

  - platform: template
    vacuums:
      my_vacuum:
        friendly_name: "My Vacuum"
        value_template: >
          {% set status = states('sensor.both_workingstatus_DEVICE_ID') %}
          {% if status == 'ChargeDone' %}
            docked
          {% elif status == 'Cleaning' %}
            cleaning
          {% elif status == 'Paused' %}
            paused
          {% else %}
            unknown
          {% endif %}
        battery_level_template: "{{ states('sensor.both_battery_DEVICE_ID') | int }}"
        fan_speed_template: "{{ states('select.powerlevel_4_cmd_DEVICE_ID') }}"
        set_fan_speed:
          service: select.select_option
          target:
            entity_id: select.powerlevel_4_cmd_DEVICE_ID
          data:
            option: "{{ fan_speed }}"
        fan_speeds:
          - Quiet
          - Standard
          - Strong
          - MAX
        start:
          service: button.press
          target:
            entity_id: button.btn_1_cmd_DEVICE_ID
        stop:
          service: button.press
          target:
            entity_id: button.btn_2_cmd_DEVICE_ID
        return_to_base:
          service: button.press
          target:
            entity_id: button.btn_3_cmd_DEVICE_ID

after restarting homeassistant, create the card like so (don't forget the DEVICE_ID there too):

type: 'custom:vacuum-card'
entity: vacuum.my_vacuum
show_name: true
show_status: true
actions:
  start:
    service: vacuum.start
    target:
      entity_id: vacuum.my_vacuum
  stop:
    service: vacuum.stop
    target:
      entity_id: vacuum.my_vacuum
  return_to_base:
    service: vacuum.return_to_base
    target:
      entity_id: vacuum.my_vacuum
stats:
  default:
    - entity_id: sensor.both_battery_DEVICE_ID
      subtitle: Battery
      unit: '%'
    - entity_id: sensor.both_workingstatus_DEVICE_ID
      subtitle: Working Status
shortcuts:
  - name: Update Status
    service: button.press
    target:
      entity_id: button.update_DEVICE_ID
    icon: 'mdi:refresh'

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

3 participants