GE (alias Jasco) 45856 wall switch

Hi,

I just integrated a GE45856 wall switch with energy metering in my network (buying link).
image

The actual code seems to have it working quite fine but the power that seems to keep to zero value.

So I wanted to generate an DDF file to have it fully supported but the DDF generated by Deconz-GUI editor seems weird to me I and need some help because I never had to deal with some “groupcast” bindings before, nor “state/buttonevent” attributes.

Then need some help to understand all of that. Especially since on the Domoticz side it creates a device which usefullnes seems to be based on buttonevent.

image

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Jasco Products",
  "modelid": "45856",
  "product": "45856",
  "sleeper": false,
  "status": "Draft",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "description": "The currently active alert effect.",
          "default": "none"
        },
        {
          "name": "state/on",
          "description": "True when device is on; false when off.",
          "refresh.interval": 5
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_SWITCH",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x02",
        "0x0006"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0103",
        "endpoint": "0x02",
        "in": [
          "0x0000"
        ],
        "out": [
          "0x0006"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/buttonevent",
          "description": "The last received button event."
        },
        {
          "name": "state/lastupdated"
        }
      ]
    },
    {
      "type": "$TYPE_CONSUMPTION_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0702"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0100",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0702"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/consumption",
          "description": "The measured consumption (in Wh).",
          "refresh.interval": 300,
          "default": 0
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/power",
          "description": "The measured power (in W).",
          "refresh.interval": 300,
          "default": 0
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0702",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x25",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        },
        {
          "at": "0x0400",
          "dt": "0x2A",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "groupcast",
      "config.group": 104,
      "src.ep": 1,
      "cl": "0x2000"
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0006",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x10",
          "min": 1,
          "max": 300
        }
      ]
    }
  ]
}

Hope @Smanar could help me :wink:

Moved to Deconz - general support.

1 Like

I changed the DDF for the power to get value from cluster 0x0702 and not from non existent 0x0b04 by default, the easiest part :wink:

        {
          "name": "state/power",
          "refresh.interval": 360,
          "read": {
            "at": "0x0400",
            "cl": "0x0702",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0400",
            "cl": "0x0702",
            "ep": 1,
            "eval": "if (Attr.val != -32768 && Attr.val != 32768) { Item.val = Attr.val / 10; }"
          },
          "default": 0
        }
      ]

But still questioning about the part of the binding which refers to a non-existent cluster in “groupcast”

    {
      "bind": "groupcast",
      "config.group": 104,
      "src.ep": 1,
      "cl": "0x2000"
    },

Do you need the ZHAswitch part ?
We generaly don’t use it for wired switch (except for model that permit the dissociated mode)
It’s useless as we can use the light state and this device don’t have double/triple or long mode.

So for me you can remove all this part from your DDF, so you will not have state/buttonevent and the useless widget in domoticz.

And I think too you can remove the groupcast bind part.
This is most used for battery switch (for they send groupcast request to all light in the group), and as the device will be used as light, not usefull.
And BTW cluster 0x2000 ???
I don’t think this one can be usefull ^^, you can remove it without problem.

The ZHAswitch is created because of the endpoint 0x02, it s a switch “emitter” endpoint.
No idea where the curious bind is from ^^, cluster 0x2000 …

Exactly the type of answer I expected :wink:
Will give it a try and if it works will make a PR with the DDF

I tried this DDF with a Hot Relaod but I still have the ZHAswitch sensor presented.

{
  "schema": "devcap1.schema.json",
  "manufacturername": "Jasco Products",
  "modelid": "45856",
  "vendor": "GE",
  "product": "45856",
  "sleeper": false,
  "status": "Silver",
  "path": "/devices/45856.json",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_LIGHT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "description": "The currently active alert effect.",
          "default": "none"
        },
        {
          "name": "state/on",
          "description": "True when device is on; false when off.",
          "refresh.interval": 5
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_CONSUMPTION_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0702"
      ],
      "fingerprint": {
        "profile": "0x0104",
        "device": "0x0100",
        "endpoint": "0x01",
        "in": [
          "0x0000",
          "0x0702"
        ]
      },
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion"
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/consumption",
          "description": "The measured consumption (in Wh).",
          "refresh.interval": 300,
          "default": 0
        },
        {
          "name": "state/lastupdated"
        },
        {
          "name": "state/power",
          "refresh.interval": 360,
          "read": {
            "at": "0x0400",
            "cl": "0x0702",
            "ep": 1,
            "fn": "zcl"
          },
          "parse": {
            "at": "0x0400",
            "cl": "0x0702",
            "ep": 1,
            "eval": "if (Attr.val != -32768 && Attr.val != 32768) { Item.val = Attr.val / 10; }"
          },
          "default": 0
        }
      ]
    }
  ],
  "bindings": [
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0702",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x25",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        },
        {
          "at": "0x0400",
          "dt": "0x2A",
          "min": 1,
          "max": 300,
          "change": "0x00000001"
        }
      ]
    },
    {
      "bind": "unicast",
      "src.ep": 1,
      "dst.ep": 1,
      "cl": "0x0006",
      "report": [
        {
          "at": "0x0000",
          "dt": "0x10",
          "min": 1,
          "max": 300
        }
      ]
    }
  ]
}

In Domoticz I added this device in banned_devices.txt to don’t have it for the moment. I’ll try delete and rejoin the switch later when back at home.

Ha yes, I remember, it’s because you have an older deconz version because your PR was not merged yet.
This was corrected some version ago.

It the PR to add new field to TRV ? I realy hope for a massive PR merge this time.

@Smanar BTW is there a way to have the power device added also in Domoticz with ENABLEMORESENSOR parameter for that item (to avoid adding a pseudo sensor in DDF for that) ?

Ha, it s because this device use the same cluster for power and consumption ?

Have just made a fast patch in the beta version of the domoticz plugin Update plugin.py · Smanar/Domoticz-deCONZ@2af895d · GitHub

You can test it, delete the previous widget, you will have a new one with consumption and power cumulated.

Can you add it for e1c-nb7 also please :wink: ?

PR valided.

Thanks. I updated the plugin in Domoticz but it changes nothing, no more widget created ?!



Here is debug log from plugin
https://pastebin.com/SiUG1Nug
Concerne devices are :

{
    "config": {
        "on": true,
        "reachable": true
    },
    "ep": 1,
    "etag": "2bd87b2fd28004649f658dff3b27f024",
    "lastannounced": "2022-10-26T23:21:21Z",
    "lastseen": "2022-10-27T13:36Z",
    "manufacturername": "Jasco Products",
    "modelid": "45856",
    "name": "Conso  Inter SdB",
    "state": {
        "consumption": 255,
        "lastupdated": "2022-10-27T13:37:07.724",
        "power": 0
    },
    "type": "ZHAConsumption",
    "uniqueid": "00:22:a3:00:00:25:33:39-01-0702"
}

or

{
    "config": {
        "on": true,
        "reachable": true
    },
    "etag": "93a36ed0b8c60cc22bbfbca76bf6a959",
    "lastannounced": null,
    "lastseen": "2022-10-27T13:40Z",
    "manufacturername": "sengled",
    "modelid": "E1C-NB7",
    "name": "Conso Prise rideaux salon",
    "state": {
        "consumption": 19,
        "lastupdated": "2022-10-27T13:40:38.240",
        "power": 0
    },
    "type": "ZHAConsumption",
    "uniqueid": "b0:ce:18:14:03:6b:d7:d0-01-0702"
}

Do I have to delete them in DOmoticz to get the plugin to handle them again and create the new widgets ?

Exactly.
It will create the new one with power and consumption cumuled, sensor are created only 1 time, you need to delete one and restart the plugin, the new one will be created.

I deleted the consumption widget that support the power attribute but the plugin only recreated it without power widget. Will try to delete all the widgets related to that device to see if it works.

Edit : Still the same, no power widget created

It’s more domoticz question ^^ so can pm me on discord or use the domoticz forum, but the code will not create a power widget, but a different consumption widget.

There is one with only consumption and one with power and consumption cumulated, look at the widget type

    elif _Type == 'ZHAConsumption':# in kWh
        #Device with only comsumption
        if opt == 0:
            kwarg['Type'] = 113
            kwarg['Subtype'] = 0
            kwarg['Switchtype'] = 0
        #Device with power and energy
        else:
            kwarg['TypeName'] = 'kWh'

The normal one is a RFXmeter support only kw/h, the second one is a general kw/h that support kw/h and Watt

You’re right. Shame on me ! And thanks for all !
PR created 6477