#cycle fan speed

1 messages · Page 1 of 1 (latest)

hollow shell
#

I'm still new to HAOS and this is my first automation.
I have an insteon ceiling fan and a 4-button zwave remote control switch.
Each button triggers a different event right? Button 1 triggers event.s2rcs_scene_001
Can I write an automation that uses just 1 button to cycle through the 4 fan-speeds?

gilded rivet
#

replace state x with whatever the setup is for interacting with your fan. but the concept should work

latent forum
#

Heck, you can even use fan.increase_speed. You only need to add a check if youŕe at max speed and set it to 0 again as it will not wrap around by itself.

hollow shell
#

I figured it out. What helped was using a variable and an action: tts.speak to announce the current speed.

alias: AdjustFanSpeed
description: Cycle Fan Speed
triggers:
  - device_id: 1f5253921fdb84f274d60d65c556e036
    domain: zwave_js
    type: event.value_notification.central_scene
    property: scene
    property_key: "001"
    endpoint: 0
    command_class: 91
    subtype: Endpoint 0 Scene 001
    trigger: device
    value: 0
conditions: null
actions:
  - variables:
      current_percentage: "{{ state_attr('fan.fanlinc_47_6f_14_fan', 'percentage') }}"
  - choose:
      - conditions:
          - condition: state
            entity_id: fan.fanlinc_47_6f_14_fan
            state: "off"
        sequence:
          - action: fan.turn_on
            metadata: {}
            target:
              entity_id: fan.fanlinc_47_6f_14_fan
            data:
              percentage: 33
      - conditions:
          - condition: state
            entity_id: fan.fanlinc_47_6f_14_fan
            state: "on"
          - condition: template
            value_template: "{{ current_percentage | float < 67 }}"
        sequence:
          - action: fan.increase_speed
            target:
              entity_id: fan.fanlinc_47_6f_14_fan
            metadata: {}
            data: {}
      - conditions:
          - condition: state
            entity_id: fan.fanlinc_47_6f_14_fan
            state: "on"
          - condition: template
            value_template: "{{ current_percentage | float > 99 }}"
        sequence:
          - action: fan.turn_off
            metadata: {}
            target:
              entity_id: fan.fanlinc_47_6f_14_fan
            data: {}
mode: single
hollow shell
#

I did the same thing with the light attached to the fan. Don't really know how to determine what devices support what attributes but I was able to use "brightness" with the insteon fanlinc.

alias: AdjustFanLightBrightness
description: Control Fan Light Brightness
triggers:
  - device_id: 1f5253921fdb84f274d60d65c556e036
    domain: zwave_js
    type: event.value_notification.central_scene
    property: scene
    property_key: "002"
    endpoint: 0
    command_class: 91
    subtype: Endpoint 0 Scene 002
    trigger: device
    value: 0
conditions: null
actions:
  - variables:
      brightness: "{{ state_attr('light.fanlinc_47_6f_14_light', 'brightness') }}"
  - choose:
      - conditions:
          - condition: state
            entity_id: light.fanlinc_47_6f_14_light
            state: "off"
        sequence:
          - action: light.turn_on
            metadata: {}
            target:
              entity_id: light.fanlinc_47_6f_14_light
            data:
              brightness_pct: 33
      - conditions:
          - condition: state
            entity_id: light.fanlinc_47_6f_14_light
            state: "on"
          - condition: template
            value_template: "{{ brightness | float < 200 }}"
        sequence:
          - action: light.turn_on
            target:
              entity_id: light.fanlinc_47_6f_14_light
            metadata: {}
            data:
              brightness: 255
      - conditions:
          - condition: state
            entity_id: light.fanlinc_47_6f_14_light
            state: "on"
          - condition: template
            value_template: "{{ brightness | float > 200 }}"
        sequence:
          - action: light.turn_off
            metadata: {}
            target:
              entity_id: light.fanlinc_47_6f_14_light
            data: {}
mode: single