Bonsoir,
Merci pour le message d'accueil
J'ai un peu avancé : suppression du dispositif, nouvel appairage qui s'est bien passé.
Le bouton apparaît dans la liste des dispositifs.
Dans l'écran des Switchs, c'est un "Selector" avec quatre niveaux : Arrêt (niveau 0), Click (niveau 20), Double Click (30) et Long Click (40).
Rappel : j'ai décrit la configuration dans mon message initial.
Voici ce qu'affirme l'Api Json pour les devices :
Pour le plugin Zigate :
Code : Tout sélectionner
{
"ActTime" : 1646136326,
"AstrTwilightEnd" : "20:20",
"AstrTwilightStart" : "05:45",
" AivTwilightEnd" : "19:04",
" CivTwilightStart" : "07:01",
"DayLength" : "10:56",
"NautTwilightEnd" : "19:42",
"NautTwilightStart" : "06:23",
"ServerTime" : "2022-03-01 13:05:26",
"SunAtSouth" : "13:02",
"Sunrise" : "07:34",
"Sunset" : "18:31",
"app_version" : "2022.1",
"result" : [ {
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "Ready",
"Description" : "",
"Favorite" : 0,
"HardwareDisabled" : false,
"HardwareID" : 3,
"HardwareName" :
"PluginZigate",
"HardwareType" : "Zigate plugin",
"HardwareTypeVal" : 94,
"HaveTimeout" : false,
"ID" : "Zigate-02- 3",
"LastUpdate" : "2022-03-01 12:06:14",
"Level" : 1,
"Name" : "PluginZigate - Zigate Status 3",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" :
[ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Alert",
"Timers" : "false",
"Type" : "General",
"TypeImg" : "Alert",
"Unit" : 1,
"Used" : 0,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "1" },
{ "AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "Reconnect PluginZigate - WB01_Button_3-00124b0022e9601f-01 with e64b/00124b0022e9601f",
"Description" : "",
"Favorite" : 0,
"HardwareDisabled" : false,
"HardwareID" : 3,
"HardwareName" : "PluginZigate",
"HardwareType" : "Zigate plugin",
"HardwareTypeVal" : 94,
"HaveTimeout" : false,
"ID" : "Zigate-03- 3",
"LastUpdate" : "2022-03-01 12:08:46",
"Name" : "PluginZigate - Zigate Notifications 3",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : false,
"SignalLevel" : "-",
"SubType" : "Text",
"Timers" : "false",
"Type" : "General",
"TypeImg" : "text",
"Unit" : 2,
"Used" : 0,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "2" },
Je n'ai pas mis les autres dispositifs, mais voici le nouveau bouton :
Code : Tout sélectionner
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 100,
"CustomImage" : 0,
"Data" : "Off",
"Description" : "",
"DimmerType" : "none",
"Favorite" : 0,
"HardwareDisabled" : false,
"HardwareID" : 3,
"HardwareName" : "PluginZigate",
"HardwareType" : "Zigate plugin",
"HardwareTypeVal" : 94,
"HaveDimmer" : true,
"HaveGroupCmd" : true,
"HaveTimeout" : false,
"ID" : "00124b0022e9601f",
"Image" : "Light",
"IsSubDevice" : false,
"LastUpdate" : "2022-03-01 15:53:33",
"Level" : 0,
"LevelActions" : "fHx8",
"LevelInt" : 0,
"LevelNames" : "QXJyw6p0fENsaWNrfERvdWJsZSBDbGlja3xMb25nIENsaWNr",
"LevelOffHidden" : false,
"MaxDimLevel" : 100,
"Name" : "Sonoff_WB01Bouton",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"SelectorStyle" : 1,
"ShowNotifications" : true,
"SignalLevel" : 9,
"Status" : "Off",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "Selector Switch",
"SwitchType" : "Selector",
"SwitchTypeVal" : 18,
"Timers" : "false",
"Type" : "Light/Switch",
"TypeImg" : "Light",
"Unit" : 28,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "48" }
],
"status" : "OK",
"title" : "Devices" }
Si j'appuie sur le bouton physique, il ne se passe rien dans le journal (Log) .
Si je passe par le dispositif, dans l'écran des Switches, je peux choisir
Click,
Double ou
Long dans une liste.
L'interface graphique affiche ce que j'ai choisi, mais dans le log, j'ai ce message :
Code : Tout sélectionner
22-03-01 18:13:11.193 Status: User: Admin (IP: 192.168.1.49) initiated a switch command (48/Sonoff_WB01Bouton/Set Level)
2022-03-01 18:13:11.221 PluginZigate: mgtCommand - You are trying to action not allowed for Device: Sonoff_WB01Bouton
Type: [('01', '48', 'Button_3')] and DeviceType: Button_3 Command: Set Level Level:20
Qu'est ce qui se passe ?
Comment je peux corriger ça ?mment puis je récupérer la valeur dans un script lua ?