[ST Edge] Using Switch Edge driver as a reference

Where can I find a normal Switch Edge Driver for reference? It is required to have the same display effect as the traditional drive.
I have tried the diver.
But the device is alway in checking…
And I can not change the switch status when I click the switch.

This is the simplest driver that can be made.

local capabilities = require "st.capabilities"
local ZigbeeDriver = require "st.zigbee"
local defaults = require "st.zigbee.defaults"
local zcl_clusters = require "st.zigbee.zcl.clusters"

local zigbee_switch_driver_template = {
  supported_capabilities = {
    capabilities.switch,
    capabilities.refresh
  },
}
-- run driver
defaults.register_for_default_handlers(zigbee_switch_driver_template, zigbee_switch_driver_template.supported_capabilities)
local zigbee_switch = ZigbeeDriver("Zigbee_Switch", zigbee_switch_driver_template)
zigbee_switch:run()

It uses the default libraries and it works perfectly if it is a zigbee switch that has the manufacturer and model in the finger print and uses the cluster on-off (0x0006) it should work.

I have had these 5 different switches or plugs working with it

  - id: "LIDL Plug/TS011F"
    deviceLabel: Lidl Plug
    manufacturer: _TZ3000_kdi2o9m6
    model: TS011F
    deviceProfileName: single-switch-plug
  - id: "MOES/MS-104Z"
    deviceLabel: Moes Switch
    manufacturer: _TZ3000_zmy1waw6
    model: TS011F
    deviceProfileName: single-switch
  - id: "SAMOTECH/MS-104Z"
    deviceLabel: Samotech Switch
    manufacturer: _TYZB01_iuepbmpv
    model: TS0121
    deviceProfileName: single-switch
  - id: "3A SMart/Switch"
    deviceLabel: 3A SMart Switch
    manufacturer: 3A SMart Home DE
    model: LXN56-LC27LX1.3
    deviceProfileName: single-switch    
  - id: "eWeLink/Switch"
    deviceLabel: eWeLink Plug
    manufacturer: eWeLink
    model: SA-003-Zigbee
    deviceProfileName: single-switch-plug

I apologize for my comment! I modified this driver for that I just only have Zwave device:

local capabilities = require “st.capabilities”
local ZwaveDriver = require “st.zwave.driver”
local defaults = require “st.zwave.defaults”

local zwave_switch_driver_template = {
supported_capabilities = {
capabilities.switch,
capabilities.refresh
},
lifecycle_handlers = {
},
}
– run driver
defaults.register_for_default_handlers(zwave_switch_driver_template, zwave_switch_driver_template.supported_capabilities)
local zwave_switch = ZwaveDriver(“Zwave Switch”, zwave_switch_driver_template)
zwave_switch:run()

My device can be installed the driver correctly and the preferences is showed normally.
However, the status of the Switch (online status and switch status) cannot be read, and there is no corresponding change in the Switch after the interface operation.

Maybe this driver cannot be adapted to Zwave devices after such a modification.

No problem, I did not feel alluded to.

Does the logcat give any error?
I think you are missing a - in --run driver

Mariano_Colmenarejo:

Thank a lot!

No any error was reported.

"I think you are missing a - in --run driver" --Where I shuold add "- in --run driver"?

I borrowed a Zigbee Switch from my friend, and after adding it’s fingerprint to fingerprints.yml, it worked well.
In other words, if the interface functions of ZWave are directly replaced on the basis of this program, it does not work normally.

I found the reason. I made a low-level mistake. The permissions setting in config.yml was wrong. It should be zwave.

1 Like