Code Monkey home page Code Monkey logo

Comments (2)

mkan1512 avatar mkan1512 commented on June 18, 2024

I start creating support for this device, can you please check and give feedback. When you think the implementation is correct, please merge.

  1. added in plugin.py
    from adapters.lumi.sensor_86sw1 import Sensor86Sw1
    and into the self.adapter_by_model = { part
    'WXKG03LM': Sensor86Sw1, # Xiaomi Aqara single key wireless wall switch

  2. add a new device push_on_button.py in the devices folder with the code

import Domoticz
from devices.device import Device
class PushOnButton(Device):
    def create_device(self, unit, device_id, device_name, message):
        return Domoticz.Device(Unit=unit, DeviceID=device_id, Name=device_name, Type=244, subtype=73, Switchtype=9).Create()
    def get_numeric_value(self, value, device):
        return 1 if value.lower() == 'single' else 0
    def get_string_value(self, value, device):
        return 'On' if value.lower() == 'single' else 'Off'
  1. add a new adapter sensor_86sw1.py in teh adapters/lumi folder with the code
import Domoticz
from adapters.base_adapter import Adapter
from devices.push_on_button import PushOnButton

class Sensor86Sw1(Adapter):
    def __init__(self, devices):
        super().__init__(devices)
        self.devices.append(PushOnButton(devices, 'switch', 'click'))

This will create a switch of the sub-type Push On Button.
I found one strang behavior, the off-delay of this created devices is not working.
In the log, I only see on values
When I created the same type by a dummy-hardware, the off-delay is working?

from domoticz-zigbee2mqtt-plugin.

stas-demydiuk avatar stas-demydiuk commented on June 18, 2024

@mkan1512 support for this device was added in v0.0.9 of plugin, could you please check

from domoticz-zigbee2mqtt-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.