Hi all,
i have some qubino zwave roller modules and I managed to automate them in HA.
Unfortunately from time to time( don’t know why, maybe a zwave or module bug) the roller received the “open roller” command and stayed closed (i know this because i hear the "clac noise from the module)
so the zwave device received it command but somehow did not open it.
manual solution : send the opposite command (the roller is closed but i need to say close roller), and right after send again the open roller.
my idea : instead of just using the defaut switch => write a script for open and a script for close
I wrotte following script
open_salon:
sequence:
- data:
payload_template: "{{(state_attr('cover.qubino_salon_level', 'current_position')|int)}}"
retain: 'true'
topic: /volet/salon/position
service: mqtt.publish
- data:
entity_id: cover.qubino_salon_level
service: cover.open_cover
- delay: '1'
- condition: template
value_template: "{{ (states.cover.qubino_salon_level.attributes.current_position|int) == (states.sensor.position_volet_salon.state|int) }}"
- data:
entity_id: cover.qubino_salon_level
service: cover.close_cover
- delay: '1'
- data:
entity_id: cover.qubino_salon_level
service: cover.open_cover
as I have 4 cover, with different names, is it possible to change this script to work with the different covers ?
indeed this is the open for “salon”
i want to have the open for “cuisine” for ex, as my sensor and cover are all the same form and include the name of the roller, would it be possible parameterize this ?
indeed i could copy/paste the script 3 times, but for maintenance reason i would prefer preventing code repetition
basically I want to do something like this
VAR = a list of values(for ex salon, cuisine, chambre)
some kind of loop with
open_VAR:
sequence:
- data:
payload_template: "{{(state_attr('cover.qubino_VAR_level', 'current_position')|int)}}"
retain: 'true'
topic: /volet/VAR/position
service: mqtt.publish
- data:
entity_id: cover.qubino_VAR_level
service: cover.open_cover
- delay: '1'
- condition: template
value_template: "{{ (states.cover.qubino_VAR_level.attributes.current_position|int) == (states.sensor.position_volet_VAR.state|int) }}"
- data:
entity_id: cover.qubino_VAR_level
service: cover.close_cover
- delay: '1'
- data:
entity_id: cover.qubino_VAR_level
service: cover.open_cover