Hey,
So i have a smart button Tuya TS0041 control via MQTT | Zigbee2MQTT
and a smart curtain Zemismart ZM16EL-03/33 control via MQTT | Zigbee2MQTT
i have an automation working to open if closed and close if opened when double pressing the smart button,
i.e
alias: close office right curtain
description: ""
triggers:
- domain: mqtt
device_id: fed2c79dcfb3884285b3d3632173b52c
type: action
subtype: double
trigger: device
conditions:
- condition: device
device_id: 835d2e5b0c83a5bdc38667a9b2fb4e1a
domain: cover
entity_id: 8a44f720bb3962190525ab4be12f2047
type: is_open
actions:
- device_id: 835d2e5b0c83a5bdc38667a9b2fb4e1a
domain: cover
entity_id: 8a44f720bb3962190525ab4be12f2047
type: close
mode: single
The issue im having is setting up a way to stop the curtains?
i cant use single click as i have that configured to something
i cant use hold as the 4~ seconds to trigger the event is just too slow
What i am after is having logic to go “when double pressed and not fully open/closed stop curtains”
the problem is that the curtains set the final destination so it goes position 0/100 as soon as its triggered and the state changes straight to open/closed also
I did notice that it does end up going into the payload state in mqtt at “STOP” but i cant figure out how to access the raw mqtt payload in the automation if conditions?
i tried debugging the device state and it also matches what the interface reflects, its either open or close and never changes to stop
But in the mqtt info for the device i do see it ends up in stop
Received 5:01:16 PM
QoS: 0
Payload:
battery: 75
border: up
click_control: up
linkquality: 147
motor_fault: false
position: 100
reverse_direction: back
state: OPEN
Received 5:01:17 PM
QoS: 0
Payload:
battery: 75
border: up
click_control: up
linkquality: 147
motor_fault: false
position: 100
reverse_direction: back
state: STOP
Is there anyway to access the raw payload state to be used as the if statement?
that way i think i can get going what i need?
Or is there some other way to do this
ive come across using the history stats to go “if triggered within the last x seconds use stop action instead” but after an hour i couldn’t get it working and i felt like this was the over complicated answer a
thanks!
