蓝图支持小米立方体控制器使用ZHA。
谢谢@bergstrom为了这个灵感。

所有这些都已测试。

支持的动作

  • 滑动
  • 翻盖90度
  • 翻盖180 dgress
  • 降低
  • 唤醒
  • 顺时针旋转
  • 逆时针旋转

蓝图

单击徽章以导入此蓝图:(需要家庭助理必威是什么核心2021.3或更高)

打开您的家必威体育存款庭助理实例必威是什么,并显示带有特定蓝图预先填充的蓝图导入对话框。

蓝图:名称:Aqara Magic Cube描述:使用Aqara Magic Cube控制任何内容。域:自动化输入:远程:名称:魔术立方体描述:选择AQARA魔法立方体设备选择器:设备:集成:ZHA制造商:Lumi Flip_90:名称:FLIP 90度说明:Cube Flips Flips 90度90度。这取消了所有特定的90度函数。例如,从1到另一侧2将与从侧面6到2的默认值相同:false选择器:布尔值:{} cube_flip_90:name:flip cube 90度说明:Cube flips 90度时运行的动作。This only works if 'Flip 90 degrees' is toggled default: [] selector: action: {} flip_180: name: Flip 180 degrees description: Actions to run when cube flips 180 degrees.这取消所有特定的180度函数,例如从1到另一侧4将与从侧5到另一侧2相同:false选择器:boolean:{} cube_flip_180:name:flip cube 180摄氏度描述:cube flips flips flips flips flips flips flips flips flips flips。180度。仅当“翻转180度”被切换为默认值时,这才有效:[] selector:action:{} slide_any_side:name:name:slide slide nife侧描述:当Cube在任何侧面滑动时要运行的操作。这取消了所有特定的“幻灯片”功能,例如侧面1幻灯片将与侧面的幻灯片相同2默认值:false Selector:boolean:{} cube_slide_any:name:name:slide cube在任何侧面描述:在任何侧面slide cuble slide to cube on nothy nothy滑动。 This only works if 'Slide any side' is toggled default: [] selector: action: {} knock_any_side: name: Knock on any side description: Actions to run when knocking cube regardless of the side. This cancels all specific 'knock' functions e.g Knock on side 1 will be the same as knocking side 2 default: false selector: boolean: {} cube_knock_any: name: Knock cube on any side description: Action to run when knocking cube on any side. This only works if 'Knock on any side' is toggled default: [] selector: action: {} one_to_two: name: From side 1 to side 2 description: Action to run when cube goes from side 1 to side 2 default: [] selector: action: {} one_to_three: name: From side 1 to side 3 description: Action to run when cube goes from side 1 to side 3 default: [] selector: action: {} one_to_four: name: From side 1 to side 4 description: Action to run when cube goes from side 1 to side 4 default: [] selector: action: {} one_to_five: name: From side 1 to side 5 description: Action to run when cube goes from side 1 to side 5 default: [] selector: action: {} one_to_six: name: From side 1 to side 6 description: Action to run when cube goes from side 1 to side 6 default: [] selector: action: {} two_to_one: name: From side 2 to side 1 description: Action to run when cube goes from side 2 to side 1 default: [] selector: action: {} two_to_three: name: From side 2 to side 3 description: Action to run when cube goes from side 2 to side 3 default: [] selector: action: {} two_to_four: name: From side 2 to side 4 description: Action to run when cube goes from side 2 to side 4 default: [] selector: action: {} two_to_five: name: From side 2 to side 5 description: Action to run when cube goes from side 2 to side 5 default: [] selector: action: {} two_to_six: name: From side 2 to side 6 description: Action to run when cube goes from side 2 to side 6 default: [] selector: action: {} three_to_one: name: From side 3 to side 1 description: Action to run when cube goes from side 3 to side 1 default: [] selector: action: {} three_to_two: name: From side 3 to side 2 description: Action to run when cube goes from side 3 to side 2 default: [] selector: action: {} three_to_four: name: From side 3 to side 4 description: Action to run when cube goes from side 3 to side 4 default: [] selector: action: {} three_to_five: name: From side 3 to side 5 description: Action to run when cube goes from side 3 to side 5 default: [] selector: action: {} three_to_six: name: From side 3 to side 6 description: Action to run when cube goes from side 3 to side 6 default: [] selector: action: {} four_to_one: name: From side 4 to side 1 description: Action to run when cube goes from side 4 to side 1 default: [] selector: action: {} four_to_two: name: From side 4 to side 2 description: Action to run when cube goes from side 4 to side 2 default: [] selector: action: {} four_to_three: name: From side 4 to side 3 description: Action to run when cube goes from side 4 to side 3 default: [] selector: action: {} four_to_five: name: From side 4 to side 5 description: Action to run when cube goes from side 4 to side 5 default: [] selector: action: {} four_to_six: name: From side 4 to side 6 description: Action to run when cube goes from side 4 to side 6 default: [] selector: action: {} five_to_one: name: From side 5 to side 1 description: Action to run when cube goes from side 5 to side 1 default: [] selector: action: {} five_to_two: name: From side 5 to side 2 description: Action to run when cube goes from side 5 to side 2 default: [] selector: action: {} five_to_three: name: From side 5 to side 3 description: Action to run when cube goes from side 5 to side 3 default: [] selector: action: {} five_to_four: name: From side 5 to side 4 description: Action to run when cube goes from side 5 to side 4 default: [] selector: action: {} five_to_six: name: From side 5 to side 6 description: Action to run when cube goes from side 5 to side 6 default: [] selector: action: {} six_to_one: name: From side 6 to side 1 description: Action to run when cube goes from side 6 to side 1 default: [] selector: action: {} six_to_two: name: From side 6 to side 2 description: Action to run when cube goes from side 6 to side 2 default: [] selector: action: {} six_to_three: name: From side 6 to side 3 description: Action to run when cube goes from side 6 to side 3 default: [] selector: action: {} six_to_four: name: From side 6 to side 4 description: Action to run when cube goes from side 6 to side 4 default: [] selector: action: {} six_to_five: name: From side 6 to side 5 description: Action to run when cube goes from side 6 to side 5 default: [] selector: action: {} one_to_one: name: Knock - Side 1 description: Action to run when knocking on side 1 default: [] selector: action: {} two_to_two: name: Knock - Side 2 description: Action to run when knocking on side 2 default: [] selector: action: {} three_to_three: name: Knock - Side 3 description: Action to run when knocking on side 3 default: [] selector: action: {} four_to_four: name: Knock - Side 4 description: Action to run when knocking on side 4 default: [] selector: action: {} five_to_five: name: Knock - Side 5 description: Action to run when knocking on side 5 default: [] selector: action: {} six_to_six: name: Knock - Side 6 description: Action to run when knocking on side 6 default: [] selector: action: {} slide_on_one: name: Slide - Side 1 up description: Action to run when slides with Side 1 up default: [] selector: action: {} slide_on_two: name: Slide - Side 2 up description: Action to run when slides with Side 2 up default: [] selector: action: {} slide_on_three: name: Slide - Side 3 up description: Action to run when slides with Side 3 up default: [] selector: action: {} slide_on_four: name: Slide - Side 4 up description: Action to run when slides with Side 4 up default: [] selector: action: {} slide_on_five: name: Slide - Side 5 up description: Action to run when slides with Side 5 up default: [] selector: action: {} slide_on_six: name: Slide - Side 6 up description: Action to run when slides with Side 6 up default: [] selector: action: {} cube_wake: name: Wake up the cube description: Action to run when cube wakes up default: [] selector: action: {} cube_drop: name: Cube drops description: Action to run when cube drops default: [] selector: action: {} cube_shake: name: Shake cube description: Action to run when you shake the cube default: [] selector: action: {} rotate_right: name: Rotate right description: Action to run when cube rotates right default: [] selector: action: {} rotate_left: name: Rotate left description: Action to run when cube rotates left default: [] selector: action: {} mode: restart max_exceeded: silent trigger: - platform: event event_type: zha_event event_data: device_id: !input "remote" action: - variables: command: "{{ trigger.event.data.command }}" value: "{{ trigger.event.data.args.value }}" flip_degrees: "{{ trigger.event.data.args.flip_degrees }}" relative_degrees: "{{ trigger.event.data.args.relative_degrees }}" flip_90: !input "flip_90" flip_180: !input "flip_180" slide_any_side: !input "slide_any_side" knock_any_side: !input "knock_any_side" flip90: 64 flip180: 128 slide: 256 knock: 512 shake: 0 drop: 3 activated_face: > {% if command == "slide" or command == "knock" %} {% if trigger.event.data.args.activated_face == 1 %} 1 {% elif trigger.event.data.args.activated_face == 2 %} 5 {% elif trigger.event.data.args.activated_face == 3 %} 6 {% elif trigger.event.data.args.activated_face == 4 %} 4 {% elif trigger.event.data.args.activated_face == 5 %} 2 {% elif trigger.event.data.args.activated_face == 6 %} 3 {% endif %} {% elif command == 'flip' %} {{ trigger.event.data.args.activated_face | int }} {% endif %} from_face: > {% if command == "flip" and flip_degrees == 90 %} {{ ((value - flip90 - (trigger.event.data.args.activated_face - 1)) / 8) + 1 | int }} {% endif %} - choose: # ---------------------------- Rotate Right ---------------------------- - conditions: - "{{ command == 'rotate_right' }}" sequence: !input "rotate_right" # ---------------------------- Rotate Left ---------------------------- - conditions: - "{{ command == 'rotate_left' }}" sequence: !input "rotate_left" # ---------------------------- Wake ---------------------------- - conditions: - "{{ command == 'checkin' }}" sequence: !input "cube_wake" # ---------------------------- Shake ---------------------------- - conditions: - "{{ value == shake }}" sequence: !input "cube_shake" # ---------------------------- Drop ---------------------------- - conditions: - "{{ value == drop }}" sequence: !input "cube_drop" # ---------------------------- Knock any side ---------------------------- - conditions: - "{{ command == 'knock' and knock_any_side }}" sequence: !input "cube_knock_any" # ---------------------------- Slide any side ---------------------------- - conditions: - "{{ command == 'slide' and slide_any_side }}" sequence: !input "cube_slide_any" # ---------------------------- Flip 90 to any side ---------------------------- - conditions: - "{{ flip_degrees == 90 and flip_90 }}" sequence: !input "cube_flip_90" # ---------------------------- Flip 180 to any side ---------------------------- - conditions: - "{{ flip_degrees == 180 and flip_180 }}" sequence: !input "cube_flip_180" # ---------------------------- Flip 90 to side 1 ---------------------------- - conditions: - "{{ flip_degrees == 90 and activated_face == 1 }}" sequence: - choose: - conditions: "{{ from_face == 2 }}" sequence: !input "two_to_one" - conditions: "{{ from_face == 3 }}" sequence: !input "three_to_one" - conditions: "{{ from_face == 5 }}" sequence: !input "five_to_one" - conditions: "{{ from_face == 6 }}" sequence: !input "six_to_one" # ---------------------------- Flip 90 to side 2 ---------------------------- - conditions: - "{{ flip_degrees == 90 and activated_face == 2 }}" sequence: - choose: - conditions: "{{ from_face == 1 }}" sequence: !input "one_to_two" - conditions: "{{ from_face == 3 }}" sequence: !input "three_to_two" - conditions: "{{ from_face == 4 }}" sequence: !input "four_to_two" - conditions: "{{ from_face == 6 }}" sequence: !input "six_to_two" # ---------------------------- Flip 90 to side 3 ---------------------------- - conditions: - "{{ flip_degrees == 90 and activated_face == 3 }}" sequence: - choose: - conditions: "{{ from_face == 1 }}" sequence: !input "one_to_three" - conditions: "{{ from_face == 2 }}" sequence: !input "two_to_three" - conditions: "{{ from_face == 4 }}" sequence: !input "four_to_three" - conditions: "{{ from_face == 5 }}" sequence: !input "five_to_three" # ---------------------------- Flip 90 to side 4 ---------------------------- - conditions: - "{{ flip_degrees == 90 and activated_face == 4 }}" sequence: - choose: - conditions: "{{ from_face == 2 }}" sequence: !input "two_to_four" - conditions: "{{ from_face == 3 }}" sequence: !input "three_to_four" - conditions: "{{ from_face == 5 }}" sequence: !input "five_to_four" - conditions: "{{ from_face == 6 }}" sequence: !input "six_to_four" # ---------------------------- Flip 90 to side 5 ---------------------------- - conditions: - "{{ flip_degrees == 90 and activated_face == 5 }}" sequence: - choose: - conditions: "{{ from_face == 1 }}" sequence: !input "one_to_five" - conditions: "{{ from_face == 3 }}" sequence: !input "three_to_five" - conditions: "{{ from_face == 4 }}" sequence: !input "four_to_five" - conditions: "{{ from_face == 6 }}" sequence: !input "six_to_five" # ---------------------------- Flip 90 to side 6 ---------------------------- - conditions: - "{{ flip_degrees == 90 and activated_face == 6 }}" sequence: - choose: - conditions: "{{ from_face == 1 }}" sequence: !input "one_to_six" - conditions: "{{ from_face == 2 }}" sequence: !input "two_to_six" - conditions: "{{ from_face == 4 }}" sequence: !input "four_to_six" - conditions: "{{ from_face == 5 }}" sequence: !input "five_to_six" # ---------------------------- Flip 180 to side x ---------------------------- - conditions: - "{{ value == flip180 + activated_face - 1 }}" sequence: - choose: - conditions: "{{ activated_face == 1 }}" sequence: !input "four_to_one" - conditions: "{{ activated_face == 2 }}" sequence: !input "five_to_two" - conditions: "{{ activated_face == 3 }}" sequence: !input "six_to_three" - conditions: "{{ activated_face == 4 }}" sequence: !input "one_to_four" - conditions: "{{ activated_face == 5 }}" sequence: !input "two_to_five" - conditions: "{{ activated_face == 6 }}" sequence: !input "three_to_six" # ---------------------------- Knock side x ---------------------------- - conditions: - "{{ value == knock + activated_face - 1 }}" sequence: - choose: - conditions: "{{ activated_face == 1 }}" sequence: !input "one_to_one" - conditions: "{{ activated_face == 2 }}" sequence: !input "two_to_two" - conditions: "{{ activated_face == 3 }}" sequence: !input "three_to_three" - conditions: "{{ activated_face == 4 }}" sequence: !input "four_to_four" - conditions: "{{ activated_face == 5 }}" sequence: !input "five_to_five" - conditions: "{{ activated_face == 6 }}" sequence: !input "six_to_six" # ---------------------------- Slide side x ---------------------------- - conditions: - "{{ value == slide + activated_face - 1 }}" sequence: - choose: - conditions: "{{ activated_face == 1 }}" sequence: !input "slide_on_one" - conditions: "{{ activated_face == 2 }}" sequence: !input "slide_on_two" - conditions: "{{ activated_face == 3 }}" sequence: !input "slide_on_three" - conditions: "{{ activated_face == 4 }}" sequence: !input "slide_on_four" - conditions: "{{ activated_face == 5 }}" sequence: !input "slide_on_five" - conditions: "{{ activated_face == 6 }}" sequence: !input "slide_on_six"
23喜欢

看起来不错。必威是什么家庭助理显示在蓝图页面上没有找到支持的设备。

是否可以添加通配符检测模型?

我的模型是哈是lumi.sensor_cube.AQGL01

您正在使用DeConz集成吗?这仅适用于ZHA。无论如何 - 名称必须为“ lumi.sensor_cube”,而没有“ AQGL01”。

br

同样在这里;
设备信息
lumi.sensor_cube.AQGL01
由Lumi
:皱眉:

1喜欢

@mr_thomasz@getverderrie

大家好,只需编辑蓝图配置并删除模型:lumi.sensor_cube行,然后保存并重新加载自动化:smiley:

@mikkelmoeller编辑模型线可能会很好,因此其他人没有同样的问题。

谢谢你的蓝图

@getverderrie,,,,@mr_thomasz。请再试一遍。
谢谢@Alexgreenuk评论。

tnx!奇迹般有效:liticle_smile:

这太棒了,为我们节省了很多工作!谢谢!

是否可以添加“来自任何”动作,即,无论其他方面都在哪个方面,根据哪个方面的启动?

我没有时间去做,但是如果有人愿意的话。

谢谢回复!

我是家庭助理的新手,但是我会看看是否必威是什么可以理解您的蓝图并从那里走。

是否有人设法获得2个立方体作为选项出现,因为我在家中有2个位置,一个楼下有一个,但是蓝图只看到我添加的第一个?

由于您的干净代码,我设法做了我想做的事情。我希望我的解决方案不会不必要地复杂。

我不确定该怎么办。@mikkelmoeller您想(并有时间)看它(是在github上现在)也许在这里集成它,还是应该将其发布为新的集成,以归功于您并在此处链接?

1喜欢

我不太明白:您是在尝试以相同的自动化使用两个立方体,还是第二个立方体似乎根本不显示为选项?

很好,这是我能够使用Cube找到的最有益健康的蓝图。对我来说很好。

1喜欢

嗨,没有第二个立方体没有出现在使用的选项上

哦,好,这很奇怪。我的两者都显示。它们都在设备屏幕上显示为设备吗?您是否尝试过删除第二个并再次配对?

你好@memorandomz,,,,

我导入了您的配置,但找不到任何区别。也许我缺少一些东西。您的代码在哪个区域与Mikkelmoeller提供的代码不同?

我对这种蓝图感到非常满意,这使我的立方体的自动化变得非常容易。

如果我们可以使“右旋转”和“向左旋转”动作具体而言,那将是很棒的。

例如,用侧面1向上您可以调暗灯光,侧面2向上可以控制电视音量,侧面3可以控制您的放大器音量,等等。

我也会尝试一下!

你好@hawkman,,,,

我将此部分介绍给蓝图:


我没有更改任何现有代码,而只是添加了它(嗯,基本上是从中复制的)。

哦,这听起来很有趣。我不知道是否可能,但可能是。也许我明天会玩一点。

我不知道这是否只是我的立方体,但对于左右移动,没有zha__event大约在哪一侧。它只是记录了右旋或者向左旋转命令和相对学位。

因此,它认为尝试根据我上一张中发布的立方体张开的面孔进行分配不同的旋转动作是毫无意义的。

其他人可以确认同样的事吗?

我的zha__event数据
{“ event_type”:“ zha_event”,“ data”:{“ device_ieee”:“ 00:15:15:8d:00:05:cf:9a:3d”,“ simolor_id”:00:15:15:8d:00:00:05:05:05:05:05:05:05:05:05:cf:9a:3d:3:0x000c“,“ device_id”:“ EF000D94D7B85F1C1C1F873315860E16AF”,“ ENDPOINT_ID”:3,“ CLUSTER_ID”,“ CLUSTER_ID”:12,“ 12,”命令“:rotate_right_right_right_right”:“ rotate_right”,“}},“原始”:“ local”,“ time_fired”:“ 2021-02-06T21:30:36.181945+00:00:00”,“ context”:{“ id”:“ 9DFC7CC7CC7CC7CC7CCAE4444410D229843984393955555555555553BBDA2”,““ user_id”:null}}}

是的,在这里。:frowning_face:

如果您真的想要该功能,您可能可以定义input_number这会跟踪抬起哪一侧,然后对左右旋转的旋转事件做出反应。