#cycle fan speed
1 messages · Page 1 of 1 (latest)
trigger on the button, then in the actions have a choose block to determine which action to take
if state 0 then switch to state 1
if state 1 then switch to state 2
if state 2 then switch to state 3
if state 3 then switch to state 0
replace state x with whatever the setup is for interacting with your fan. but the concept should work
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.
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
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