stas-demydiuk / domoticz-zigbee2mqtt-plugin

zigbee2mqtt plugin for domoticz
MIT License
136 stars 100 forks source link

reverse position for blinds ts130f doesn't change anything in domoticz #875

Closed anthropo closed 1 month ago

anthropo commented 4 months ago

Hello

I have devices known as ts130f to drive my blinds and It seems that inverting position doesn't work in domoticz (Perhaps it is not 'reverse position' (i translate from french, sorry))

Via Zigbee2MQTT it works in the right way ( Expose, open et close)

So i have two blinds that go in the wrong way. Whatever 'reverse position' is active or not. I need to click on 'open' to close.

Version de Zigbee2MQTT [1.35.3] (https://github.com/Koenkk/zigbee2mqtt/releases/tag/1.35.3) commit: fe0742a6

Type de coordinateur ConBee2/RaspBee2

Révision du coordinateur 0x26780700

Version de l'interface 0.6.156

zigbee_herdsman_converters_version 18.28.3

zigbee_herdsman_version 0.33.8 Python version: Python 3.11.2 Domoticz version: 2024.4 Plugin version: ## 3.2.0-beta

So if my blinds are opened and if i click on close nothing happens but in the logs i see :

Zigbee2mqtt.log :

info 2024-02-19 19:29:27MQTT publish: topic 'zigbee2mqtt/Volet TV', payload '{"backlight_mode":"ON","calibration":"OFF","calibration_time":25.9,"indicator_mode":"off","last_seen":"2024-02-19T18:29:27.869Z","linkquality":255,"motor_reversal":"ON","moving":"STOP","position":100,"state":"OPEN"}'
info 2024-02-19 19:29:27MQTT publish: topic 'zigbee2mqtt/Volet TV', payload '{"backlight_mode":"ON","calibration":"OFF","calibration_time":25.9,"indicator_mode":"off","last_seen":"2024-02-19T18:29:27.879Z","linkquality":255,"motor_reversal":"ON","moving":"UP","position":100,"state":"OPEN"}'
info 2024-02-19 19:29:28MQTT publish: topic 'zigbee2mqtt/Volet TV', payload '{"backlight_mode":"ON","calibration":"OFF","calibration_time":25.9,"indicator_mode":"off","last_seen":"2024-02-19T18:29:28.363Z","linkquality":255,"motor_reversal":"ON","moving":"STOP","position":100,"state":"OPEN"}'

Domoticz log :

2024-02-19 19:28:09.930 ZigBee2MQTT-Deconz: [Command] Device 0xa4c138457c37891b(1): Open(level = 0, color = )
2024-02-19 19:28:09.940 ZigBee2MQTT-Deconz: Command "Open" from device "Volet Télévision (Position)"
2024-02-19 19:28:09.940 ZigBee2MQTT-Deconz: MqttClient::publish zigbee2mqtt/Volet TV/set ({"state": "open"})
2024-02-19 19:28:09.907 Status: User: admin (IP: 192.168.0.120) initiated a switch command (210/Volet Télévision (Position)/Close)
2024-02-19 19:28:10.805 ZigBee2MQTT-Deconz: [Command] Device 0xa4c138457c37891b(1): Open(level = 0, color = )
2024-02-19 19:28:10.822 ZigBee2MQTT-Deconz: Command "Open" from device "Volet Télévision (Position)"
2024-02-19 19:28:10.822 ZigBee2MQTT-Deconz: MqttClient::publish zigbee2mqtt/Volet TV/set ({"state": "open"})
2024-02-19 19:28:10.798 Status: User: admin (IP: 192.168.0.120) initiated a switch command (210/Volet Télévision (Position)/Close)
2024-02-19 19:28:14.131 Status: EventSystem: reset all device statuses...
2024-02-19 19:28:18.611 ZigBee2MQTT-Deconz: [Command] Device 0xa4c138457c37891b(1): Open(level = 0, color = )
2024-02-19 19:28:18.626 ZigBee2MQTT-Deconz: Command "Open" from device "Volet Télévision (Position)"
2024-02-19 19:28:18.626 ZigBee2MQTT-Deconz: MqttClient::publish zigbee2mqtt/Volet TV/set ({"state": "open"})
2024-02-19 19:28:18.571 Status: User: admin (IP: 192.168.0.120) initiated a switch command (210/Volet Télévision (Position)/Close)
2024-02-19 19:28:19.627 ZigBee2MQTT-Deconz: [Command] Device 0xa4c138457c37891b(1): Open(level = 0, color = )
2024-02-19 19:28:19.644 ZigBee2MQTT-Deconz: Command "Open" from device "Volet Télévision (Position)"
2024-02-19 19:28:19.644 ZigBee2MQTT-Deconz: MqttClient::publish zigbee2mqtt/Volet TV/set ({"state": "open"})
2024-02-19 19:28:19.598 Status: User: admin (IP: 192.168.0.120) initiated a switch command (210/Volet Télévision (Position)/Close)
2024-02-19 19:28:20.719 ZigBee2MQTT-Deconz: [Command] Device 0xa4c138457c37891b(1): Open(level = 0, color = )
2024-02-19 19:28:20.726 ZigBee2MQTT-Deconz: Command "Open" from device "Volet Télévision (Position)"
2024-02-19 19:28:20.727 ZigBee2MQTT-Deconz: MqttClient::publish zigbee2mqtt/Volet TV/set ({"state": "open"}) 
anthropo commented 4 months ago

In my Domoticz changing "Reverse Open/Close State" in the Blinds setting changes the position (opened or closed)

and in Zigbee2MQTT interface everything is configured correctly, when i click open in 'expose' it opens the blinds.

There is a bug : if i have the two unchecked (Reverse Open/Close State and Reverse position) the open command work but it tells the blinds are opened while it is closed. If one of them is checked the command is reversed.

I think i found the error but i'm not sure : I had a problem with command giving a null error in Zigbee2MQTT : Error: Zigbee: Blind switch: unable to handle command "Open" so i did what they say in https://domoticz.com/forum/viewtopic.php?p=294273&hilit=blind#p294273

But in fact in https://github.com/stas-demydiuk/domoticz-zigbee2mqtt-plugin/blob/master/devices/switch/blind_percentages_switch.py i have to change the code to :

        if cmd == 'ON' or cmd == 'OPEN':
            return {
                state_value_key: 'close'
            }
        elif cmd == 'OFF' or cmd == 'CLOSE':
            return {
                state_value_key: 'open'
            }

I don't know if ON and OFF are used in other use cases so i left it.

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.