Hi @InToSSH , I have the same problem, did you solved it.
If you have the same problem, then you’re using the wrong variable or your template is bad. No help can be provided without your configuration. It’s also best to start a new topic. When you revive old topics like this, they fall off the front page quickly unless there’s people watching the thread. This is why everyone’s question after @InToSSH’s question has gone unanswered.
Hello @drphungky and @Dreamray
I am really sorry about the delay and I know it’s probably too late, but I wanted to respond in case somebody else needs this in the future. I got caught up with a project and didn’t have much time to play with HA or monitor this forum.
This is the currently working config I am using for tilt:
- platform: template
covers:
living_room_cover_tilt:
friendly_name: "Living Room Cover Tilt"
position_template: "{{ state_attr('cover.living_room_cover', 'current_tilt_position') | int }}"
availability_template: "{% if is_state('cover.living_room_cover', 'unavailable') %} false {% else %} true {% endif %}"
device_class: blind
open_cover:
service: cover.open_cover_tilt
data:
entity_id: cover.living_room_cover
close_cover:
service: cover.close_cover_tilt
data:
entity_id: cover.living_room_cover
set_cover_position:
service: cover.set_cover_tilt_position
data_template:
entity_id: cover.living_room_cover
tilt_position: "{{position}}"
I think I gave up on getting Google to work with tilting the blinds. Weirdly, it did work for a while, but not sure if it was my current settings or not. Maybe google home was quietly testing tilt functionality for exposed blinds, who knows. I ended up abandoning my discoverable over MQTT microcontroller and did the whole thing in ESPHome. I don’t use tilt in this file anymore, but last I recall it did work in Home Assistant - I just took the buttons off the dashboard so it matches the remote (which as I mentioned above, only has up, down, and stop buttons - tilt is just down all the way, and stop doubles as “favorite” which is closed.) Full config is below in case anyone wants to steal the format:
esphome:
name: downstairs_esp
platform: ESP8266
board: nodemcuv2
wifi:
ssid:
password:
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Downstairs Esp Fallback Hotspot"
password:
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# Devices
remote_transmitter:
pin: D7
carrier_duty_percent: 100%
switch:
#Living Room Blinds
- platform: template
name: "Living Room Blinds Up Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: livingRoomBlindsUp
internal: TRUE
- platform: template
name: "Living Room Blinds Down Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: livingRoomBlindsDown
internal: TRUE
- platform: template
name: "Living Room Blinds Stop Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: livingRoomBlindsStop
internal: TRUE
#Dining Room Blinds
- platform: template
name: "Dining Room Blinds Up Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: diningRoomBlindsUp
internal: TRUE
- platform: template
name: "Dining Room Blinds Down Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: diningRoomBlindsDown
internal: TRUE
- platform: template
name: "Dining Room Blinds Stop Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: diningRoomBlindsStop
internal: TRUE
#Guest Room Blinds
- platform: template
name: "Guest Room Blinds Up Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: guestRoomBlindsUp
internal: TRUE
- platform: template
name: "Guest Room Blinds Down Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: guestRoomBlindsDown
internal: TRUE
- platform: template
name: "Guest Room Blinds Stop Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: guestRoomBlindsStop
internal: TRUE
#East Kitchen Blinds
- platform: template
name: "East Kitchen Blinds Up Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: eastKitchenBlindsUp
internal: TRUE
- platform: template
name: "East Kitchen Blinds Down Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: eastKitchenBlindsDown
internal: TRUE
- platform: template
name: "East Kitchen Blinds Stop Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: eastKitchenBlindsStop
internal: TRUE
#Kitchen Sink Blinds
- platform: template
name: "Kitchen Sink Blinds Up Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: kitchenSinkBlindsUp
internal: TRUE
- platform: template
name: "Kitchen Sink Blinds Down Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: kitchenSinkBlindsDown
internal: TRUE
- platform: template
name: "Kitchen Sink Blinds Stop Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: kitchenSinkBlindsStop
internal: TRUE
#Master Bedroom Blinds
- platform: template
name: "Master Bedroom Blinds Up Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 340ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 390ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: masterBedroomBlindsUp
internal: TRUE
- platform: template
name: "Master Bedroom Blinds Down Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 340ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 390ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: masterBedroomBlindsDown
internal: TRUE
- platform: template
name: "Master Bedroom Blinds Stop Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: masterBedroomBlindsStop
internal: TRUE
#Kids Room Blinds
- platform: template
name: "Kids Room Blinds Up Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 340ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 390ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 700, -350, 700, -350, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: kidsRoomBlindsUp
internal: TRUE
- platform: template
name: "Kids Room Blinds Down Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 340ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
- delay: 390ms
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 1750]
repeat:
times: 8
wait_time: 0s
id: kidsRoomBlindsDown
internal: TRUE
- platform: template
name: "Kids Room Blinds Stop Switch"
turn_on_action:
- remote_transmitter.transmit_raw:
code: [3850, -2450, 1750, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 700, -350, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 350, -700, 700, -350, 350, -700, 350, -700, 700, -350, 700, -350, 700, -350, 1750]
repeat:
times: 8
wait_time: 0s
id: kidsRoomBlindsStop
internal: TRUE
cover:
- platform: template
name: "Living Room Blinds"
open_action:
- switch.turn_on: livingRoomBlindsUp
close_action:
- switch.turn_on: livingRoomBlindsStop
stop_action:
- switch.turn_on: livingRoomBlindsStop
tilt_action:
- lambda: |-
if (tilt <= 0.5) {
id(livingRoomBlindsStop).turn_on();
}
else {
id(livingRoomBlindsDown).turn_on();
}
assumed_state: true
device_class: blind
- platform: template
name: "Dining Room Blinds"
open_action:
- switch.turn_on: diningRoomBlindsUp
close_action:
- switch.turn_on: diningRoomBlindsStop
stop_action:
- switch.turn_on: diningRoomBlindsStop
tilt_action:
- lambda: |-
if (tilt <= 0.5) {
id(diningRoomBlindsStop).turn_on();
}
else {
id(diningRoomBlindsDown).turn_on();
}
assumed_state: true
device_class: blind
- platform: template
name: "Guest Room Blinds"
open_action:
- switch.turn_on: guestRoomBlindsUp
close_action:
- switch.turn_on: guestRoomBlindsStop
stop_action:
- switch.turn_on: guestRoomBlindsStop
tilt_action:
- lambda: |-
if (tilt <= 0.5) {
id(guestRoomBlindsStop).turn_on();
}
else {
id(guestRoomBlindsDown).turn_on();
}
assumed_state: true
device_class: blind
- platform: template
name: "East Kitchen Blinds"
open_action:
- switch.turn_on: eastKitchenBlindsUp
close_action:
- switch.turn_on: eastKitchenBlindsStop
stop_action:
- switch.turn_on: eastKitchenBlindsStop
tilt_action:
- lambda: |-
if (tilt <= 0.5) {
id(eastKitchenBlindsStop).turn_on();
}
else {
id(eastKitchenBlindsDown).turn_on();
}
assumed_state: true
device_class: blind
- platform: template
name: "Kitchen Sink Blinds"
open_action:
- switch.turn_on: kitchenSinkBlindsUp
close_action:
- switch.turn_on: kitchenSinkBlindsStop
stop_action:
- switch.turn_on: kitchenSinkBlindsStop
tilt_action:
- lambda: |-
if (tilt <= 0.5) {
id(kitchenSinkBlindsStop).turn_on();
}
else {
id(kitchenSinkBlindsDown).turn_on();
}
assumed_state: true
device_class: blind
- platform: template
name: "Master Bedroom Blinds"
open_action:
- switch.turn_on: masterBedroomBlindsUp
close_action:
- switch.turn_on: masterBedroomBlindsStop
stop_action:
- switch.turn_on: masterBedroomBlindsStop
tilt_action:
- lambda: |-
if (tilt <= 0.5) {
id(masterBedroomBlindsStop).turn_on();
}
else {
id(masterBedroomBlindsDown).turn_on();
}
assumed_state: true
device_class: blind
- platform: template
name: "Kids Room Blinds"
open_action:
- switch.turn_on: kidsRoomBlindsUp
close_action:
- switch.turn_on: kidsRoomBlindsStop
stop_action:
- switch.turn_on: kidsRoomBlindsStop
tilt_action:
- lambda: |-
if (tilt <= 0.5) {
id(kidsRoomBlindsStop).turn_on();
}
else {
id(kidsRoomBlindsDown).turn_on();
}
assumed_state: true
device_class: blind
This is what I did in ESPHome, which is running on Shelly 2.5, which is connected directly in place of my previous up/down buttons on my blind. This exposes the cover with tilt in my HA, then I separated the tilt to separate cover using the code above and I am using it as a separate cover in Google Home to control the tilt with my voice.
globals:
- id: cover_moving #This is for the HW buttons to determine if a press should stop the blind or start moving it (this could probably be done without this var by reading id(time_cover).current_operation)
type: bool
initial_value: "0"
cover:
- platform: time_based # Time based cover to track the position of the blind based on the time (unfortunatelly this doesn't support tilt)
name: ${device_name} - Time Cover
internal: True
id: time_cover
has_built_in_endstop: True # The controller in my blind automatically stops the motor in it's endpoints, this is set to True to be able to synchronize the zero position based on time with the actual position when the blind is either fully closed or open
# The power meter in the Shelly2.5 is then used to determine when the blind has stopped, sending a "cover.stop" action to this cover.
open_action:
- globals.set:
id: cover_moving
value: "true"
- script.execute: detect_endpoint
- switch.turn_off: motor_down
- switch.turn_on: motor_up
open_duration: 54sec # Set the correct time for your specific blind
close_action:
- globals.set:
id: cover_moving
value: "true"
- script.execute: detect_endpoint
- switch.turn_off: motor_up
- switch.turn_on: motor_down
close_duration: 53sec # Set the correct time for your specific blind
stop_action:
- globals.set:
id: cover_moving
value: "false"
- script.stop: detect_endpoint
- switch.turn_off: motor_up
- switch.turn_off: motor_down
- platform: template # Template cover which synchronizes position with the time_cover, but also supports tilt.
name: ${device_name}
id: template_cover
lambda: |-
if (id(template_cover).current_operation != id(time_cover).current_operation)
{
id(template_cover).current_operation = id(time_cover).current_operation;
}
return id(time_cover).position;
has_position: true
assumed_state: True
open_action:
- cover.open: time_cover
close_action:
- cover.close: time_cover
stop_action:
- cover.stop: time_cover
position_action:
- cover.control:
id: time_cover
position: !lambda |-
return pos;
tilt_action:
- lambda: |-
if (tilt == 1) {
auto call1 = id(time_cover).make_call();
call1.set_command_open();
call1.perform();
delay(1000);
auto call2 = id(time_cover).make_call();
call2.set_command_stop();
call2.perform();
} else if (tilt == 0) {
auto call1 = id(time_cover).make_call();
call1.set_command_close();
call1.perform();
delay(1000);
auto call2 = id(time_cover).make_call();
call2.set_command_stop();
call2.perform();
} else {
if (tilt > 0.5) {
auto call1 = id(time_cover).make_call();
call1.set_command_open();
call1.perform();
delay(1000);
auto call2 = id(time_cover).make_call();
call2.set_command_stop();
call2.perform();
delay(500);
auto call3 = id(time_cover).make_call();
call3.set_command_close();
call3.perform();
delay(1000 - (tilt*1000) + 50);
auto call4 = id(time_cover).make_call();
call4.set_command_stop();
call4.perform();
}
if (tilt <= 0.5) {
auto call1 = id(time_cover).make_call();
call1.set_command_close();
call1.perform();
delay(1000);
auto call2 = id(time_cover).make_call();
call2.set_command_stop();
call2.perform();
delay(500);
auto call3 = id(time_cover).make_call();
call3.set_command_open();
call3.perform();
delay(tilt*1000 + 200);
auto call4 = id(time_cover).make_call();
call4.set_command_stop();
call4.perform();
}
}
id(template_cover).tilt = tilt;
id(template_cover).publish_state();
script:
- id: detect_endpoint # Used to detect the endpoint of the blind based on the power draw, the blind automatically stops in it's endpoints, this might not be needed, but I don't like the idea of leaving the relay on when "has_built_in_endstop" is used on the cover.
then:
- delay: 5sec
- wait_until:
sensor.in_range:
id: power_down
below: 20
- wait_until:
sensor.in_range:
id: power_up
below: 20
- cover.stop: template_cover
switch:
- platform: gpio
pin: 4
name: ${device_name} - Motor UP
id: motor_up
interlock: [motor_down]
interlock_wait_time: 100ms
internal: true
restore_mode: always off
- platform: gpio
pin: 15
name: ${device_name} - Motor DOWN
id: motor_down
interlock: [motor_up]
interlock_wait_time: 100ms
internal: true
restore_mode: always off
binary_sensor:
- platform: gpio # Physical button on the wall to move the blind UP
pin: 5
name: ${device_name} - Button UP
on_press:
then:
- if:
condition:
lambda: 'return !id(cover_moving);'
then:
- cover.open: template_cover
on_click:
- min_length: 1ms
max_length: 999ms
then:
- cover.stop: template_cover
- platform: gpio # Physical button on the wall to move the blind DOWN
pin: 13
name: ${device_name} - Button DOWN
on_press:
then:
- if:
condition:
lambda: 'return !id(cover_moving);'
then:
- if:
condition:
binary_sensor.is_off: ha_covers_blocked
then:
- cover.close: template_cover
on_click:
- min_length: 1ms
max_length: 999ms
then:
- cover.stop: template_cover
- platform: homeassistant
name: ${device_name} - HA Covers Blocked
entity_id: input_boolean.covers_blocked
id: ha_covers_blocked
- platform: homeassistant
name: ${device_name} - HA UP
entity_id: input_boolean.momentary_up
internal: true
on_press:
then:
- if:
condition:
lambda: 'return !id(cover_moving);'
then:
- cover.open: template_cover
on_click:
- min_length: 1ms
max_length: 999ms
then:
- cover.stop: template_cover
- platform: homeassistant
name: ${device_name} - HA DOWN
internal: true
entity_id: input_boolean.momentary_down
on_press:
then:
- if:
condition:
lambda: 'return !id(cover_moving);'
then:
- cover.close: template_cover
on_click:
- min_length: 1ms
max_length: 999ms
then:
- cover.stop: template_cover
sensor:
- platform: ade7953
voltage:
name: ${device_name} - Voltage
current_a:
name: ${device_name} - Current Down
internal: True
current_b:
name: ${device_name} - Current Up
internal: True
active_power_a:
name: ${device_name} - Power Down
id: power_down
active_power_b:
name: ${device_name} - Power Up
id: power_up
filters:
- multiply: -1
update_interval: 3s
This worked perfectly! Thank you!
I have the Z-Wave iBlinds 3 which work great within Home Assistant but where exposed to Google Assistant as unavailable.
I installed your template and after a quick HA restart, I had working blinds in Google Home app/Google Assistant.
For reference, here is what the state and attributes of the original iBlinds entity (top) looks like compared to the newly created cover template (bottom):
Hello @InToSSH, I am trying to find a solution about a similar issue. Can you look at the coding below and find a solution for me?
In the smart curtain system I have been using for a long time, I can only raise and lower the curtain. But when the power is cut off, I want the motor to remember where it left off and continue. Plus I want to be able to raise and lower the curtain to the desired %. Can you help me with this?
My tools in the curtain system.
Nema 17 stepper motor
A4988 motor driver board
Esp32-wroom-32 programming board
LM2596 Regulator
3 buttons
DC 12v adapter
Self-prepared coding
substitutions:
devicename: yatakodasiperde
mystepper: my_stepper
speed: 1200 steps/s
esphome:
name: $devicename
platform: ESP32
board: nodemcu-32s
libraries:
- EEPROM
# Enable logging
logger:
level: DEBUG
logs:
esphome.core: DEBUG
esphome.components: DEBUG
# Enable Home Assistant API
api:
services:
- service: control_stepper
variables:
target: int
then:
- stepper.set_target:
id: my_stepper
target: !lambda 'return target;'
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
manual_ip:
static_ip: 192.168.1.69
gateway: 192.168.1.1
subnet: 255.255.255.0
dns1: 192.168.1.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Akilli Perde"
password: "password"
captive_portal:
web_server:
port: 80
stepper:
- platform: a4988
id: $mystepper
step_pin: GPIO19
dir_pin:
number: GPIO18
inverted: true
max_speed: ${speed}
acceleration: inf
deceleration: inf
sensor:
- platform: wifi_signal
name: "WiFi Sinyali yatakodasiperde"
update_interval: 60s
text_sensor:
- platform: wifi_info
ip_address:
icon: "mdi:ip"
name: "IP yatakodasiperde"
ssid:
name: "SSID yatakodasiperde"
icon: "mdi:access-point-network"
bssid:
name: "BSSID yatakodasiperde"
icon: "mdi:access-point-network"
output:
- platform: gpio
pin: GPIO21
inverted: true
id: enable_pin
binary_sensor:
- platform: gpio
id: perde_kaldirma_button
name: Perdeyi kaldir
pin:
number: GPIO12
mode: INPUT_PULLUP
inverted: true
on_press:
then:
- output.turn_on: enable_pin
- if:
condition:
lambda: 'return id($mystepper).current_position != 35000;'
then:
- stepper.set_target:
id: $mystepper
target: 35000
- delay: 1ms
- while:
condition:
lambda: 'return id($mystepper).current_position != 35000;'
then:
- delay: 1ms
- delay: 1ms
- output.turn_off: enable_pin
- platform: gpio
id: perde_indirme_button
name: Perdeyi indir
pin:
number: GPIO13
mode: INPUT_PULLUP
inverted: true
on_press:
then:
- output.turn_on: enable_pin
- if:
condition:
lambda: 'return id($mystepper).current_position != 0;'
then:
- stepper.set_target:
id: $mystepper
target: 0
- delay: 1ms
- while:
condition:
lambda: 'return id($mystepper).current_position != 0;'
then:
- delay: 1ms
- delay: 1ms
- output.turn_off: enable_pin
- cover.template.publish:
id: blinded
position: !lambda 'return id($mystepper).current_position;'
- platform: gpio
id: perde_durdurma_button
name: Perdeyi durdur
pin:
number: GPIO14
mode: INPUT_PULLUP
inverted: true
on_press:
then:
- output.turn_off: enable_pin
- stepper.set_target:
id: $mystepper
target: !lambda 'return id($mystepper).current_position;'
cover:
- platform: template
name: Yatakodasi-Perde
id: blinded
open_action:
- output.turn_on: enable_pin
- if:
condition:
lambda: 'return id($mystepper).current_position != 35000;'
then:
- stepper.set_target:
id: $mystepper
target: 35000
- delay: 1ms
- while:
condition:
lambda: 'return id($mystepper).current_position != 35000;'
then:
- delay: 1ms
- delay: 1ms
- output.turn_off: enable_pin
close_action:
- output.turn_on: enable_pin
- if:
condition:
lambda: 'return id($mystepper).current_position != 0;'
then:
- stepper.set_target:
id: $mystepper
target: 0
- delay: 1ms
- while:
condition:
lambda: 'return id($mystepper).current_position != 0;'
then:
- delay: 1ms
- delay: 1ms
- output.turn_off: enable_pin
stop_action:
- output.turn_off: enable_pin
- stepper.set_target:
id: $mystepper
target: !lambda 'return id($mystepper).current_position;'
- cover.template.publish:
id: blinded
position: !lambda 'return id($mystepper).current_position;'