Ajout switch tuya 4 boutons TS004F

Après, je ne passe pas par un scénario pour un appui simple, je le fais directement du bouton en « Toggle » sur l’interrupteur. Sinon, les scénarii des télécommandes sont en mode synchrone, ça améliore un peu …

2 « J'aime »

Salut à tous,

C’était long et un peu indigeste mais après pas mal de recherche voici pourquoi vos interrupteurs ts004f ne fonctionne pas correctement et surtout comment les faire fonctionner avec les 12 commandes possible.

Déjà ce qu’il faut savoir c’est que les ts004f peuvent devenir identique en tout point ou presque a des ts0044.

Ce qui diffère c’est que le ts004f a 2 modes : « Dimmer » et « Switch ». Par défaut c’est le mode « Dimmer ».

Pour changer de mode il vous faut rester appuyer sur les boutons 2 et 4 jusqu’à ce que le bouton 3 flash 1 fois.

Ce qui est con c’est que la manip pour changer de mode le ts004f en Switch doit ce faire après chaque inclusion étant donné que le bouton 3 d’association réinitialise l’interrupteur et remet donc celui dans son état par défaut « Dimmer ».

Donc Jeedom découvre systématiquement l’interrupteur quand il est en mode « Dimmer » et changer son mode après ne le fera pas découvrir les autres endpoints 2,3,4 donc seul le bouton 1 fonctionnera.

Le plugin Zigbee se base sur zhaquirk.
Il faut donc créer un custom Zhaquirks et le déposer la ou le plugin Zigbee vient chercher justement si il existe des custom class : html/plugins/zigbee/resources/zigbeed/quirks/ts004f.py .
Malheureusement le plugin jeedom est payant donc pas de git où faire une pull request…

Voici donc la démarche a suivre :

  • Supprimer vos interrupteurs.

  • Ajouter les fichiers ci-dessous.

  • Redémarrer le démon du plugin Jeedom pour prendre en compte le fichier du module.

  • Refaire une association en restant appuyé sur 3 pendant 10 secs.

  • Passer en mode « Switch » en restant appuyé sur 2 et 4 jusqu’à ce que le bouton 3 flash 1 fois.

Et voila enfin les 12 commandes dispos !

Chacun des boutons a un type d’appui : 0 = short 1 = double 2 = long

Je vous conseille d’utiliser le plugin Jexplorer de jeedom pour ceux qui n’ont pas d’accès SSH pour déposer les fichiers.

html/plugins/zigbee/resources/zigbeed/quirks/ts004f.py :

"""Tuya 4 Button Remote."""

from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
    Basic,
    Groups,
    Identify,
    LevelControl,
    OnOff,
    Ota,
    PowerConfiguration,
    Scenes,
    Time,
)

from zigpy.zcl.clusters.lightlink import LightLink


from zhaquirks.const import (
    BUTTON_1,
    BUTTON_2,
    BUTTON_3,
    BUTTON_4,
    COMMAND,
    DEVICE_TYPE,
    DOUBLE_PRESS,
    ENDPOINT_ID,
    ENDPOINTS,
    INPUT_CLUSTERS,
    LONG_PRESS,
    MODEL,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
    SHORT_PRESS,
)
from zhaquirks.tuya import TuyaSmartRemoteOnOffCluster


class Tuya4ButtonTriggers:
    """Tuya 4-button remote device triggers."""

    device_automation_triggers = {
        (SHORT_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: SHORT_PRESS},
        (LONG_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: LONG_PRESS},
        (DOUBLE_PRESS, BUTTON_1): {ENDPOINT_ID: 1, COMMAND: DOUBLE_PRESS},
        (SHORT_PRESS, BUTTON_2): {ENDPOINT_ID: 2, COMMAND: SHORT_PRESS},
        (LONG_PRESS, BUTTON_2): {ENDPOINT_ID: 2, COMMAND: LONG_PRESS},
        (DOUBLE_PRESS, BUTTON_2): {ENDPOINT_ID: 2, COMMAND: DOUBLE_PRESS},
        (SHORT_PRESS, BUTTON_3): {ENDPOINT_ID: 3, COMMAND: SHORT_PRESS},
        (LONG_PRESS, BUTTON_3): {ENDPOINT_ID: 3, COMMAND: LONG_PRESS},
        (DOUBLE_PRESS, BUTTON_3): {ENDPOINT_ID: 3, COMMAND: DOUBLE_PRESS},
        (SHORT_PRESS, BUTTON_4): {ENDPOINT_ID: 4, COMMAND: SHORT_PRESS},
        (LONG_PRESS, BUTTON_4): {ENDPOINT_ID: 4, COMMAND: LONG_PRESS},
        (DOUBLE_PRESS, BUTTON_4): {ENDPOINT_ID: 4, COMMAND: DOUBLE_PRESS},
    }


class ZemiSmartRemote0044f(CustomDevice, Tuya4ButtonTriggers):
    """Tuya 4-button remote device with time on in cluster."""
    
    signature = {
        # "node_descriptor": "NodeDescriptor(byte1=2, byte2=64, mac_capability_flags=128, manufacturer_code=4098, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=0, *allocate_address=True, *complex_descriptor_available=False, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False, *is_valid=True, *logical_type=<LogicalType.EndDevice: 2>, *user_descriptor_available=False)",
        # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=260, device_version=1, input_clusters=[0, 1, 3, 4, 6, 4096], output_clusters=[25, 10, 3, 4, 5, 6, 8, 4096])
        MODEL: "TS004F",
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.DIMMER_SWITCH,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    OnOff.cluster_id,
                    LightLink.cluster_id,
                ],
                OUTPUT_CLUSTERS: [
                    Ota.cluster_id,
                    Time.cluster_id,
                    Identify.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    OnOff.cluster_id,
                    LevelControl.cluster_id,
                    LightLink.cluster_id,
                ],
            }
        },
    }
    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    PowerConfiguration.cluster_id,
                    TuyaSmartRemoteOnOffCluster,
                    Time.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Ota.cluster_id],
            },
            2: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL,
                INPUT_CLUSTERS: [
                    PowerConfiguration.cluster_id,
                    TuyaSmartRemoteOnOffCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
            3: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL,
                INPUT_CLUSTERS: [
                    PowerConfiguration.cluster_id,
                    TuyaSmartRemoteOnOffCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
            4: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.REMOTE_CONTROL,
                INPUT_CLUSTERS: [
                    PowerConfiguration.cluster_id,
                    TuyaSmartRemoteOnOffCluster,
                ],
                OUTPUT_CLUSTERS: [],
            },
        },
    }

J’ai aussi modifié le fichier de commande Jeedom pour faciliter l’inclusion des commandes.

html/plugins/zigbee/core/config/device/tuya/TZ3000_xabckq1v.TS004F.json :

{
  "name": "Interrupteur intelligent 4 boutons avec piles",
  "ref": "TS004F",
  "configuration": {
    "battery_type": "1x3V CR2430"
  },
  "commands": [
{
      "name": "Bouton 1",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "1::6::cmd::0",
      "configuration": {
        "repeatEventManagement": "always"
      }
    },
    {
      "name": "Bouton 2",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "2::6::cmd::0",
      "configuration": {
        "repeatEventManagement": "always"
      }
    },
    {
      "name": "Bouton 3",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "3::6::cmd::0",
      "configuration": {
        "repeatEventManagement": "always"
      }
    },
    {
      "name": "Bouton 4",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "4::6::cmd::0",
      "configuration": {
        "repeatEventManagement": "always"
      }
    },
    {
      "name": "Bouton 1 type",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "1::6::cmd::1",
      "configuration": {
        "repeatEventManagement": "always"
      }
    },
    {
      "name": "Bouton 2 type",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "2::6::cmd::1",
      "configuration": {
        "repeatEventManagement": "always"
      }
    },
    {
      "name": "Bouton 3 type",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "3::6::cmd::1",
      "configuration": {
        "repeatEventManagement": "always"
      }
    },
    {
      "name": "Bouton 4 type",
      "type": "info",
      "subtype": "numeric",
      "isVisible": 1,
      "isHistorized": 0,
      "logicalId": "4::6::cmd::1",
      "configuration": {
        "repeatEventManagement": "always"
      }
    }
  ]
}

J’espère que ça aidera du monde :wink: !

2 « J'aime »

Alors là, si ça marche , t’es un dieu ! je vais tester ça ce soir !
Bon, j’ai pas pu attendre.
J’ai tout fais et je n’ai que le bouton 1 qui fonctionne.
image
J’ai fais ou l’erreur ?
En tout cas 1 bouton c’est mieux que rien du tout ! lol

Hello!
My bad, j’ai pas précisé qu’il faut redémarrer le démon du plugin Zigbee après l’ajout des fichiers, je viens d’edit mon post :wink:

Bon, ben verdict après avoir tout refait :
image
J’ai toujours qu’un seul bouton avec ses 3 modes

Partage tes infos brutes dans « configuration du module ».

Tu devrais avoir quelque chose qui ressemble a ça :

{
    "ieee": "60:a4:23:ff:fe:fc:86:2e",
    "nwk": 39056,
    "status": 2,
    "lqi": "93",
    "rssi": "0",
    "last_seen": "1641918021.5277584",
    "node_descriptor": "02:40:80:02:10:52:52:00:00:2c:52:00:00",
    "endpoints": [
        {
            "id": 1,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": "_TZ3000_xabckq1v",
            "model": "TS004F",
            "output_clusters": [
                {
                    "id": 25,
                    "name": "Ota",
                    "attributes": []
                }
            ],
            "input_clusters": [
                {
                    "id": 0,
                    "name": "Basic",
                    "attributes": [
                        {
                            "id": 0,
                            "name": "zcl_version",
                            "value": 3
                        },
                        {
                            "id": 1,
                            "name": "app_version",
                            "value": 65
                        },
                        {
                            "id": 2,
                            "name": "stack_version",
                            "value": 0
                        },
                        {
                            "id": 3,
                            "name": "hw_version",
                            "value": 1
                        },
                        {
                            "id": 4,
                            "name": "manufacturer",
                            "value": "_TZ3000_xabckq1v"
                        },
                        {
                            "id": 5,
                            "name": "model",
                            "value": "TS004F"
                        },
                        {
                            "id": 6,
                            "name": "date_code",
                            "value": ""
                        },
                        {
                            "id": 7,
                            "name": "power_source",
                            "value": 3
                        }
                    ]
                },
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": [
                        {
                            "id": 32,
                            "name": "battery_voltage",
                            "value": 30
                        },
                        {
                            "id": 33,
                            "name": "battery_percentage_remaining",
                            "value": 200
                        }
                    ]
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                },
                {
                    "id": 10,
                    "name": "Time",
                    "attributes": []
                }
            ]
        },
        {
            "id": 2,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 3,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 4,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        }
    ],
    "signature": {
        "manufacturer": "_TZ3000_xabckq1v",
        "model": "TS004F",
        "node_desc": {
            "logical_type": 2,
            "complex_descriptor_available": 0,
            "user_descriptor_available": 0,
            "reserved": 0,
            "aps_flags": 0,
            "frequency_band": 8,
            "mac_capability_flags": 128,
            "manufacturer_code": 4098,
            "maximum_buffer_size": 82,
            "maximum_incoming_transfer_size": 82,
            "server_mask": 11264,
            "maximum_outgoing_transfer_size": 82,
            "descriptor_capability_field": 0
        },
        "endpoints": {
            "1": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    0,
                    1,
                    6,
                    10
                ],
                "output_clusters": [
                    25
                ]
            },
            "2": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "3": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "4": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            }
        }
    },
    "class": "ts004f"
}

Dans mon log en debug j’ai rien qui remonte lors de l’appui sur les 3 autres bouton.
Infos bruts :

{
    "ieee": "84:fd:27:ff:fe:80:30:da",
    "nwk": 62031,
    "status": 2,
    "lqi": "112",
    "rssi": "-72",
    "last_seen": "1641918983.4476304",
    "node_descriptor": "02:40:80:02:10:52:52:00:00:2c:52:00:00",
    "endpoints": [
        {
            "id": 1,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [
                {
                    "id": 25,
                    "name": "Ota",
                    "attributes": []
                }
            ],
            "input_clusters": [
                {
                    "id": 0,
                    "name": "Basic",
                    "attributes": []
                },
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": [
                        {
                            "id": 33,
                            "name": "battery_percentage_remaining",
                            "value": 200
                        }
                    ]
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                },
                {
                    "id": 10,
                    "name": "Time",
                    "attributes": []
                }
            ]
        },
        {
            "id": 2,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 3,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 4,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        }
    ],
    "signature": {
        "manufacturer": "_TZ3000_xabckq1v",
        "model": "TS004F",
        "node_desc": {
            "logical_type": 2,
            "complex_descriptor_available": 0,
            "user_descriptor_available": 0,
            "reserved": 0,
            "aps_flags": 0,
            "frequency_band": 8,
            "mac_capability_flags": 128,
            "manufacturer_code": 4098,
            "maximum_buffer_size": 82,
            "maximum_incoming_transfer_size": 82,
            "server_mask": 11264,
            "maximum_outgoing_transfer_size": 82,
            "descriptor_capability_field": 0
        },
        "endpoints": {
            "1": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    0,
                    1,
                    6,
                    10
                ],
                "output_clusters": [
                    25
                ]
            },
            "2": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "3": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "4": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            }
        }
    },
    "class": "ts004f"
}

J’en ai un autre ou c’est pareil :

{
    "ieee": "5c:02:72:ff:fe:04:3f:49",
    "nwk": 60139,
    "status": 2,
    "lqi": "80",
    "rssi": "-80",
    "last_seen": "1641919492.5590415",
    "node_descriptor": "02:40:80:02:10:52:52:00:00:2c:52:00:00",
    "endpoints": [
        {
            "id": 1,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": "_TZ3000_xabckq1v",
            "model": "TS004F",
            "output_clusters": [
                {
                    "id": 25,
                    "name": "Ota",
                    "attributes": []
                }
            ],
            "input_clusters": [
                {
                    "id": 0,
                    "name": "Basic",
                    "attributes": [
                        {
                            "id": 4,
                            "name": "manufacturer",
                            "value": "_TZ3000_xabckq1v"
                        },
                        {
                            "id": 5,
                            "name": "model",
                            "value": "TS004F"
                        }
                    ]
                },
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                },
                {
                    "id": 10,
                    "name": "Time",
                    "attributes": []
                }
            ]
        },
        {
            "id": 2,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 3,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 4,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        }
    ],
    "signature": {
        "manufacturer": "_TZ3000_xabckq1v",
        "model": "TS004F",
        "node_desc": {
            "logical_type": 2,
            "complex_descriptor_available": 0,
            "user_descriptor_available": 0,
            "reserved": 0,
            "aps_flags": 0,
            "frequency_band": 8,
            "mac_capability_flags": 128,
            "manufacturer_code": 4098,
            "maximum_buffer_size": 82,
            "maximum_incoming_transfer_size": 82,
            "server_mask": 11264,
            "maximum_outgoing_transfer_size": 82,
            "descriptor_capability_field": 0
        },
        "endpoints": {
            "1": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    0,
                    1,
                    6,
                    10
                ],
                "output_clusters": [
                    25
                ]
            },
            "2": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "3": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "4": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            }
        }
    },
    "class": "ts004f"
}

Ok donc la class est bien pris en compte, as-tu essayé de rechanger de mode ?
Appui sur 2 et 4 jusqu’à ce que 3 flash.
Est-ce que ton bouton fonctionne toujours en rechangeant de mode ?

J’ai refais le premier, il devait être mal inclus et les infos brut ont changé :

{
    "ieee": "84:fd:27:ff:fe:80:30:da",
    "nwk": 56499,
    "status": 2,
    "lqi": "72",
    "rssi": "-82",
    "last_seen": "1641920756.784734",
    "node_descriptor": "02:40:80:02:10:52:52:00:00:2c:52:00:00",
    "endpoints": [
        {
            "id": 1,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": "_TZ3000_xabckq1v",
            "model": "TS004F",
            "output_clusters": [
                {
                    "id": 25,
                    "name": "Ota",
                    "attributes": []
                }
            ],
            "input_clusters": [
                {
                    "id": 0,
                    "name": "Basic",
                    "attributes": [
                        {
                            "id": 4,
                            "name": "manufacturer",
                            "value": "_TZ3000_xabckq1v"
                        },
                        {
                            "id": 5,
                            "name": "model",
                            "value": "TS004F"
                        }
                    ]
                },
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                },
                {
                    "id": 10,
                    "name": "Time",
                    "attributes": []
                }
            ]
        },
        {
            "id": 2,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 3,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 4,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        }
    ],
    "signature": {
        "manufacturer": "_TZ3000_xabckq1v",
        "model": "TS004F",
        "node_desc": {
            "logical_type": 2,
            "complex_descriptor_available": 0,
            "user_descriptor_available": 0,
            "reserved": 0,
            "aps_flags": 0,
            "frequency_band": 8,
            "mac_capability_flags": 128,
            "manufacturer_code": 4098,
            "maximum_buffer_size": 82,
            "maximum_incoming_transfer_size": 82,
            "server_mask": 11264,
            "maximum_outgoing_transfer_size": 82,
            "descriptor_capability_field": 0
        },
        "endpoints": {
            "1": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    0,
                    1,
                    6,
                    10
                ],
                "output_clusters": [
                    25
                ]
            },
            "2": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "3": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "4": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            }
        }
    },
    "class": "ts004f"
}

Citation
Ok donc la class est bien pris en compte, as-tu essayé de rechanger de mode ?
Appui sur 2 et 4 jusqu’à ce que 3 flash.
Est-ce que ton bouton fonctionne toujours en rechangeant de mode ?

Non ça marche plus si je repasse dans l’autre mode

C’est étrange, peut être que le firmware de ton interrupteur est légèrement différent.

Remet ton interrupteur en mode « switch » et met toi en mode debug sur le plugin Zigbee, enregistre et redémarre le demon du plugin.

Ensuite ouvre le fichier de log zigbeed, attend un peu que ton demon s’initialise et recherche « ignoring »

Fait un peu toutes les combinaisons possible sur ton interrupteur après.

Si tu vois une ligne a chaque pression c’est déjà bon signe!

Post le résultat des logs, ils indiquent quels endpoints il faut mapper si ils le sont pas déjà.

1 « J'aime »

Salut, merci pour ton aide; a l’adresse que tu indiques je n’ai pas le fichier ts004f.py


et le log à l’intérieur du fichier TS 130f… :

"""Device handler for loratap TS130F smart curtain switch."""
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.closures import WindowCovering
from zigpy.zcl.clusters.general import Basic, Groups, OnOff, Ota, Scenes, Time

from zhaquirks.const import (
    DEVICE_TYPE,
    ENDPOINTS,
    INPUT_CLUSTERS,
    MODEL,
    OUTPUT_CLUSTERS,
    PROFILE_ID,
)

ATTR_CURRENT_POSITION_LIFT_PERCENTAGE = 0x0008
CMD_GO_TO_LIFT_PERCENTAGE = 0x0005


class TuyaWithBacklightOnOffCluster(CustomCluster):
    """TuyaSmartCurtainOnOffCluster: fire events corresponding to press type."""

    cluster_id = OnOff.cluster_id

    LIGHT_MODE_1 = {0x8001: 0}
    LIGHT_MODE_2 = {0x8001: 1}
    LIGHT_MODE_3 = {0x8001: 2}

    attributes = {0x8001: ("backlight_mode", t.enum8)}


class TuyaCoveringCluster(CustomCluster, WindowCovering):
    """TuyaSmartCurtainWindowCoveringCluster: Allow to setup Window covering tuya devices."""

    attributes = WindowCovering.attributes.copy()
    attributes.update({0xF000: ("tuya_moving_state", t.enum8)})
    attributes.update({0xF001: ("calibration", t.enum8)})
    attributes.update({0xF002: ("motor_reversal", t.enum8)})
    attributes.update({0xF003: ("calibration_time", t.uint16_t)})

    def _update_attribute(self, attrid, value):
        super()._update_attribute(attrid, value)

    async def command(
        self, command_id, *args, manufacturer=None, expect_reply=True, tsn=None
    ):
        """Override default command to invert percent lift value."""
        if command_id == CMD_GO_TO_LIFT_PERCENTAGE:
            percent = args[0]
            v = (percent,)
            return await super().command(command_id, *v)
        return await super().command(
            command_id,
            *args,
            manufacturer=manufacturer,
            expect_reply=expect_reply,
            tsn=tsn
        )


class TuyaTS130FTI(CustomDevice):
    """Tuya smart curtain roller shutter Time In."""

    signature = {
        # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=0x0202, device_version=1, input_clusters=[0, 4, 5, 6, 10, 0x0102], output_clusters=[25]))
        MODEL: "TS130F",
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    OnOff.cluster_id,
                    WindowCovering.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
        },
    }
    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaWithBacklightOnOffCluster,
                    TuyaCoveringCluster,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
        },
    }

class TuyaTS130FTI2(CustomDevice):
    """Tuya smart curtain roller shutter Time In."""

    signature = {
        # SizePrefixedSimpleDescriptor(endpoint=1, profile=260, device_type=0x0203, device_version=1, input_clusters=[0, 4, 5, 6, 10, 0x0102], output_clusters=[25]))
        MODEL: "TS130F",
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_CONTROLLER,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    OnOff.cluster_id,
                    WindowCovering.cluster_id,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
        },
    }
    replacement = {
        ENDPOINTS: {
            1: {
                PROFILE_ID: zha.PROFILE_ID,
                DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_CONTROLLER,
                INPUT_CLUSTERS: [
                    Basic.cluster_id,
                    Groups.cluster_id,
                    Scenes.cluster_id,
                    TuyaWithBacklightOnOffCluster,
                    TuyaCoveringCluster,
                ],
                OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
            },
        },
    }


est ce que je peux y coller ton fichier tu penses ??

Hello,

Tu ne peux pas ajouter ça a la fin d’un fichier, Il faut créer un nouveau fichier, nomme le « ts004f.py » et colle le contenu dedans.

Alors en mode debug j’ai rien sauf quand j’utilise le bouton 1.

Merci pour ta réponse, bon pour le moment je n’arrive pas a le faire marcher, la seule chose que je n’ai pas fait comme tu l’as noté c’est relancer le démon jeedom; j’ai fait un reboot de jeedom mais ca doit pas changer grand chose.

Depuis la manip a la 2eme intégration j’ai les 4 commandes info qui se créent, j’ai meme les 4 end point dans la config du module. Mes infos brutes donnent :


    "ieee": "84:fd:27:ff:fe:8d:41:6c",
    "nwk": 52015,
    "status": 2,
    "lqi": "216",
    "rssi": "-46",
    "last_seen": "1641935805.778872",
    "node_descriptor": "02:40:80:02:10:52:52:00:00:2c:52:00:00",
    "endpoints": [
        {
            "id": 1,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": "_TZ3000_xabckq1v",
            "model": "TS004F",
            "output_clusters": [
                {
                    "id": 25,
                    "name": "Ota",
                    "attributes": []
                }
            ],
            "input_clusters": [
                {
                    "id": 0,
                    "name": "Basic",
                    "attributes": [
                        {
                            "id": 0,
                            "name": "zcl_version",
                            "value": 3
                        },
                        {
                            "id": 1,
                            "name": "app_version",
                            "value": 65
                        },
                        {
                            "id": 2,
                            "name": "stack_version",
                            "value": 0
                        },
                        {
                            "id": 3,
                            "name": "hw_version",
                            "value": 1
                        },
                        {
                            "id": 4,
                            "name": "manufacturer",
                            "value": "_TZ3000_xabckq1v"
                        },
                        {
                            "id": 5,
                            "name": "model",
                            "value": "TS004F"
                        },
                        {
                            "id": 7,
                            "name": "power_source",
                            "value": 3
                        }
                    ]
                },
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                },
                {
                    "id": 10,
                    "name": "Time",
                    "attributes": []
                }
            ]
        },
        {
            "id": 2,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 3,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 4,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        }
    ],
    "signature": {
        "manufacturer": "_TZ3000_xabckq1v",
        "model": "TS004F",
        "node_desc": {
            "logical_type": 2,
            "complex_descriptor_available": 0,
            "user_descriptor_available": 0,
            "reserved": 0,
            "aps_flags": 0,
            "frequency_band": 8,
            "mac_capability_flags": 128,
            "manufacturer_code": 4098,
            "maximum_buffer_size": 82,
            "maximum_incoming_transfer_size": 82,
            "server_mask": 11264,
            "maximum_outgoing_transfer_size": 82,
            "descriptor_capability_field": 0
        },
        "endpoints": {
            "1": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    0,
                    1,
                    6,
                    10
                ],
                "output_clusters": [
                    25
                ]
            },
            "2": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "3": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "4": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            }
        }
    },
    "class": "ts004f"
}

Déjà merci pour le boulot !!
Comme les autres posts avant moi, ça ne change rien non plus.
J’ai bien créé le fichier ts004f.py

J’ai aussi modifié le fichier de commande, j’ai ça dans mes commandes :

Et voici mes infos brutes :

{
    "ieee": "5c:02:72:ff:fe:fd:40:03",
    "nwk": 28987,
    "status": 2,
    "lqi": "152",
    "rssi": "-62",
    "last_seen": "1641935685.5568907",
    "node_descriptor": "02:40:80:02:10:52:52:00:00:2c:52:00:00",
    "endpoints": [
        {
            "id": 1,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": "_TZ3000_xabckq1v",
            "model": "TS004F",
            "output_clusters": [
                {
                    "id": 25,
                    "name": "Ota",
                    "attributes": []
                }
            ],
            "input_clusters": [
                {
                    "id": 0,
                    "name": "Basic",
                    "attributes": [
                        {
                            "id": 0,
                            "name": "zcl_version",
                            "value": 3
                        },
                        {
                            "id": 1,
                            "name": "app_version",
                            "value": 65
                        },
                        {
                            "id": 2,
                            "name": "stack_version",
                            "value": 0
                        },
                        {
                            "id": 3,
                            "name": "hw_version",
                            "value": 1
                        },
                        {
                            "id": 4,
                            "name": "manufacturer",
                            "value": "_TZ3000_xabckq1v"
                        },
                        {
                            "id": 5,
                            "name": "model",
                            "value": "TS004F"
                        },
                        {
                            "id": 6,
                            "name": "date_code",
                            "value": ""
                        },
                        {
                            "id": 7,
                            "name": "power_source",
                            "value": 3
                        }
                    ]
                },
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": [
                        {
                            "id": 32,
                            "name": "battery_voltage",
                            "value": 30
                        },
                        {
                            "id": 33,
                            "name": "battery_percentage_remaining",
                            "value": 200
                        }
                    ]
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                },
                {
                    "id": 10,
                    "name": "Time",
                    "attributes": []
                }
            ]
        },
        {
            "id": 2,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 3,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        },
        {
            "id": 4,
            "status": 1,
            "device_type": 6,
            "profile_id": 260,
            "manufacturer": null,
            "model": null,
            "output_clusters": [],
            "input_clusters": [
                {
                    "id": 1,
                    "name": "Power Configuration",
                    "attributes": []
                },
                {
                    "id": 6,
                    "name": "TS004X_cluster",
                    "attributes": []
                }
            ]
        }
    ],
    "signature": {
        "manufacturer": "_TZ3000_xabckq1v",
        "model": "TS004F",
        "node_desc": {
            "logical_type": 2,
            "complex_descriptor_available": 0,
            "user_descriptor_available": 0,
            "reserved": 0,
            "aps_flags": 0,
            "frequency_band": 8,
            "mac_capability_flags": 128,
            "manufacturer_code": 4098,
            "maximum_buffer_size": 82,
            "maximum_incoming_transfer_size": 82,
            "server_mask": 11264,
            "maximum_outgoing_transfer_size": 82,
            "descriptor_capability_field": 0
        },
        "endpoints": {
            "1": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    0,
                    1,
                    6,
                    10
                ],
                "output_clusters": [
                    25
                ]
            },
            "2": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "3": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            },
            "4": {
                "profile_id": 260,
                "device_type": 6,
                "input_clusters": [
                    1,
                    6
                ],
                "output_clusters": []
            }
        }
    },
    "class": "ts004f"
}

J’ai toujours que le bouton 1 qui fonctionne
Aucune log n’est tracée sur l’appui des autres boutons

Une question tout de même : quand je supprime l’interrupteur, je synchronise ensuite : il n’apparait plus. Si je refais une inclusion il me dit « un équipement a quitté le réseau » : pas sur qu’il soit réellement supprimé du coup…

Pour le supprimé réélement faut pas faire que comme ca.

Faut aller aussi dans reseau/ noeud et supprimé

Décidément … Apparemment il y a plusieurs modèle de ts004f.

Lors de mes recherches j’ai remarqué que certain avez un code différent.

Le mien vient de Zemistart et a pour code ESW-0ZBA-EU.

@Yohann74 @TonioMeyer
Pouvez-vous regarder au niveau de la pile, normalement vous devriez y trouver un code ressemblant au miens.
Sur les interrupteurs que je possède le code est juste au dessus de la pile au dessus d’un QRCode.
Postez la marque de vos interrupteurs et ce code, qu’on puisse comparer.