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

When connecting HA to HomeKit each pump has 4 switches #83

Open
Kissel-B opened this issue Mar 21, 2023 · 2 comments
Open

When connecting HA to HomeKit each pump has 4 switches #83

Kissel-B opened this issue Mar 21, 2023 · 2 comments

Comments

@Kissel-B
Copy link

When porting over to HomeKit each motor has 4 switches assigned to them 1 Fan and 3 toggle.

@robgridley
Copy link

The pump for my spa is a two-speed. My solution was to remove the pump from my HomeKit entities list and create two separate template switches instead: one for low speed and one for high speed. This allows me to tell Siri to "turn on spa jets low" or "turn on spa jets high".

Here's the relevant part of my Home Assistant config:

switch:
  - platform: template
    switches:
      spa_jets_low:
        friendly_name: "Spa Jets Low"
        value_template: "{{ is_state_attr('fan.spa_pump', 'preset_mode', 'LO') }}"
        turn_on:
          service: fan.set_preset_mode
          target:
            entity_id: fan.spa_pump
          data:
            preset_mode: "LO"
        turn_off:
          service: fan.set_preset_mode
          target:
            entity_id: fan.spa_pump
          data:
            preset_mode: "OFF"
      spa_jets_high:
        friendly_name: "Spa Jets High"
        value_template: "{{ is_state_attr('fan.spa_pump', 'preset_mode', 'HI') }}"
        turn_on:
          service: fan.set_preset_mode
          target:
            entity_id: fan.spa_pump
          data:
            preset_mode: "HI"
        turn_off:
          service: fan.set_preset_mode
          target:
            entity_id: fan.spa_pump
          data:
            preset_mode: "OFF"

@kmck
Copy link

kmck commented Feb 27, 2024

@robgridley thank you for posting this!

Since there isn't currently a Gecko plugin for Homebridge, I recently set up Home Assistant. I ran into the 4-switch issue as soon as I had the initial setup running, and your solution was enormously helpful.

I tweaked it slightly to make each pump appears in HomeKit as a single fan, which I think looks a little better in the Home App (and also the low pump setting on my swim spa is basically standby for when the heater is running). I haven't tried using it with Siri to see how it compares from a voice command perspective.

fan:
  - platform: template
    fans:
      spa_jets:
        friendly_name: "Spa Jets"
        value_template: "{{ not is_state_attr('fan.hydropool_aquaplay_12_ffp_pump_1', 'preset_mode', 'OFF') }}"
        percentage_template: >-
          {% if is_state_attr('fan.hydropool_aquaplay_12_ffp_pump_1', 'preset_mode', 'HI') %}
            100
          {% elif is_state_attr('fan.hydropool_aquaplay_12_ffp_pump_1', 'preset_mode', 'LO') %}
            50
          {% else %}
            0
          {% endif %}
        turn_on:
          service: fan.set_preset_mode
          target:
            entity_id: fan.hydropool_aquaplay_12_ffp_pump_1
          data:
            preset_mode: "HI"
        turn_off:
          service: fan.set_preset_mode
          target:
            entity_id: fan.hydropool_aquaplay_12_ffp_pump_1
          data:
            preset_mode: "OFF"
        set_percentage:
          - service: fan.set_preset_mode
            target:
              entity_id: fan.hydropool_aquaplay_12_ffp_pump_1
            data:
              preset_mode: >-
                {% if percentage > 50 %}
                  HI
                {% elif percentage == 50 %}
                  LO
                {% else %}
                  OFF
                {% endif %}
        speed_count: 2

For the benefit of anyone else who isn't familiar with Home Assistant: that code goes directly into the root configuration.yaml of the HA instance and will create a fan.spa_jets template fan entity. The fan.hydropool_aquaplay_12_ffp_pump_1 corresponds to whatever entities that gecko-home-assistant created and should be edited to whatever ID the pump has in your actual setup.

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