Hello good people!
I am trying to add some Z-wave switches I have working well on HA to my Home App.
I was following this link:
And it works well with anything that needs Fan/Light/on,off Switch.
But I get into a corner when trying to add a blind switch, it will only allow me to open or close while I want to be able to open X% of the blind for airflow only for example.
I tried playing with chatgpt and writing yaml code for it but its always broken and wont work properly even if recognised as blinds.
Any help will be appreciated! Thank you
The only way that I know of to get this to work would be to create a template cover using the blinds switch. HomeKit will only expose the percentage to devices in the cover
domain, and it sounds like your switch that you are exposing is in the switch
domain.
Thank you, I am not a big coder myself so I use chatgpt 40 to help me and try to understand what it did.
Using this website you send I tried to fix things but it still wont work.
Maybe you know why?
this is the code:
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Define input number for position tracking
input_number:
toy_room_blinds_position:
name: Toy Room Blinds Position
initial: 0
min: 0
max: 100
step: 1
# Use the cover entity directly
cover:
- platform: template
covers:
toy_room_blinds_template:
friendly_name: "Toy Room Blinds Template"
position_template: "{{ state_attr('cover.toy_room_blinds', 'current_position') }}"
open_cover:
service: cover.open_cover
target:
entity_id: cover.toy_room_blinds
close_cover:
service: cover.close_cover
target:
entity_id: cover.toy_room_blinds
stop_cover:
service: cover.stop_cover
target:
entity_id: cover.toy_room_blinds
set_cover_position:
service: cover.set_cover_position
target:
entity_id: cover.toy_room_blinds
data:
position: "{{ position }}"
# HomeKit integration
homekit:
- name: HomeKit Bridge
port: 51827
filter:
include_entities:
- cover.toy_room_blinds_template
Ok for future people struggling with this or with Home app recognising their blinds/shades/covers like Windows with extra security instead.
This fixed it for me.
First this is the code I run:
# Other configurations
homekit:
auto_start: false
filter:
include_entities:
- cover.blinds_toy_room
cover:
- platform: template
covers:
toy_room_blinds:
friendly_name: "Toy Room Blinds"
position_template: "{{ state_attr('cover.blinds_toy_room', 'current_position') }}"
open_cover:
service: cover.open_cover
data:
entity_id: cover.blinds_toy_room
close_cover:
service: cover.close_cover
data:
entity_id: cover.blinds_toy_room
set_cover_position:
service: cover.set_cover_position
data_template:
entity_id: cover.blinds_toy_room
position: "{{ position }}"
homeassistant:
customize: !include customize.yaml
I then created a new file in my config folder called “customize.yaml”
in it I wrote this:
cover.blinds_toy_room:
device_class: shade
This way this work great.
The features of seeing the status of the shades+the% of how close/open it is.
and it works as a slider to open partially instead of just a button of open or close.
Hope it helps someone.