hi, it’s time to ask
I have this window opener LIWIN ML25 S1 38H 0W 00 Window Chain Motor
it has 3 cables, 1 to open, 1 to close and a neutral.
To control it, i have a basic zigbee switch 2 gang.
On top of that, i have a magnetic sensor that is on when the window is open and off otherwise.
What i have now on my dashboard is this
Related code :
type: entities
entities:
- entity: light.velux_relais_light
name: pousse
- entity: light.velux_relais_light_2
name: tire
- entity: binary_sensor.sensor_velux_opening
icon: mdi:motion-sensor
(the zigbee device is seen has a light but it’s not the problem)
If i toggle “pousse”, the window will open in full. I can control the aperture on the device itself. The sensor is going from Closed to Open.
Now i toggle “tire”, the window is closing until it cannot go further. Sensor : Open-> Closed
The first issue is to open the window again, i have to toggle “pousse” back and forth. Idem for “tire”
Second issue, i have 2 toggles switch when i only need one.
Ideally i want something like this
Check 2nd post, cant put more than 1 embedded media…
- 2 buttons, up and down and are greyed out 15s after clicking (maybe it’s possible to have only 1 button ?)
- some kind of state :
- closed, this one i know for sure with the sensor
- closing after clicking the down button until the sensor trigger
- opening after clicking the up button
- opened 15s after clicking the up button
So i made a template/card that is not working correctly : the state is not changing and the buttons are not refreshing
cover:
- platform: template
covers:
velux:
device_class: window
friendly_name: "Velux"
unique_id: "velux"
value_template: "{{ 'closed' if is_state('binary_sensor.binary_sensor.sensor_velux_opening', 'off') else 'opening' }}"
open_cover:
action: script.ouvrir_velux
close_cover:
action: script.fermer_velux
The scripts
sequence:
- type: toggle
device_id: d9c01287ee3ada2e5ed71ced77a2690c
entity_id: d14a436cafe9c5666b4a76d2515070ac
domain: light
- delay:
seconds: 15
alias: fermer_velux
description: ""
sequence:
- type: toggle
device_id: d9c01287ee3ada2e5ed71ced77a2690c
entity_id: 1f95ec96ed6142e86b5d41b313d1c64a
domain: light
- delay:
seconds: 15
alias: ouvrir_velux
description: ""
And finally on the frontend
type: horizontal-stack
cards:
- type: custom:mushroom-cover-card
show_buttons_control: true
entity: cover.velux
secondary_info: last-changed
primary_info: state
grid_options:
columns: 6
rows: auto
Thx for your help