请选择 进入手机版 | 继续访问电脑版

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

 找回密码
 立即注册
查看: 2374|回复: 1

[流程系列] 求助 如何转换数值

[复制链接]

3

主题

54

帖子

441

积分

中级会员

Rank: 3Rank: 3

积分
441
金钱
387
HASS币
0
发表于 2020-7-20 23:33:06 | 显示全部楼层 |阅读模式
本帖最后由 xiaobao80 于 2020-7-20 23:36 编辑

流程:
[
    {
        "id": "2348bc82.8796bc",
        "type": "tab",
        "label": "流程 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "46787d50.95be24",
        "type": "tcp in",
        "z": "2348bc82.8796bc",
        "name": "",
        "server": "client",
        "host": "192.168.1.100",
        "port": "26",
        "datamode": "stream",
        "datatype": "buffer",
        "newline": "",
        "topic": "",
        "base64": false,
        "x": 160,
        "y": 160,
        "wires": [
            [
                "4f93bd68.1e904c",
                "c1156076.a065f"
            ]
        ]
    },
    {
        "id": "4f93bd68.1e904c",
        "type": "change",
        "z": "2348bc82.8796bc",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "[161]",
                "fromt": "msg",
                "to": "1",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 160,
        "wires": [
            [
                "c7adad59.aefd68"
            ]
        ]
    },
    {
        "id": "c1156076.a065f",
        "type": "debug",
        "z": "2348bc82.8796bc",
        "name": "tcp1",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 330,
        "y": 80,
        "wires": []
    },
    {
        "id": "c7adad59.aefd68",
        "type": "debug",
        "z": "2348bc82.8796bc",
        "name": "修改1",
        "active": true,
        "tosidebar": true,
        "console": true,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 720,
        "y": 160,
        "wires": []
    }
]

液晶面板发送自定义指令 如 11或1a 等类似;tcp in 收到的数据如何转换成1或者0(布尔 true flase),控制其它设备开关。谢谢!!


WX20200720-233501@2x.png
回复

使用道具 举报

0

主题

5

帖子

102

积分

注册会员

Rank: 2

积分
102
金钱
97
HASS币
0
发表于 2020-7-22 16:44:13 | 显示全部楼层
msg.payload>>0&true;
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-3-29 02:09 , Processed in 0.060337 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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