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

 找回密码
 立即注册
12
返回列表 发新帖
楼主: taida

[技术探讨] node red中通过时间怎么设置触发条件?

[复制链接]

21

主题

304

帖子

1138

积分

金牌会员

Rank: 6Rank: 6

积分
1138
金钱
834
HASS币
10
发表于 2023-8-11 12:55:46 | 显示全部楼层
本帖最后由 kkk123 于 2023-8-11 12:57 编辑

我是用每5分钟检测一次温度来判断
我觉得用温度来也是一样的,一样要判断是否高于指定值,而且还无法低于多少要关闭风扇,会造成频繁开关也不好
我用的例子如下,可以参考,用不上人体感应,感觉这东西睡觉一直照射应该有辐射,
直接根据睡觉时间设置就行了。
[
    {
        "id": "c07d8641d6931fc5",
        "type": "switch",
        "z": "5622825b657d1a32",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "gte",
                "v": "29.5",
                "vt": "str"
            },
            {
                "t": "lte",
                "v": "29",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 370,
        "y": 1520,
        "wires": [
            [
                "9b64ca80fcfdd45c"
            ],
            [
                "cf09b016fca93a9a"
            ]
        ]
    },
    {
        "id": "9b64ca80fcfdd45c",
        "type": "api-current-state",
        "z": "5622825b657d1a32",
        "name": "风扇状态",
        "server": "fad72bae547fbae9",
        "version": 3,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "switch.dlfan_fanlow",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 520,
        "y": 1500,
        "wires": [
            [
                "7390c8090becbeaf"
            ]
        ]
    },
    {
        "id": "7390c8090becbeaf",
        "type": "switch",
        "z": "5622825b657d1a32",
        "name": "开风扇判断",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "off",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 710,
        "y": 1500,
        "wires": [
            [
                "5601cf9c21aa12f5"
            ]
        ]
    },
    {
        "id": "5601cf9c21aa12f5",
        "type": "api-call-service",
        "z": "5622825b657d1a32",
        "name": "开风扇",
        "server": "fad72bae547fbae9",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "switch.dlfan_fanlow"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 870,
        "y": 1500,
        "wires": [
            []
        ]
    },
    {
        "id": "cf09b016fca93a9a",
        "type": "api-current-state",
        "z": "5622825b657d1a32",
        "name": "风扇状态",
        "server": "fad72bae547fbae9",
        "version": 3,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "switch.dlfan_fanlow",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 520,
        "y": 1560,
        "wires": [
            [
                "75591e42d7ca81ca"
            ]
        ]
    },
    {
        "id": "75591e42d7ca81ca",
        "type": "switch",
        "z": "5622825b657d1a32",
        "name": "关风扇判断",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "on",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 710,
        "y": 1560,
        "wires": [
            [
                "8243da03897e441e"
            ]
        ]
    },
    {
        "id": "8243da03897e441e",
        "type": "api-call-service",
        "z": "5622825b657d1a32",
        "name": "关风扇",
        "server": "fad72bae547fbae9",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_off",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "switch.dlfan_fanlow"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 870,
        "y": 1560,
        "wires": [
            []
        ]
    },
    {
        "id": "ab95ab62519444da",
        "type": "api-current-state",
        "z": "5622825b657d1a32",
        "name": "室温",
        "server": "fad72bae547fbae9",
        "version": 3,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "sensor.dlfan_wendu",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 250,
        "y": 1520,
        "wires": [
            [
                "c07d8641d6931fc5"
            ]
        ]
    },
    {
        "id": "ee04d6aa921ef629",
        "type": "inject",
        "z": "5622825b657d1a32",
        "name": "晚上开风扇",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "*/5 0-6 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 70,
        "y": 1520,
        "wires": [
            [
                "ab95ab62519444da"
            ]
        ]
    },
    {
        "id": "fad72bae547fbae9",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": false,
        "rejectUnauthorizedCerts": false,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": ": ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "default",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": false
    }
]

15.jpg
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-15 22:56 , Processed in 0.202430 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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