These days when purchasing hardware for our home I’m always on the lookout for the ability to connect it with Home Assistant. We’ve recently replaced our blinds with motorised units and thanks to Rollease Acmeda using their Automate Wirefree Tubular Motors together with the Automate Pulse Hub are able to control our blinds using their mobile app, Alexa or IFTTT.
I’m personally not a fan of the mobile app, as it takes my interaction outside of HA where the rest of my smart home tech lives. Alexa integration is great using the provided skill with one limiting factor which I’ll get to in a minute. The real standout is their support for IFTTT.
My first integration of the blinds into HA using IFTTT was a simple input_boolean
which provided me with basic open/close functionality, providing the control of the blinds were done though HA, this brings me back to the point I made above. If the blinds were operated by another device such as the mobile app or remote the state in HA wouldn’t update as the system is stateless.
In order to remedy this problem and I’d need to ensure that the blinds could not only be open/closed but to have their position set, and after refining my initial code I feel it’s time to share it with the greater community with the aim that it will help others who might want something similar but wasn’t sure how to go about it.
There are some whispers in the community of a few people who are looking to reverse engineer / utilise the built-in RS485 serial interface so a custom/native component can be created, but until then this can hopefully help bridge the gap.
The tutorial is split into several parts, one for each component, and list of all components used with their corresponding links are below:
Ready! Let’s start!
Cover
Start of by creating a cover using the below YAML code.
cover_name:
friendly_name: Cover Name
value_template: "{{is_state('sensor.blind_state_sensor', 'Open')}}"
open_cover:
service: script.blind_script_1
data:
mode: 'open'
position: '0'
close_cover:
service: script.blind_script_1
data:
mode: 'close'
position: '100'
Sensor
Add the following sensor.
platform: template
sensors:
blind_state:
value_template: >
{% if is_state('input_number.blind_test_position', '0.0') %}
Open
{% else %}
Closed
{% endif %}
Input Number
Creates a slider on the frontend allowing you to control the exact position of the blind.
blind_position_1:
min: 0
max: 100
Automation
Triggers anytime the input_number is changed and sends the value (retrieved via templating) to the event which matches the one you created on IFTTT. Information on configuring IFTTT with HA and creating webhooks can be found on the IFTTT component documentation linked above.
alias: Blind Automation 1
trigger:
platform: state
entity_id: input_number.name_of_your_input_number
action:
- service: ifttt.trigger
data_template: {"event":"name_of_ifttt_web_request", "value1":"{{trigger.to_state.state | int}}"}
Script
A single script to handle both opening and closing of the cover by using templating to dynamically call the correct service. Lastly {{position}} will set the value of your input_number to 0 or 100 depending on the service called.
blind_script_1:
sequence:
- service_template: cover.{{mode}}_cover
data:
entity_id: cover.name_of_cover
- service: input_number.set_value
data_template:
entity_id: input_number.blind_position_1
value: "{{position}}"
Show and tell
Feedback/Comments/Suggestions
There is always room to improve so I’d love to hear any feedback, comments or suggestions you may have. Thank you and enjoy!