『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 2010|回复: 15

[经验分享] 鸿雁6键场景面板脚本

[复制链接]

16

主题

262

帖子

3717

积分

论坛元老

Rank: 8Rank: 8

积分
3717
金钱
3450
HASS币
0
发表于 2023-4-19 23:07:42 | 显示全部楼层 |阅读模式
本帖最后由 alex950418 于 2023-4-19 23:12 编辑

偶然看到某鱼上便宜的鸿雁6键液晶场景面板,使用了一段时间,稳定可靠,找了HA官网论坛,没有这个面板的Blueprints脚本,于是简单写了一个,方便大家使用面板如图:

Blueprints脚本如下:

blueprint:
  name: Z2M - 6-Button Scene Switch U86KCJ-ZP
  description: 'Control anything using the 6-button scene switch U86KCJ-ZP

    Inspired by the blueprint of @bouyssic (https://www.zigbee2mqtt.io/devices/U86KCJ-ZP.html)'
  domain: automation
  input:
    switch:
      name: 6-button scene switch
      description: 6-button scene switch to use (by model U86KCJ-ZP)
      selector:
        entity:
          domain: sensor
          integration: mqtt
          multiple: false
    button_1_single:
      name: Scene Switch 1 Button - Single Click
      description: Action to run after single click of scenery 1 button
      default: []
      selector:
        action: {}
    button_2_single:
      name: Scene Switch 2 Button - Single Click
      description: Action to run after single click of scenery 2 button
      default: []
      selector:
        action: {}
    button_3_single:
      name: Scene Switch 3 Button -  Single Click
      description: Action to run after single click of scenery 3 button
      default: []
      selector:
        action: {}
    button_4_single:
      name: Scene Switch 4 Button - Single Click
      description: Action to run after single click of scenery 4 button
      default: []
      selector:
        action: {}
    button_5_single:
      name: Scene Switch 5 Button - Single Click
      description: Action to run after single click of scenery 5 button
      default: []
      selector:
        action: {}
    button_6_single:
      name: Scene Switch 6 Button - Single Click
      description: Action to run after single click of scenery 6 button
      default: []
      selector:
        action: {}
  source_url: https://www.zigbee2mqtt.io/devices/U86KCJ-ZP.html
mode: single
max_exceeded: silent
trigger:
- platform: state
  entity_id: !input switch
  attribute: action
action:
- variables:
    command: '{{ trigger.to_state.state }}'
- choose:
  - conditions:
    - '{{ command == ''scene_1'' }}'
    sequence: !input button_1_single
  - conditions:
    - '{{ command == ''scene_2'' }}'
    sequence: !input button_2_single
  - conditions:
    - '{{ command == ''scene_3'' }}'
    sequence: !input button_3_single
  - conditions:
    - '{{ command == ''scene_4'' }}'
    sequence: !input button_4_single
  - conditions:
    - '{{ command == ''scene_5'' }}'
    sequence: !input button_5_single
  - conditions:
    - '{{ command == ''scene_6'' }}'
    sequence: !input button_6_single



6 button scenery.png

Z2M - 6-Button Scene Switch.yaml.zip

1.17 KB, 下载次数: 10

评分

参与人数 1金钱 +10 收起 理由
隔壁的王叔叔 + 10 高手,这是高手!

查看全部评分

回复

使用道具 举报

0

主题

13

帖子

62

积分

注册会员

Rank: 2

积分
62
金钱
49
HASS币
0
发表于 2023-4-22 23:03:26 | 显示全部楼层
大佬你好 小白想请教下 我这边开发商交付配套的鸿雁灯具开关 包括你图里这种场景开关有两个 以及一个zigbee的网关,想把开关都接入到HA 我按照网关二维码扫出来的说明书下载了app但是搜不到网关 设置不了和HA同网段 该从哪里下手解决呀?
回复

使用道具 举报

16

主题

262

帖子

3717

积分

论坛元老

Rank: 8Rank: 8

积分
3717
金钱
3450
HASS币
0
 楼主| 发表于 2023-4-23 11:13:49 | 显示全部楼层
首先,使用这个自动化蓝图脚本,需要使用zigbee2mqtt;其次,不确定鸿雁的其他设备是否支持zigbee2mqtt;l另外,对于zigbee2mqtt支持的设备请查看:https://www.zigbee2mqtt.io/supported-devices/

HA是可以支持多个zigbee2mqtt(LAN接口或WiFi,不能使用USB端口的)来支持大户型或别墅部署
回复

使用道具 举报

1

主题

57

帖子

448

积分

中级会员

Rank: 3Rank: 3

积分
448
金钱
391
HASS币
0
发表于 2023-4-23 13:10:17 | 显示全部楼层
感谢分享。
回复

使用道具 举报

0

主题

13

帖子

62

积分

注册会员

Rank: 2

积分
62
金钱
49
HASS币
0
发表于 2023-4-26 21:48:51 | 显示全部楼层
alex950418 发表于 2023-4-23 11:13
首先,使用这个自动化蓝图脚本,需要使用zigbee2mqtt;其次,不确定鸿雁的其他设备是否支持zigbee2mqtt;l ...

谢谢 我查到了 Honyar U86K31ND 是支持的,硬件准备我还需要去搞一个zibgee2MQTT的网关对吧?
回复

使用道具 举报

5

主题

164

帖子

722

积分

高级会员

Rank: 4

积分
722
金钱
558
HASS币
0
发表于 2023-4-28 09:05:47 | 显示全部楼层
我正想买一个这个面板,就有大佬来分享!赞啊!
回复

使用道具 举报

5

主题

164

帖子

722

积分

高级会员

Rank: 4

积分
722
金钱
558
HASS币
0
发表于 2023-5-3 08:42:50 | 显示全部楼层
问一下大佬,这个蓝图脚本如何使用啊?HA里的蓝图是让添加网址。是直接创建脚本,贴上代码吗?@alex950418
回复

使用道具 举报

16

主题

262

帖子

3717

积分

论坛元老

Rank: 8Rank: 8

积分
3717
金钱
3450
HASS币
0
 楼主| 发表于 2023-5-3 18:17:34 | 显示全部楼层
HA配置目录有个文件夹:blueprints,下载*.yaml文件到这个目录,回到HA管理页面,直接就可以用了
回复

使用道具 举报

0

主题

122

帖子

908

积分

高级会员

Rank: 4

积分
908
金钱
786
HASS币
0
发表于 2023-5-3 20:47:31 | 显示全部楼层
谢谢大咖成果分享,面板价格多少?
回复

使用道具 举报

5

主题

164

帖子

722

积分

高级会员

Rank: 4

积分
722
金钱
558
HASS币
0
发表于 2023-5-3 22:36:41 | 显示全部楼层
alex950418 发表于 2023-5-3 18:17
HA配置目录有个文件夹:blueprints,下载*.yaml文件到这个目录,回到HA管理页面,直接就可以用了 ...

好的,谢谢啦!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-29 18:35 , Processed in 0.061245 second(s), 35 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表