Hello.
I have been working trying to get my roller blind position working today. I had not seen the recent posts to this thread.
So I am trying Seweryn_Zeman’s time_counter custom component.
I have modified my different config files, and like the simple elegant look of the simple slider that is shown in PierreScerri’s screenshot.
I have my configuration files modified, and Lovelace is set up as per PierreScerri’s screenshot - thanks. However, I am back to an old problem:
The slider moves in the interface, but has no action whatsoever. It jumps back to its original (0%) position. Also, moving a shutter using the cover controls does nothing to the position slider… Hmm. Any ideas?
Also, one of my shutters, which shows this in states:
shows NaN% in lovelace? All the other showing “Closed” regardless of their positions. (All of them show 0.0 as the value in states, only this shutter displays NaN % in Lovelace?
Here’s some of my config:
From covers.yaml:
- platform: template
covers:
livingfront_cover:
friendly_name: "Living Room Front Shutter"
position_template: "{{ (states.time_counter.cover_livingfront_cover.state | int) }}"
open_cover:
- service: mqtt.publish
data:
topic: 'homeassistant/downstairs/shutters/LivingRoomShutter1/cmnd/POWER1'
payload: 'On'
close_cover:
- service: mqtt.publish
data:
topic: 'homeassistant/downstairs/shutters/LivingRoomShutter1/cmnd/POWER2'
payload: 'On'
stop_cover:
- service: mqtt.publish
data:
topic: 'homeassistant/downstairs/shutters/LivingRoomShutter1/cmnd/POWER3'
payload: 'On'
set_cover_position:
- service: time_counter.set
entity_id: time_counter.cover_livingfront_cover
data_template:
state: '{{ position }}'
- service_template: >
{% if position > states.cover.livingfront_cover.attributes.current_position | int %}
cover.open_cover
{% elif position < states.cover.livingfront_cover.attributes.current_position | int %}
cover.close_cover
{% endif %}
entity_id: cover.livingfront_cover
From my time_counter.yaml file:
cover_livingfront_cover:
name: "Living Room Front Shutter position counter"
duration: 21
min: 0
max: 100
debounce: 1000
From my scripts.yaml file:
open_front_shutter:
alias: Open Front Shutter
sequence:
- service: cover.open_cover
data:
entity_id: cover.livingfront_cover
- service: time_counter.upcount
data:
entity_id: cover.livingfront_cover
stop_front_cover:
alias: Stop Front Shutter
sequence:
- service: cover.stop_cover
data:
entity_id: cover.front_cover
- service: time_counter.stop
data:
entity_id: cover.front_cover
close_front_shutter:
alias: Close Front Shutter
sequence:
- service: cover.close_cover
data:
entity_id: cover.livingfront_cover
- service: time_counter.downcount
data:
entity_id: cover.livingfront_cover
and from my automation.yaml:
#Automations for Living Room Front Shutter
- alias: Living Room Front Shutter - started
trigger:
- platform: mqtt
topic: 'homeassistant/downstairs/shutters/LivingRoomShutter1/stat/+'
payload: 'ON'
action:
- service_template: >
{% if trigger.topic.split('/')[-1] == 'POWER1' %}
time_counter.downcount
{% elif trigger.topic.split('/')[-1] == 'POWER2' %}
time_counter.upcount
{% endif %}
entity_id: time_counter.cover_livingfront_cover
- alias: Living Room Front Shutter - stopped
trigger:
- platform: mqtt
topic: 'homeassistant/downstairs/shutters/LivingRoomShutter1/stat/+'
payload: 'OFF'
action:
- service: time_counter.stop
entity_id: time_counter.cover_livingfront_cover
- alias: Living Room Front Shutter - time counter stopped
trigger:
platform: event
event_type: time_counter.stopped
event_data:
entity_id: time_counter.cover_livingfront_cover
action:
- service: cover.stop_cover
data:
entity_id: cover.livingfront_cover
If anyone could give me a hint as to where I might look to get the sliders working, I would appreciate that ! Thanks