Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW DEVICE] ZBT DIMController D0800 Müller Licht #247

Closed
kloodhu opened this issue Feb 13, 2021 · 6 comments
Closed

[NEW DEVICE] ZBT DIMController D0800 Müller Licht #247

kloodhu opened this issue Feb 13, 2021 · 6 comments
Assignees
Labels
new-device New device

Comments

@kloodhu
Copy link

kloodhu commented Feb 13, 2021

New Device Support

A configured this device in controllerx for zha integration. I can provide the full zha event log for the press/hold/etc commands.
How do you like to get it?

Should I copy here?

müllerlicht_dimmer

@kloodhu kloodhu added the new-device New device label Feb 13, 2021
@xaviml
Copy link
Owner

xaviml commented Feb 13, 2021

Hi @kloodhu,

Thank you for opening the ticket. You can provide all the zha events that the controller fires. Please indicate which button was used for each event.

Regards,
Xavi M.

@kloodhu
Copy link
Author

kloodhu commented Feb 14, 2021

  1. top button (on/off)
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0006",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 6,
    "command": "on",
    "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-08T17:00:06.259735+00:00",
    "context": {
    "id": "0c78c148ca6ce3b84f88ff8080ffc002",
    "parent_id": null,
    "user_id": null
    }
    }
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0006",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 6,
    "command": "off",
    "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-08T17:00:29.372917+00:00",
    "context": {
    "id": "ae09f4353ca14700acc68b76219c5c8d",
    "parent_id": null,
    "user_id": null
    }
    }

  2. dim up press
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0008",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 8,
    "command": "step",
    "args": [
    0,
    43,
    3
    ]
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-12T08:46:46.953361+00:00",
    "context": {
    "id": "cfffaefe1f5a34628200ad3ba8c6118b",
    "parent_id": null,
    "user_id": null
    }
    }

  3. dim up long press
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0008",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 8,
    "command": "move",
    "args": [
    0,
    100
    ]
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-12T09:10:53.946464+00:00",
    "context": {
    "id": "9bcad16ddc964139b1e905932935da92",
    "parent_id": null,
    "user_id": null
    }
    }
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0008",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 8,
    "command": "stop",
    "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-12T09:10:57.005713+00:00",
    "context": {
    "id": "9b735e229c21df59707ce8ab0f509931",
    "parent_id": null,
    "user_id": null
    }
    }

  4. dim down press
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0008",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 8,
    "command": "step",
    "args": [
    1,
    43,
    3
    ]
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-12T08:46:01.538543+00:00",
    "context": {
    "id": "e056337014076f4fec8c52ac84e09302",
    "parent_id": null,
    "user_id": null
    }
    }

  5. dim down long press
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0008",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 8,
    "command": "move",
    "args": [
    1,
    100
    ]
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-12T09:09:41.615907+00:00",
    "context": {
    "id": "ad6085d60a376a6da0d7ff3bf6f7ef47",
    "parent_id": null,
    "user_id": null
    }
    }
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0008",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 8,
    "command": "stop",
    "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-12T09:09:48.237582+00:00",
    "context": {
    "id": "a0abdd2e068669aa1ff0c298ea98bc28",
    "parent_id": null,
    "user_id": null
    }
    }

  6. bottom button
    {
    "event_type": "zha_event",
    "data": {
    "device_ieee": "00:15:8d:00:03:8b:88:7e",
    "unique_id": "00:15:8d:00:03:8b:88:7e:1:0x0005",
    "device_id": "eda85428a7a860bc20f5d2a008dd5cb2",
    "endpoint_id": 1,
    "cluster_id": 5,
    "command": "recall",
    "args": [
    16387,
    1
    ]
    },
    "origin": "LOCAL",
    "time_fired": "2020-12-12T08:44:51.471769+00:00",
    "context": {
    "id": "e4aebe82a4b311490009d5664ba1442b",
    "parent_id": null,
    "user_id": null
    }
    }

I set up the buttons a bit different, because i'm using motion automation:

from cx_const import Light, TypeActionsMapping
from cx_core import LightController
from cx_core.integration import EventData

def get_zha_action_MullerLichtController(data: dict) -> str:
endpoint_id = data.get("endpoint_id", 1)
command = action = data["command"]
args = data.get("args", {})
args_mapping = {0: "up", 1: "down"}
if command in ("move", "step"):
action = "".join((action, args_mapping[args[0]]))
action = "
".join((str(endpoint_id), action))
return action

class MullerLichtLightController404002(LightController):
def get_zha_actions_mapping(self) -> TypeActionsMapping:
return {
"1_on": Light.ON_FULL_BRIGHTNESS,
"1_off": Light.ON_FULL_BRIGHTNESS,
"1_move_up": Light.HOLD_BRIGHTNESS_UP,
"1_move_down": Light.HOLD_BRIGHTNESS_DOWN,
"1_stop": Light.RELEASE,
"1_step_up": Light.SET_HALF_BRIGHTNESS,
"1_step_down": Light.ON_MIN_BRIGHTNESS,
"1_recall": Light.OFF,
}

def get_zha_action(self, data: EventData) -> str:
    return get_zha_action_MullerLichtController(data) 

I hope this helps you integrate the device.

@kloodhu
Copy link
Author

kloodhu commented Feb 14, 2021

more info: im using the 4.3.0 version. after updated today to 4.6.0, my config works no longer, so i went back to that version.

@xaviml
Copy link
Owner

xaviml commented Feb 14, 2021

Hi @kloodhu,

Thank you for the info, and for the code for it!

im using the 4.3.0 version. after updated today to 4.6.0, my config works no longer, so i went back to that version.

That is interesting, I don't see anything that would be backward compatible. I don't know if you took this into account, but when changing the version in HACS, it deletes everything and downloads it all again, so if you wrote anything in the ControllerX, it would overwrite it.

I will integrate this, and let you know about it, so you can try it out in a prerelease.

Regards,
Xavi M.

@xaviml
Copy link
Owner

xaviml commented Feb 21, 2021

Hi @kloodhu,

I just publish a new beta release (v4.7.0b0) with the support of this controller. I did not add the endpoint_id since it seems to be always 1. Is there a reason, you added it to the mapping? I will change if needed.

Also, I changed slightly the mapping you provided, the "on" and "off" toggle the light for example. And your code didn't work for ControllerX v4.6.0 because of the return type of the default mapping function, I changed that recently.

Let me know if this works for you, and you can always change the mapping by using the mapping and merge_mapping attributes. I also added a base class called MLI404002Controller, since the Controller will not work for this controller with the ZHA integration.

Regards,
Xavi M.

@kloodhu
Copy link
Author

kloodhu commented Feb 25, 2021

Thank you mate, i just got some time to try it.

I made some mapping in my config, and is working as before on ZHA:
merge_mapping:
"on": on_full_brightness
"off": on_full_brightness
step_up: set_half_brightness
step_down: on_min_brightness
recall: "off"

And there was no reason to use the endpoint_id. When i first created, I just edited one of the other files and didnt deleted.

@kloodhu kloodhu closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-device New device
Projects
None yet
Development

No branches or pull requests

2 participants