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

 找回密码
 立即注册
查看: 7237|回复: 6

[流程系列] 关于Aqara无线开关的计数的节点

[复制链接]

3

主题

334

帖子

2066

积分

金牌会员

Rank: 6Rank: 6

积分
2066
金钱
1732
HASS币
0
发表于 2020-11-23 00:14:11 | 显示全部楼层 |阅读模式
本帖最后由 0703005 于 2020-11-23 00:15 编辑

浏览Node-red节点时无意间发现了时间计数器节点,  对于Aqara无线开关贴,只要你手速快,别说双击! 三级!  就连100级 都不在话下。好东西不敢独享。

评分

参与人数 1金钱 +2 收起 理由
neoyang + 2

查看全部评分

回复

使用道具 举报

7

主题

97

帖子

1062

积分

金牌会员

Rank: 6Rank: 6

积分
1062
金钱
965
HASS币
0
发表于 2021-1-23 15:16:20 | 显示全部楼层
你的意思是指可以設定, 按一下, 按二下各執行不同的功能?
回复

使用道具 举报

3

主题

334

帖子

2066

积分

金牌会员

Rank: 6Rank: 6

积分
2066
金钱
1732
HASS币
0
 楼主| 发表于 2021-1-25 15:19:10 | 显示全部楼层
neoyang 发表于 2021-1-23 15:16
你的意思是指可以設定, 按一下, 按二下各執行不同的功能?

是的,可以设置成在规定时间范围内检测按压次数
回复

使用道具 举报

7

主题

97

帖子

1062

积分

金牌会员

Rank: 6Rank: 6

积分
1062
金钱
965
HASS币
0
发表于 2021-1-25 17:41:47 | 显示全部楼层
謝了, 找機會再來試試.
回复

使用道具 举报

7

主题

97

帖子

1062

积分

金牌会员

Rank: 6Rank: 6

积分
1062
金钱
965
HASS币
0
发表于 2021-2-1 12:50:32 | 显示全部楼层
在 node-red 中, 試了一下.
用 [trigger state] 去捕捉 automation 中所設定好的按鍵.
再把 state=on 傳進去 [timed counter], 但 timed counter 似乎只會把 on 再傳出去, 而不是傳次數.
請問我是那裡出錯了嗎?
回复

使用道具 举报

3

主题

334

帖子

2066

积分

金牌会员

Rank: 6Rank: 6

积分
2066
金钱
1732
HASS币
0
 楼主| 发表于 2021-2-2 14:17:22 | 显示全部楼层
neoyang 发表于 2021-2-1 12:50
在 node-red 中, 試了一下.
用 [trigger state] 去捕捉 automation 中所設定好的按鍵.
再把 state=on 傳進 ...

这是我的配置  希望能帮到你已稳定运行半年
[
    {
        "id": "4637e5e.a99ef1c",
        "type": "tab",
        "label": "Aqara无线开关联动",
        "disabled": false,
        "info": ""
    },
    {
        "id": "fdc37963.e87508",
        "type": "server-state-changed",
        "z": "4637e5e.a99ef1c",
        "name": "Aaqara无线开关点击(卧室)",
        "server": "f502d896.36dae8",
        "version": 1,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "sensor.0x158d00024b48c6_action",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "single",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "x": 450,
        "y": 220,
        "wires": [
            [
                "e6b26bee.d70fe8"
            ],
            []
        ]
    },
    {
        "id": "3cccdf6c.d8115",
        "type": "switch",
        "z": "4637e5e.a99ef1c",
        "name": "次数统计",
        "property": "count",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "1",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "2",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "3",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 3,
        "x": 860,
        "y": 220,
        "wires": [
            [
                "6adfda86.51fd94"
            ],
            [],
            []
        ],
        "outputLabels": [
            "1次",
            "2次",
            null
        ]
    },
    {
        "id": "6adfda86.51fd94",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "卧室灯",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "toggle",
        "entityId": "switch.0x158d000211801e_channel_2",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1050,
        "y": 220,
        "wires": [
            []
        ]
    },
    {
        "id": "be37648b.7b91d8",
        "type": "server-state-changed",
        "z": "4637e5e.a99ef1c",
        "name": "Aaqara无线开关点击(书房)",
        "server": "f502d896.36dae8",
        "version": 1,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "sensor.0x158d00025302a8_action",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "single",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "x": 450,
        "y": 340,
        "wires": [
            [
                "b66740.b10ad8c"
            ],
            []
        ]
    },
    {
        "id": "ee8d42a0.29afb",
        "type": "switch",
        "z": "4637e5e.a99ef1c",
        "name": "次数统计",
        "property": "count",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "1",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "2",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "3",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 3,
        "x": 860,
        "y": 340,
        "wires": [
            [
                "82a44fa4.b9df8"
            ],
            [],
            []
        ],
        "outputLabels": [
            "1次",
            "2次",
            null
        ]
    },
    {
        "id": "82a44fa4.b9df8",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "书房灯",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "toggle",
        "entityId": "switch.0x158d000211801e_channel_1",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1050,
        "y": 340,
        "wires": [
            []
        ]
    },
    {
        "id": "af947bd0.f2d968",
        "type": "server-state-changed",
        "z": "4637e5e.a99ef1c",
        "name": "Aaqara无线开关点击(主卧)",
        "server": "f502d896.36dae8",
        "version": 1,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "sensor.0x158d0002530462_action",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "single",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "x": 450,
        "y": 460,
        "wires": [
            [
                "c5612152.cad3a"
            ],
            []
        ]
    },
    {
        "id": "19e2f8e7.154b67",
        "type": "switch",
        "z": "4637e5e.a99ef1c",
        "name": "次数统计",
        "property": "count",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "1",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "2",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "3",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 3,
        "x": 860,
        "y": 460,
        "wires": [
            [
                "aeb82431.ef4048"
            ],
            [
                "5683f44a.2cdd9c"
            ],
            [
                "48c76e99.305"
            ]
        ],
        "outputLabels": [
            "1次",
            "2次",
            null
        ]
    },
    {
        "id": "aeb82431.ef4048",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "主卧A灯",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "toggle",
        "entityId": "switch.0x158d0002422cc3_channel_1",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1060,
        "y": 420,
        "wires": [
            []
        ]
    },
    {
        "id": "d8d5ca.6696ea38",
        "type": "server-state-changed",
        "z": "4637e5e.a99ef1c",
        "name": "Aaqara无线开关点击(客厅)",
        "server": "f502d896.36dae8",
        "version": 1,
        "exposeToHomeAssistant": false,
        "haConfig": [
            {
                "property": "name",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            }
        ],
        "entityidfilter": "sensor.0x158d00024b3a84_action",
        "entityidfiltertype": "exact",
        "outputinitially": false,
        "state_type": "str",
        "haltifstate": "single",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "outputs": 2,
        "output_only_on_state_change": true,
        "for": 0,
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "x": 450,
        "y": 580,
        "wires": [
            [
                "14ccec96.916943"
            ],
            []
        ]
    },
    {
        "id": "43f890b0.954f6",
        "type": "switch",
        "z": "4637e5e.a99ef1c",
        "name": "次数统计",
        "property": "count",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "1",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "2",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "3",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 3,
        "x": 860,
        "y": 580,
        "wires": [
            [
                "84f6262d.00b5b8"
            ],
            [
                "28e13e59.c15d32"
            ],
            []
        ],
        "outputLabels": [
            "1次",
            "2次",
            null
        ]
    },
    {
        "id": "5683f44a.2cdd9c",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "主卧B灯",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "toggle",
        "entityId": "switch.0x158d0002422cc3_channel_2",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1060,
        "y": 460,
        "wires": [
            []
        ]
    },
    {
        "id": "48c76e99.305",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "主卧A-B灯",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "turn_off",
        "entityId": "switch.0x158d0002422cc3_channel_1, switch.0x158d0002422cc3_channel_2",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1070,
        "y": 500,
        "wires": [
            []
        ]
    },
    {
        "id": "84f6262d.00b5b8",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "客厅程序",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "turn_off",
        "entityId": "switch.0x158d0001f27004_switch, switch.0x158d0002403162_channel_1, switch.0x158d0002403162_channel_2, switch.0x158d0002450410_channel_1, switch.0x158d0002450410_channel_2, switch.0x158d0001f2720a_switch",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1060,
        "y": 560,
        "wires": [
            [
                "26534fb4.72a12"
            ]
        ],
        "info": "switch.0x00158d0001f27004, switch.0x00158d0002403162_right, switch.0x00158d0002450410_left, switch.0x00158d0002450410_right, switch.0x00158d0002403162_left, switch.0x00158d0001f2720a"
    },
    {
        "id": "28e13e59.c15d32",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "客厅双击",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "turn_on",
        "entityId": "switch.0x158d0002403162_channel_2",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1060,
        "y": 600,
        "wires": [
            []
        ]
    },
    {
        "id": "26534fb4.72a12",
        "type": "delay",
        "z": "4637e5e.a99ef1c",
        "name": "",
        "pauseType": "delay",
        "timeout": "20",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "x": 1220,
        "y": 560,
        "wires": [
            [
                "26930c1b.c43174"
            ]
        ]
    },
    {
        "id": "26930c1b.c43174",
        "type": "api-call-service",
        "z": "4637e5e.a99ef1c",
        "name": "主卧A灯",
        "server": "f502d896.36dae8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "switch",
        "service": "turn_off",
        "entityId": "switch.0x158d0002422cc3_channel_1",
        "data": "",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 1380,
        "y": 560,
        "wires": [
            []
        ]
    },
    {
        "id": "e6b26bee.d70fe8",
        "type": "timed-counter",
        "z": "4637e5e.a99ef1c",
        "name": "固定计数",
        "timelimit": "800",
        "timeunit": "1",
        "withhold": true,
        "fixedtimeout": true,
        "pertopic": true,
        "x": 680,
        "y": 220,
        "wires": [
            [
                "3cccdf6c.d8115"
            ]
        ]
    },
    {
        "id": "b66740.b10ad8c",
        "type": "timed-counter",
        "z": "4637e5e.a99ef1c",
        "name": "固定计数",
        "timelimit": "800",
        "timeunit": "1",
        "withhold": true,
        "fixedtimeout": true,
        "pertopic": true,
        "x": 680,
        "y": 340,
        "wires": [
            [
                "ee8d42a0.29afb"
            ]
        ]
    },
    {
        "id": "c5612152.cad3a",
        "type": "timed-counter",
        "z": "4637e5e.a99ef1c",
        "name": "固定计数",
        "timelimit": "800",
        "timeunit": "1",
        "withhold": true,
        "fixedtimeout": true,
        "pertopic": true,
        "x": 680,
        "y": 460,
        "wires": [
            [
                "19e2f8e7.154b67"
            ]
        ]
    },
    {
        "id": "14ccec96.916943",
        "type": "timed-counter",
        "z": "4637e5e.a99ef1c",
        "name": "固定计数",
        "timelimit": "800",
        "timeunit": "1",
        "withhold": true,
        "fixedtimeout": true,
        "pertopic": true,
        "x": 680,
        "y": 580,
        "wires": [
            [
                "43f890b0.954f6"
            ]
        ]
    },
    {
        "id": "f502d896.36dae8",
        "type": "server",
        "name": "Home Assistant",
        "legacy": false,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true
    }
]


评分

参与人数 1金钱 +5 收起 理由
neoyang + 5

查看全部评分

回复

使用道具 举报

7

主题

97

帖子

1062

积分

金牌会员

Rank: 6Rank: 6

积分
1062
金钱
965
HASS币
0
发表于 2021-2-4 01:54:22 | 显示全部楼层
感謝您的分享, 可能因為我用的是 sonoff 的隨意貼的關係.
平常是用 automation.testpmode 去觸發功能, 通常就是傳 on 字串, 而不是 signal.雖然是 on 取代 signal ... 但還是沒有成功.

[{"id":"fdc37963.e87508","type":"server-state-changed","z":"4637e5e.a99ef1c","name":"sonoff 隨意貼開關","server":"f502d896.36dae8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"automation.testpmode","entityidfiltertype":"exact","outputinitially":false,"state_type":"habool","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":150,"y":160,"wires":[["e6b26bee.d70fe8"],["42f93e86.7b291"]]},{"id":"f502d896.36dae8","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]



回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 18:14 , Processed in 0.709365 second(s), 30 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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