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

 找回密码
 立即注册
查看: 597|回复: 4

[已解决] 如何在某个时间段内保持灯具的打开

[复制链接]

4

主题

66

帖子

627

积分

高级会员

Rank: 4

积分
627
金钱
561
HASS币
0
发表于 2023-11-3 20:25:56 | 显示全部楼层 |阅读模式
本帖最后由 佚蓝 于 2023-11-8 08:55 编辑

我是想在太阳下山之后自动打开鞋柜灯,同时如果发生了手动关闭了鞋柜灯,能够再次自动打开;
我按照下图这么写了之后,当我打开鞋柜灯之后,再去手动关闭的时候,确实会因为鞋柜灯状态变化再走一遍流程,但是鞋柜灯并不会再次打开
Snipaste_2023-11-03_20-26-41.jpg
请教一下大佬我这么设置是有问题吗?

回复

使用道具 举报

15

主题

311

帖子

2274

积分

金牌会员

Rank: 6Rank: 6

积分
2274
金钱
1963
HASS币
0
发表于 2023-11-3 22:00:48 | 显示全部楼层
仿照你的流程搭建了一个,测试太阳下山状态下,手动关灯后是能自动开灯的,流程代码如下,供你对照:
[
    {
        "id": "13a1667ffa659edf",
        "type": "server-state-changed",
        "z": "e56cc24c07e9fb83",
        "name": "",
        "server": "39747b58.21e974",
        "version": 5,
        "outputs": 2,
        "exposeAsEntityConfig": "",
        "entityId": "sun.sun",
        "entityIdType": "exact",
        "outputInitially": false,
        "stateType": "str",
        "ifState": "below_horizon",
        "ifStateType": "str",
        "ifStateOperator": "is",
        "outputOnlyOnStateChange": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 680,
        "y": 1600,
        "wires": [
            [
                "b618a4aa5d309c67"
            ],
            [
                "1d7ca66cf44f2217"
            ]
        ]
    },
    {
        "id": "030c82cb3f1734be",
        "type": "api-current-state",
        "z": "e56cc24c07e9fb83",
        "name": "",
        "server": "39747b58.21e974",
        "version": 3,
        "outputs": 2,
        "halt_if": "below_horizon",
        "halt_if_type": "str",
        "halt_if_compare": "is",
        "entity_id": "sun.sun",
        "state_type": "str",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "entity"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 680,
        "y": 1660,
        "wires": [
            [
                "d6a921908832e78c",
                "b618a4aa5d309c67"
            ],
            [
                "2b46a9b1892e9716",
                "1d7ca66cf44f2217"
            ]
        ]
    },
    {
        "id": "634c99a178e9971d",
        "type": "inject",
        "z": "e56cc24c07e9fb83",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 370,
        "y": 1620,
        "wires": [
            [
                "030c82cb3f1734be"
            ]
        ]
    },
    {
        "id": "d6a921908832e78c",
        "type": "debug",
        "z": "e56cc24c07e9fb83",
        "name": "debug 12",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 980,
        "y": 1680,
        "wires": []
    },
    {
        "id": "2b46a9b1892e9716",
        "type": "debug",
        "z": "e56cc24c07e9fb83",
        "name": "debug 13",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 980,
        "y": 1720,
        "wires": []
    },
    {
        "id": "b618a4aa5d309c67",
        "type": "api-call-service",
        "z": "e56cc24c07e9fb83",
        "name": "",
        "server": "39747b58.21e974",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "switch.sonoff_10005416d9_led"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1000,
        "y": 1580,
        "wires": [
            []
        ]
    },
    {
        "id": "1d7ca66cf44f2217",
        "type": "api-call-service",
        "z": "e56cc24c07e9fb83",
        "name": "",
        "server": "39747b58.21e974",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_off",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "switch.sonoff_10005416d9_led"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1000,
        "y": 1640,
        "wires": [
            []
        ]
    },
    {
        "id": "6c56ed2411229334",
        "type": "server-state-changed",
        "z": "e56cc24c07e9fb83",
        "name": "",
        "server": "39747b58.21e974",
        "version": 5,
        "outputs": 2,
        "exposeAsEntityConfig": "",
        "entityId": "switch.sonoff_10005416d9_led",
        "entityIdType": "exact",
        "outputInitially": false,
        "stateType": "str",
        "ifState": "off",
        "ifStateType": "str",
        "ifStateOperator": "is",
        "outputOnlyOnStateChange": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 260,
        "y": 1680,
        "wires": [
            [
                "030c82cb3f1734be"
            ],
            [
                "030c82cb3f1734be"
            ]
        ]
    },
    {
        "id": "39747b58.21e974",
        "type": "server",
        "name": "Home Assistant",
        "version": 5,
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "30",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "friendlyName",
        "statusSeparator": "at: ",
        "statusYear": "hidden",
        "statusMonth": "short",
        "statusDay": "numeric",
        "statusHourCycle": "h23",
        "statusTimeFormat": "h:m:s",
        "enableGlobalContextStore": true
    }
]
回复

使用道具 举报

0

主题

108

帖子

825

积分

高级会员

Rank: 4

积分
825
金钱
717
HASS币
0
发表于 2023-11-4 13:37:30 | 显示全部楼层
学习了。备用
回复

使用道具 举报

4

主题

66

帖子

627

积分

高级会员

Rank: 4

积分
627
金钱
561
HASS币
0
 楼主| 发表于 2023-11-4 21:42:43 | 显示全部楼层
cjnt007 发表于 2023-11-3 22:00
仿照你的流程搭建了一个,测试太阳下山状态下,手动关灯后是能自动开灯的,流程代码如下,供你对照:
...

我直接复制了你的也不行,不晓得为啥子
回复

使用道具 举报

4

主题

66

帖子

627

积分

高级会员

Rank: 4

积分
627
金钱
561
HASS币
0
 楼主| 发表于 2023-11-4 21:55:20 | 显示全部楼层
本帖最后由 佚蓝 于 2023-11-4 21:56 编辑
cjnt007 发表于 2023-11-3 22:00
仿照你的流程搭建了一个,测试太阳下山状态下,手动关灯后是能自动开灯的,流程代码如下,供你对照:
...

我知道我的为啥出问题了,之前aqara的开关通过homekit反接hass之后显示的是switch,后面我用辅助元素改成了light,通过辅助元素控制就不行,利用反接进来的switch控制去设置流程就没问题
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-6 04:35 , Processed in 0.139242 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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