Re: Bug Aqara WXKG01LM
Publié : 10 janv. 2023, 21:48
SI j'appaire le boutton et que je regarde ce qu'il génère comme evenement avec dzVent, j'ai bien
- One click - Level 0
- Two clicks - Level 10
- Tree clicks - Level 20
Voici le code du scipt dzVent utilisé
- One click - Level 0
- Two clicks - Level 10
- Tree clicks - Level 20
Code : Tout sélectionner
Jan 10 21:47:12 rasp jemalloc.sh[26121]: 2023-01-10 21:47:12.117 Zigpy SonOff: UpdateDevice - (Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01) 0:00
Jan 10 21:47:12 rasp jemalloc.sh[26121]: 2023-01-10 21:47:12.282 Status: dzVents: Info: Handling events for: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01", value: "One click"
Jan 10 21:47:12 rasp jemalloc.sh[26121]: 2023-01-10 21:47:12.283 Status: dzVents: Info: ------ Start external script: switch.lua: Device: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 (Zigpy SonOff)", Index: 1
Jan 10 21:47:12 rasp jemalloc.sh[26121]: 2023-01-10 21:47:12.283 Status: dzVents: Info: state of Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 .. Level 0 LastUpdate 4
Jan 10 21:47:12 rasp jemalloc.sh[26121]: 2023-01-10 21:47:12.283 Status: dzVents: Info: ------ Finished switch.lua
Jan 10 21:47:19 rasp jemalloc.sh[26121]: 2023-01-10 21:47:19.353 Zigpy SonOff: UpdateDevice - (Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01) 1:10
Jan 10 21:47:19 rasp jemalloc.sh[26121]: 2023-01-10 21:47:19.506 Status: dzVents: Info: Handling events for: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01", value: "Two clicks"
Jan 10 21:47:19 rasp jemalloc.sh[26121]: 2023-01-10 21:47:19.506 Status: dzVents: Info: ------ Start external script: switch.lua: Device: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 (Zigpy SonOff)", Index: 1
Jan 10 21:47:19 rasp jemalloc.sh[26121]: 2023-01-10 21:47:19.506 Status: dzVents: Info: state of Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 .. Level 10 LastUpdate 0
Jan 10 21:47:19 rasp jemalloc.sh[26121]: 2023-01-10 21:47:19.506 Status: dzVents: Info: ------ Finished switch.lua
Jan 10 21:47:22 rasp jemalloc.sh[26121]: 2023-01-10 21:47:22.347 Zigpy SonOff: UpdateDevice - (Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01) 1:10
Jan 10 21:47:22 rasp jemalloc.sh[26121]: 2023-01-10 21:47:22.491 Status: dzVents: Info: Handling events for: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01", value: "Two clicks"
Jan 10 21:47:22 rasp jemalloc.sh[26121]: 2023-01-10 21:47:22.491 Status: dzVents: Info: ------ Start external script: switch.lua: Device: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 (Zigpy SonOff)", Index: 1
Jan 10 21:47:22 rasp jemalloc.sh[26121]: 2023-01-10 21:47:22.492 Status: dzVents: Info: state of Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 .. Level 10 LastUpdate 0
Jan 10 21:47:22 rasp jemalloc.sh[26121]: 2023-01-10 21:47:22.492 Status: dzVents: Info: ------ Finished switch.lua
Jan 10 21:47:24 rasp jemalloc.sh[26121]: 2023-01-10 21:47:24.239 Zigpy SonOff: UpdateDevice - (Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01) 2:20
Jan 10 21:47:24 rasp jemalloc.sh[26121]: 2023-01-10 21:47:24.388 Status: dzVents: Info: Handling events for: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01", value: "Tree clicks"
Jan 10 21:47:24 rasp jemalloc.sh[26121]: 2023-01-10 21:47:24.388 Status: dzVents: Info: ------ Start external script: switch.lua: Device: "Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 (Zigpy SonOff)", Index: 1
Jan 10 21:47:24 rasp jemalloc.sh[26121]: 2023-01-10 21:47:24.389 Status: dzVents: Info: state of Zigpy SonOff - lumi.sensor_switch_SwitchAQ2-00158d000323dabe-01 .. Level 20 LastUpdate 0
Jan 10 21:47:24 rasp jemalloc.sh[26121]: 2023-01-10 21:47:24.389 Status: dzVents: Info: ------ Finished switch.lua
Voici le code du scipt dzVent utilisé
Code : Tout sélectionner
return {
active = true,
on = { devices = { 1 }}, -- idx of button
execute = function(dz, item )
dz.log("state of " .. item.name .. " .. Level " .. item.level .. " LastUpdate " .. item.lastUpdate.minutesAgo)
end
}