stas-demydiuk / domoticz-zigbee2mqtt-plugin

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

`Centralite 3400-D` keypad device support #789

Closed WollyWonka closed 1 year ago

WollyWonka commented 2 years ago

Feature description Centralite 3-Series security keypad

Feature definition {"action":"disarm","action_code":"123456","action_transaction":73,"action_zone":0,"battery":100,"linkquality":83,"occupancy":true,"temperature":13.47,"voltage":3100} "action" could be "disarm" or "arm_all_zones"

Related Devices Insert the device page link on zigbee2mqtt.io that supports (exposes) that feature

Example: https://www.zigbee2mqtt.io/devices/3400-D.html#centralite-3400-d

Only the features "action_code":"123456", "action_transaction":73 and "action_zone":0 are not available. Yhe other features are handle by the generic adapter features. Domoticz debug log: 2022-02-13 13:56:35.110 Error: Zigbee2MQTT: Keypad (Alarm): can not process numeric item "action_code" 2022-02-13 13:56:35.110 Error: Zigbee2MQTT: Keypad (Alarm): can not process numeric item "action_transaction"

I've tried to create an adapter in a new folder "centralite" by myself but that doesn't work yet:

init.py

from adapters.adapter_with_battery import AdapterWithBattery
from adapters.base_adapter import Adapter

centralite_adapters = {
        'Keypad3400D' = KP3400D,  #Centralite 3400-D Keypad
        }

KP3400D.py

import json
from adapters.adapter_with_battery import AdapterWithBattery
from adapters.base_adapter import Adapter
from devices.custom_sensor import CustomSensor

class KP3400D(Adapter):
    def __init__(self):
        super().__init__()
        self.devices.append(CustomSensor('actcode', 'action_code', '(Action Code)'))
        self.devices.append(CustomSensor('acttrans', 'action_transaction', ' (Action Transaction)'))

        return message
}

Dear Stanislav, (or anybody else) could you point me towards the right direction of fixing this code, or are you able to add these features on a different way. Many thanks in advance, WW

stas-demydiuk commented 1 year ago

Could you please update the plugin to the latest version from the master branch and verify that everything works as expected?

WollyWonka commented 1 year ago

Hi Stanislav, Yes, it appears to work. Codes I press on the keypad are now send to Domoticz and can be used/processed. Thanks for the effort! Regards, WollyWonka

stale[bot] commented 1 year 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.