Skip to content

feat: add fan controls#269

Open
kruton wants to merge 1 commit into
HASwitchPlate:mainfrom
kruton:fan-controls
Open

feat: add fan controls#269
kruton wants to merge 1 commit into
HASwitchPlate:mainfrom
kruton:fan-controls

Conversation

@kruton
Copy link
Copy Markdown

@kruton kruton commented Jun 3, 2026

Add a blueprint to control fan speed with the dimmer screens. The room I used this in had a Big Ass Haiku fan with a dimmable light and a variable speed controller. This makes it a bit easier to control the light and speed on one screen.

This fixes #233

Copilot AI review requested due to automatic review settings June 3, 2026 16:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new Home Assistant automation blueprint for controlling/displaying fan speed on a HASPone slider with an overlaid on/off icon, and documents it in the blueprints README.

Changes:

  • Introduces hasp_Display_Fan_Speed_with_Icon.yaml blueprint implementing fan speed + toggle + icon overlay via MQTT/JSON events.
  • Adds “Display Fan Speed with Icon” entry and import link to Home_Assistant/blueprints/README.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
Home_Assistant/blueprints/hasp_Display_Fan_Speed_with_Icon.yaml New automation blueprint implementing fan speed control + icon overlay behavior.
Home_Assistant/blueprints/README.md Documents the new blueprint and provides a one-click import link.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +253 to +269
triggers:
- trigger: state
entity_id: !input fan
- trigger: template
value_template: "{{ is_state(haspsensor, 'ON') }}"
- trigger: homeassistant
event: start
- trigger: mqtt
topic: "{{jsontopic}}"
- trigger: mqtt
topic: "{{selectedfgtopic}}"
- trigger: mqtt
topic: "{{selectedbgtopic}}"
- trigger: mqtt
topic: "{{unselectedfgtopic}}"
- trigger: mqtt
topic: "{{unselectedbgtopic}}"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is out-of-date knowledge. This pattern matches with the rest of the repo.

Comment on lines +153 to +156
fanbutton: "{{haspbutton|int}}"
togglebutton: "{{fanbutton-3}}"
fanobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}'
toggleobject: '{{ "p[" ~ hasppage ~ "].b[" ~ togglebutton ~ "]" }}'
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same pattern used in the other dimmer blueprints, but this could conceivably be changed to:

togglebutton: "{{haspbutton|int - 3}}"

I'll let the maintainer change all instances in other blueprints if this is needed.

Comment on lines +241 to +246
haspsensor: >-
{%- for entity in device_entities(haspdevice) -%}
{%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
{{ entity }}
{%- endif -%}
{%- endfor -%}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The surrounding {%- ... -%} blocks trim the whitespace already.

Comment on lines +393 to +394
topic: "{{jsoncommandtopic}}"
payload: '["ref {{togglebutton}}","delay=1","xstr {{xpos}},{{ypos}},{{iconwidth}},{{iconheight}},{{iconfont}},{{selectedfg}},0,1,1,3,\"{{icon}}\"","delay=1","vis {{fanbutton}},1"]'
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is valid; this follows the pattern used by the other blueprints.

togglebutton: "{{fanbutton-3}}"
fanobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}'
toggleobject: '{{ "p[" ~ hasppage ~ "].b[" ~ togglebutton ~ "]" }}'
commandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ fanobject }}'
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but this is a cosmetic issue.

togglecommandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ toggleobject }}'
jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}'
jsoncommandtopic: '{{ "hasp/" ~ haspname ~ "/command/json" }}'
isbr: "{% if wrap == true %}1{% else %}0{% endif %}"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but this is a cosmetic issue. Additionally wrap would be unreferenced if isbr were removed.

Comment on lines +162 to +169
activepage: >-
{%- set activepage = namespace() -%}
{%- for entity in device_entities(haspdevice) -%}
{%- if entity|regex_search("^number\..*_active_page(?:_\d+|)$") -%}
{%- set activepage.entity=entity -%}
{%- endif -%}
{%- endfor -%}
{{ states(activepage.entity) | int(default=-1) }}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows the pattern from the other blueprints, so it should be changed all together if it needs to be changed.

Comment on lines +72 to +73
name: "HASPone Button Font"
description: "Select the text font for this button label. Refer to the HASPone Font reference above."
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be useful; it should be added to all blueprints if wanted.

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

Successfully merging this pull request may close these issues.

Control fan speed with dimmer

2 participants