cdpuk/ha-bestway

Feature Request: Power on/off

Closed this issue · 0 comments

rjlee commented

From bruces original code for the layzspa, it was possible to control the power on/off:

  - platform: template
    switches:
      hottub_power:
        availability_template: "{{ states('sensor.hottub_online') }}"
        friendly_name: Power
        unique_id: hottub_power
        value_template: "{% if state_attr('sensor.hottub_status', 'power') == 1 %}on{% else %}off{% endif %}"
        turn_on:
          - service: rest_command.hottub_command
            data:
              hottub_command: turn_on
          - delay: 00:00:05
          - service: homeassistant.update_entity
            entity_id: sensor.hottub_status
        turn_off:
          - service: rest_command.hottub_command
            data:
              hottub_command: turn_off
          - delay: 00:00:05
          - service: homeassistant.update_entity
            entity_id: sensor.hottub_status

Could this be added ?