Hi,
Can you please try the DTH recommended by this movie:
It is in Portuguese but you can easily translate to English
Hi,
Can you please try the DTH recommended by this movie:
It is in Portuguese but you can easily translate to English
@dotan_shai I actually speak portuguese and can understand the video. I followed all of the steps and got to see the device but for some reason it does not seem to capture the button activity. Some people are saying there is a newer version (apparently the one I have) that is not very friendly with ST. I would really appreciate the help as I really like the devices and are also priced competitively.
Cheers, Martin
Read here.
seems there is a page with many handler for Zemismart. Try it:
https://www.zemismart.com/pages/zigbee-handler-download-38
Iâve just ordered the non-touch version of these Moes switches:
Does anyone know if @ygerlovin DTH will work with these? The references made on the bitbucket repo seems to just be for the touch versions, but maybe theyâre all the same inside?
Thanks
Add your Zbjoin⊠If it contains EF00 , good chance it will be supported.
Please note that No Neutral module will be consider as a SLEEPY_DEVICE and not as ROUTER.
Hi
I have adapted this DTH for a Tuya water valve (_TZE200_akjefhj5), and got it working.
However - Iâm looking for help for 2 things -
It looks like Alexa canât do open / close the valve, so I tried to add Switch capabilities to it to turn it on/off. (Iâm not a developer and fudging my way through this).
I got a Switch to kind of work⊠In Alexa the switch can turn on (opening the valve), but turns off straight away (and leaves the valve open). The switch canât hold itâs state.
Similarly, using the device as a switch in Sharptools does work, so Iâm close, but not working correctly. (The switch appears to stay on in Sharptools, but refreshing the page shows it goes Off shortly after being turned on)
Using the Tuya gateway, the device does report battery percentage. I would like to try and bring this into the DTH if possible.
Data * application: 55
This is what Iâve got so far -
/*
* Moes ZigBee Switch
*
* Copyright 2020 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy
* of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
*/
public static String version() { return "v0.0.1.20210727" }
private getMODEL_MAP() {
[
'TS0601' : 3
]
}
metadata {
definition(name: "Moes ZigBee Switch", namespace: "Moes", author: "Kotsos", ocfDeviceType: "oic.d.watervalve", vid: "generic-valve") {
capability "Actuator"
capability "Configuration"
capability "Refresh"
capability "Health Check"
capability "Valve"
capability "Battery"
capability "Switch"
command "childOn", ["string"]
command "childOff", ["string"]
fingerprint profileId: "0104", model: "TS0601", manufacturer: "_TZE200_akjefhj5", endpointId: "01", inClusters: "0000,0004,0005,EF00", outClusters: "0019,000A", application: "55", deviceJoinName: "Tuya Valve CSF"
}
}
// Parse incoming device messages to generate events
def parse(String description) {
Map map = [:]
//def event = zigbee.getEvent(description)
if (description?.startsWith('catchall:')) {
log.debug description
// call parseCatchAllMessage to parse the catchall message received
map = parseCatchAllMessage(description)
if (map != [:]) {
log.debug "ok send event: $map.name : $map.value"
sendEvent(name: map.name, value: map.value)
}
}
else {
log.warn "DID NOT PARSE MESSAGE for description : $description"
}
}
def close() {
log.debug "called closed"
zigbee.command(0xEF00, 0x0, "00010101000100")
}
def open() {
log.debug "called open"
zigbee.command(0xEF00, 0x0, "00010101000101")
}
def off() {
log.debug "called off"
zigbee.command(0xEF00, 0x0, "00010101000100")
}
def on() {
log.debug "called on"
zigbee.command(0xEF00, 0x0, "00010101000101")
}
//def setLevel(value) {
// log.debug "called setLevel with value $value"
// if (value >= 0 && value <= 100) {
// //String commandValue = "0001020200040000" + zigbee.convertToHexString((value * 10) as Integer, 4)
// Map commandParams = [:]
// String commandPayload = "0001020200040000" + zigbee.convertToHexString((value * 10) as Integer, 4)
// zigbee.command(0xEF00, 0x0, commandPayload)
// }
// }
def refresh() {
log.debug "called refresh"
zigbee.command(0xEF00, 0x0, "00020100")
//pauseExecution(1000)
//zigbee.command(0xEF00, 0x0, "0002020200")
}
def configure() {
log.debug "Configuring Reporting and Bindings."
zigbee.onOffConfig() + zigbee.levelConfig() + zigbee.onOffRefresh() + zigbee.levelRefresh()
}
private Map parseCatchAllMessage(String description) {
// Create a map from the raw zigbee message to make parsing more intuitive
def msg = zigbee.parse(description)
Map result = [:]
switch(msg.clusterId) {
case 0xEF00:
def attribute = getAttribute(msg.data)
def value = getAttributeValue(msg.data)
switch (attribute) {
case "valve":
switch(value) {
case 0:
result = [
name: 'valve',
value: 'closed',
data: [buttonNumber: 1],
descriptionText: "$device.displayName button was pressed",
isStateChange: true
]
break;
case 1:
result = [
name: 'valve',
value: 'open',
data: [buttonNumber: 1],
descriptionText: "$device.displayName button was pressed",
isStateChange: true
]
break;
}
break;
}
break;
}
return result
}
private String getAttribute(ArrayList _data) {
String retValue = ""
if (_data.size() >= 5) {
if (_data[2] == 1 && _data[3] == 1 && _data[4] == 0) {
retValue = "valve"
}
else if (_data[2] == 2 && _data[3] == 2 && _data[4] == 0) {
retValue = "level"
}
}
return retValue
}
private int getAttributeValue(ArrayList _data) {
int retValue = 0
if (_data.size() >= 6) {
int dataLength = _data[5] as Integer
int power = 1;
for (i in dataLength..1) {
retValue = retValue + power * _data[i+5]
power = power * 256
}
}
return retValue
}
Any help in furthering this would be appreciated.
Thanks
Hi @Hendo25 ,
I would suggest to open a separate thread for this.
Regarding the switch, I think the problem is that switch state is not updated when you update the state of valve capability.
parseCatchAllMessage should update both states, i.e either the result should contain 2 entries, one for valve, another for switch or you can issue sendEvent command after or before assigning result value.
For battery, it is needed to understand how the values are reported. I would suggest to take a look at the log to see what messages are received in parse method.
Also, you are parsing only catchall calls, that means some device reporting is ignored.
As a side note, on/open and off/close have duplicated code. It is better just call open() from inside on(). Similar for off()
Hi all,
Iâm wondering whether edge driver for Moes wall switches would be of interest to community.
The edge driver would have several benefits, compared to DTH
However, it will not be able to create child devices. This could be worked around with virtual switches, but it would be needed to do it manually.
Please leave your comments/concerns below.
Thanks
Hi,
Iâm trying to use this DTH on a 2-gang Moes switch.
Here is the zbjoin event:
zbjoin: {âdniâ:â82C2â,âdâ:â5C0272FFFE225827â,âcapabilitiesâ:â80â,âendpointsâ:[{âsimpleâ:â01 0104 0051 01 04 0000 0004 0005 EF00 02 0019 000Aâ,âapplicationâ:â42â,âmanufacturerâ:"_TZE200_g1ib5ldv",âmodelâ:âTS0601â}],âparentâ:0,âjoinTypeâ:0,âjoinDurationMsâ:1350,âjoinAttemptsâ:1}
The device type is updated correctly to the TS0601 parent and the two child devices are created.
But the switch doesnât work when operating in ST (just spins forever and the switch doesnât operate).
Here is the log when clicking a switch in ST:
25d2ae45-37c6-4062-ad29-fd4b5110592a 17:18:10: debug sendCommandsToDevice(): delay=300 cmds=[st cmd 0x82C2 0x01 0xEF00 0x00 {00040101000100}, delay 2000] actions=[st cmd 0x82C2 0x01 0xEF00 0x00 {00040101000100}, delay 2000]
25d2ae45-37c6-4062-ad29-fd4b5110592a 17:18:10: debug childOnOff(): endPoint=1 turnOn=false cmds=[st cmd 0x82C2 0x01 0xEF00 0x00 {00040101000100}, delay 2000]
25d2ae45-37c6-4062-ad29-fd4b5110592a 17:18:10: debug createTuyaCommand(): dp=01 type=01 len=0001 value=00 â cmd=[st cmd 0x82C2 0x01 0xEF00 0x00 {00040101000100}, delay 2000]
25d2ae45-37c6-4062-ad29-fd4b5110592a 17:18:10: debug child off: [label:Moes 2 gang switch-SW1, deviceNetworkId:82C2-SW1] parent=[name:Moes 2 gang switch]
It also shows as a SLEEPY_END_DEVICE even though I have the neutral wire plugged in.
Can anyone help please?
@venomizer
Hi,
The log contains only commands sent to device, no responses from the device. Is it a complete log or you truncated it?
Have you tried to remove the parent device and to add it again?
Yes Iâve reset the switch and re-paired it a couple of times. Itâs instantly recognised by your device handler but then just doesnât work.
Should the switch be showing as a router? Is there any way I can force this?
That log is complete, clearly the commands arenât being received by the switch, just not sure why
@venomizer Are you sure you have a version that requires a neutral wire? Usually, sleepy device is a no neutral version (or a battery powered device). Plugs/switches with neutral wire should be routers.
What do you see in IDE in âCurrent Statesâ?
Definitely a version that requires neutral wire, and I have it plugged in.
Current states on the parent device shows:
sw1Name: Moes 2 gang switch-SW1
sw2Switch:
sw1Switch:
Info:
sw2Name: Moes 2 gang switch-SW2
@venomizer
The empty states would suggest that DTH did not receive any responses from the device.
Do you have any other devices under this DTH?
Would it be possible to provide a complete log that captures adding the device?
The steps to do it are:
Thanks
No other devices under this DTH.
Here is the log after following your steps:
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:16: info parse(): description is âread attr - raw: 82C201EF000A0000002000, dni: 82C2, endpoint: 01, cluster: EF00, size: 10, attrId: 0000, result: success, encoding: 20, value: 00â descMap is [raw:82C201EF000A0000002000, dni:82C2, endpoint:01, cluster:EF00, size:10, attrId:0000, result:success, encoding:20, value:00, isValidForDataType:true, clusterInt:61184, attrInt:0]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00260F04000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00260F04000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 26, 0F, 04, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: debug handleSwitchEvent(): EP=2 value=0 children=[0, 0, 0, 0, 0, 0] main=0
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00240201000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00240201000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 24, 02, 01, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00210E04000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00210E04000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 21, 0E, 04, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 24 01 0017â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 24 01 0017, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:24, direction:01, data:[00, 17], clusterInt:61184, commandInt:36]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: debug handleSwitchEvent(): EP=1 value=0 children=[0, 0, 0, 0, 0, 0] main=0
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00230101000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00230101000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 23, 01, 01, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: debug handleSwitchEvent(): EP=2 value=0 children=[0, 0, 0, 0, 0, 0] main=0
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00200201000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00200201000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 20, 02, 01, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:15: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00220F04000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00220F04000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 22, 0F, 04, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:14: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00250E04000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 00250E04000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 25, 0E, 04, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:14: debug handleSwitchEvent(): EP=1 value=0 children=[0, 0, 0, 0, 0, 0] main=0
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:14: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001F0101000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001F0101000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 1F, 01, 01, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:14: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001E0F04000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001E0F04000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 1E, 0F, 04, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:14: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001D0E04000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001D0E04000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 1D, 0E, 04, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:14: debug handleSwitchEvent(): EP=1 value=0 children=[0, 0, 0, 0, 0, 0] main=0
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:14: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001B0101000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001B0101000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 1B, 01, 01, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:13: debug handleSwitchEvent(): EP=2 value=0 children=[0, 0, 0, 0, 0, 0] main=0
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:13: info parse(): description is âcatchall: 0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001C0201000100â descMap is [raw:0104 EF00 01 01 0000 00 82C2 01 00 0000 01 01 001C0201000100, profileId:0104, clusterId:EF00, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[00, 1C, 02, 01, 00, 01, 00], clusterInt:61184, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:12: info parse(): description is âcatchall: 0104 0006 01 01 0000 00 82C2 00 00 0000 01 01 000086â descMap is [raw:0104 0006 01 01 0000 00 82C2 00 00 0000 01 01 000086, profileId:0104, clusterId:0006, sourceEndpoint:01, destinationEndpoint:01, options:0000, messageType:00, dni:82C2, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, attrId:0000, resultCode:86, data:[00, 00, 86], clusterInt:6, attrInt:0, commandInt:1]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:11: debug refresh()âŠ
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:11: debug child refresh: Moes 2 gang switch-SW2
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:11: debug child refresh: Moes 2 gang switch-SW1
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug childUpdated: Moes 2 gang switch-SW2 vs null
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug childUpdated(82C2-SW2) for device=[label:null, deviceNetworkId:82C2]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug Creating SW2 Child Device device=Moes 2 gang switch
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug childUpdated: Moes 2 gang switch-SW1 vs null
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug childUpdated(82C2-SW1) for device=[label:null, deviceNetworkId:82C2]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug Creating SW1 Child Device device=Moes 2 gang switch
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug updateChildrenDNI()⊠children=0
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug createRemoveChildDevices()⊠gangs=2 children=0 device=[label:null, deviceNetworkId:82C2]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug installed()⊠DeviceId : 0b012add-f894-48c7-8c87-a115409cf6f7, 82C2 manufacturer: _TZE200_g1ib5ldv, model: TS0601 settings=[:]
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug child installed: Moes 2 gang switch-SW2
0b012add-f894-48c7-8c87-a115409cf6f7 16:51:10: debug child installed: Moes 2 gang switch-SW1
Weirdly Iâve just pulled it out to check the neutral was definitely attached (it was, and I measured full voltage across the live and neutral), but when I switched it back on itâs suddenly working now from ST.
Itâs still showing as a SLEEPY_END_DEVICE but commands are now getting to itâŠ
@venomizer
The provided log shows the device is responding to configuration commands. However, the responses look slightly different.
Perhaps, MOES upgraded the firmware or may be they are reusing the fingerprints for several different models.
I think Iâve seen in some forum that some Moes devices incorrectly reports as sleepy. I would guess, they are also can not serve as routers.
Unfortunately, fixing it require device firmware changes. There is nothing can be done in DTH to fix that
Hi,
A question to all owners of Moes switches/relays.
What would be better in your opinion:
Also, are you using switches/relays from multiple vendors or prefer to stick to a single one?
Thanks
A driver per each device will be great. Option 2. Iâm using multiple vendors and multiple protocols (zigbee and zwave)
Hello Yakov,
I also think that a driver per each type would be better to avoid maintaining a big library with tons of products. But of course, you know better which way is easier to develop and maintain. Just my humble opinion.
Once again thank you for helping all of us to get the edge driver. This will deeply enhance our home automations once is running locally.