Hi Tore,
I have an almost identical device, a Develco MEIZH-061. I have gone through the documentation for it and changed only a few things. However I am not able to get it to show anything important.
The two tecnical docs here for comparing:
With this code I manage to add the device but only with the classic mobile app, not the new one.
When connected however the “thing” is showing “please wait” in the classic app, and connected but no activity in the new app.
I hope you can point me in the right direction on this one.
Here is my full code, which is the same as your code, with a few minor changes:
**
*/
metadata {
definition (name: “Develco MEIZH-061 Device Handler”, namespace: “02dag”, author: “Testing”, mnmn: “Testing”, vid: “Testing”) {
capability “Energy Meter”
capability “Power Meter”
capability “Refresh”
capability “Health Check”
capability “Sensor”
capability “Configuration”
fingerprint profileId: "0104", deviceId:"0053", inClusters: "0000, 0003, 0004, FC00, 0702", outClusters: "0019", manufacturer: "Develco Products A/S", model: "“MEIZH-061", deviceJoinName: ""
}
// tile definitions
tiles(scale: 2) {
multiAttributeTile(name:"power", type: "generic", width: 6, height: 4){
tileAttribute("device.power", key: "PRIMARY_CONTROL") {
attributeState("default", label:'${currentValue} W')
}
tileAttribute("device.energy", key: "SECONDARY_CONTROL") {
attributeState("default", label:'${currentValue} kWh')
}
}
standardTile("RMSVoltagePhA", "device.RMSVoltagePhA", inactiveLabel: false, decoration: "flat", width: 3, height: 1) {
state "default", label:'Voltage A: ${currentValue} V'
}
standardTile("RMSCurrentPhA", "device.RMSCurrentPhA", inactiveLabel: false, decoration: "flat", width: 3, height: 1) {
state "default", label:'Current A: ${currentValue} A'
}
standardTile("RMSVoltagePhB", "device.RMSVoltagePhB", inactiveLabel: false, decoration: "flat", width: 3, height: 1) {
state "default", label:'Voltage B: ${currentValue} V'
}
standardTile("RMSCurrentPhB", "device.RMSCurrentPhB", inactiveLabel: false, decoration: "flat", width: 3, height: 1) {
state "default", label:'Current B: ${currentValue} A'
}
standardTile("RMSVoltagePhC", "device.RMSVoltagePhC", inactiveLabel: false, decoration: "flat", width: 3, height: 1) {
state "default", label:'Voltage C: ${currentValue} V'
}
standardTile("RMSCurrentPhC", "device.RMSCurrentPhC", inactiveLabel: false, decoration: "flat", width: 3, height: 1) {
state "default", label:'Current C: ${currentValue} A'
}
/*standardTile("reset", "device.energy", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "default", label:'reset kWh', action:"reset"
}*/
standardTile("refresh", "device.power", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
}
main (["power", "energy"])
details(["power", "energy","RMSVoltagePhA","RMSCurrentPhA","RMSVoltagePhB", "RMSCurrentPhB","RMSVoltagePhC", "RMSCurrentPhC", "refresh"])
}
}
def parse(String description) {
// log.debug “description is $description”
def descMap = zigbee.parseDescriptionAsMap(description)
if(descMap) {
List result = []
List attrData = [[cluster: descMap.cluster ,attrId: descMap.attrId, value: descMap.value]]
descMap.additionalAttrs.each {
attrData << [cluster: descMap.cluster, attrId: it.attrId, value: it.value]
}
attrData.each {
def map = [:]
// log.debug "ClusterId: ${it.cluster} AttributeId: ${it.attrId} Value: ${it.value}"
if (it.cluster == "FC00" && it.attrId == "03FF") {
log.debug "Power Value: ${zigbee.convertHexToInt(it.value)/1000}"
map.name = "power"
map.value = zigbee.convertHexToInt(it.value)/1000
map.unit = "W"
}
if (it.cluster == "0702" && it.attrId == "0000") {
log.debug "Energy Value: ${zigbee.convertHexToInt(it.value)}"
map.name = "energy"
map.value = zigbee.convertHexToInt(it.value)/1000
map.unit = "kWh"
}
if (it.cluster == "FC00" && it.attrId == "041E") {
log.debug "RMSVoltagePhA Value: ${zigbee.convertHexToInt(it.value)}"
map.name = "RMSVoltagePhA"
map.value = zigbee.convertHexToInt(it.value)
map.unit = "V"
}
if (it.cluster == "FC00" && it.attrId == "0434") {
log.debug "RMSCurrentPhA Value: ${zigbee.convertHexToInt(it.value)}"
map.name = "RMSCurrentPhA"
map.value = zigbee.convertHexToInt(it.value)
map.unit = "A"
}
if (it.cluster == "FC00" && it.attrId == "041F") {
log.debug "RMSVoltagePhB Value: ${zigbee.convertHexToInt(it.value)}"
map.name = "RMSVoltagePhB"
map.value = zigbee.convertHexToInt(it.value)
map.unit = "V"
}
if (it.cluster == "FC00" && it.attrId == "0435") {
log.debug "RMSCurrentPhB Value: ${zigbee.convertHexToInt(it.value)}"
map.name = "RMSCurrentPhB"
map.value = zigbee.convertHexToInt(it.value)
map.unit = "A"
}
if (it.cluster == "FC00" && it.attrId == "0420") {
log.debug "RMSVoltagePhC Value: ${zigbee.convertHexToInt(it.value)}"
map.name = "RMSVoltagePhC"
map.value = zigbee.convertHexToInt(it.value)
map.unit = "V"
}
if (it.cluster == "FC00" && it.attrId == "0436") {
log.debug "RMSCurrentPhC Value: ${zigbee.convertHexToInt(it.value)}"
map.name = "RMSCurrentPhC"
map.value = zigbee.convertHexToInt(it.value)
map.unit = "A"
}
if (map) {
result << createEvent(map)
}
//log.debug "Parse returned $map"
}
return result
}
}
/**
- PING is used by Device-Watch in attempt to reach the Device
- */
def ping() {
return refresh()
}
def refresh() {
log.debug "refresh "
zigbee.electricMeasurementPowerRefresh() +
zigbee.simpleMeteringPowerRefresh()
}
def configure() {
// this device will send instantaneous demand and current summation delivered every 1 minute
sendEvent(name: “checkInterval”, value: 2 * 60 + 10 * 60, displayed: false, data: [protocol: “zigbee”, hubHardwareId: device.hub.hardwareID])
log.debug "Configuring Reporting"
return refresh() +
zigbee.simpleMeteringPowerConfig() +
zigbee.electricMeasurementPowerConfig()
}