athombv / com.tuya

Tuya app for Homey
https://homey.app/a/com.tuya
17 stars 12 forks source link

[Device request]: Water level monitor #266

Open wojtek1150 opened 1 month ago

wojtek1150 commented 1 month ago

Device information:

https://www.eptsensor.com/level-monitor/tuya-intelligent-wifi-non-contact-tank-level.html

Suggested flows to add:

* when -> data_points ${code} is ${value}
* when -> data_points ${code} is lower than ${value}
* when -> data_points ${code} is higher than ${value}

Example: when -> liquid_level_percent is lower than 10 then -> send pusth notification...

Device specification

{
    "device": {
        "active_time": 1726588145,
        "biz_type": 0,
        "category": "ywcgq",
        "create_time": 1726588145,
        "icon": "smart/icon/bay1610529967139OoVI/9261e13c77ebab6069c9d189e3d146bd.png",
        "id": "bfc30f7466b63d1a3dtmdw",
        "ip": "<redacted>",
        "lat": "<redacted>",
        "local_key": "<redacted>",
        "lon": "<redacted>",
        "model": "",
        "name": "Irrigation tank level ",
        "online": true,
        "owner_id": "<redacted>",
        "product_id": "duked3tftwmz7plx",
        "product_name": "Tank A Level",
        "status": [
            {
                "code": "liquid_state",
                "value": "normal"
            },
            {
                "code": "liquid_depth",
                "value": 189
            },
            {
                "code": "max_set",
                "value": 100
            },
            {
                "code": "mini_set",
                "value": 10
            },
            {
                "code": "upper_switch",
                "value": false
            },
            {
                "code": "lower_switch",
                "value": true
            },
            {
                "code": "installation_height",
                "value": 3000
            },
            {
                "code": "liquid_depth_max",
                "value": 750
            },
            {
                "code": "liquid_level_percent",
                "value": 84
            }
        ],
        "sub": false,
        "time_zone": "+02:00",
        "uid": "<redacted>",
        "update_time": 1727132567,
        "uuid": "<redacted>"
    },
    "specifications": {
        "category": "ywcgq",
        "functions": [
            {
                "code": "max_set",
                "type": "Integer",
                "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
            },
            {
                "code": "mini_set",
                "type": "Integer",
                "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
            },
            {
                "code": "upper_switch",
                "type": "Boolean",
                "values": "{}"
            },
            {
                "code": "lower_switch",
                "type": "Boolean",
                "values": "{}"
            },
            {
                "code": "installation_height",
                "type": "Integer",
                "values": "{\"unit\":\"m\",\"min\":100,\"max\":3000,\"scale\":3,\"step\":1}"
            },
            {
                "code": "liquid_depth_max",
                "type": "Integer",
                "values": "{\"unit\":\"m\",\"min\":100,\"max\":2900,\"scale\":3,\"step\":1}"
            }
        ],
        "status": [
            {
                "code": "liquid_state",
                "type": "Enum",
                "values": "{\"range\":[\"normal\",\"lower_alarm\",\"upper_alarm\"]}"
            },
            {
                "code": "liquid_depth",
                "type": "Integer",
                "values": "{\"unit\":\"m\",\"min\":0,\"max\":10000,\"scale\":2,\"step\":1}"
            },
            {
                "code": "max_set",
                "type": "Integer",
                "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
            },
            {
                "code": "mini_set",
                "type": "Integer",
                "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
            },
            {
                "code": "upper_switch",
                "type": "Boolean",
                "values": "{}"
            },
            {
                "code": "lower_switch",
                "type": "Boolean",
                "values": "{}"
            },
            {
                "code": "installation_height",
                "type": "Integer",
                "values": "{\"unit\":\"m\",\"min\":100,\"max\":3000,\"scale\":3,\"step\":1}"
            },
            {
                "code": "liquid_depth_max",
                "type": "Integer",
                "values": "{\"unit\":\"m\",\"min\":100,\"max\":2900,\"scale\":3,\"step\":1}"
            },
            {
                "code": "liquid_level_percent",
                "type": "Integer",
                "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
            }
        ]
    },
    "data_points": [
        {
            "code": "liquid_state",
            "custom_name": "",
            "dp_id": 1,
            "time": 1727112073256,
            "type": "enum",
            "value": "normal"
        },
        {
            "code": "liquid_depth",
            "custom_name": "",
            "dp_id": 2,
            "time": 1727112723850,
            "type": "value",
            "value": 189
        },
        {
            "code": "max_set",
            "custom_name": "",
            "dp_id": 7,
            "time": 1726589277926,
            "type": "value",
            "value": 100
        },
        {
            "code": "mini_set",
            "custom_name": "",
            "dp_id": 8,
            "time": 1726589470666,
            "type": "value",
            "value": 10
        },
        {
            "code": "upper_switch",
            "custom_name": "",
            "dp_id": 14,
            "time": 1726589477010,
            "type": "bool",
            "value": false
        },
        {
            "code": "lower_switch",
            "custom_name": "",
            "dp_id": 15,
            "time": 1726589441755,
            "type": "bool",
            "value": true
        },
        {
            "code": "installation_height",
            "custom_name": "",
            "dp_id": 19,
            "time": 1726589378675,
            "type": "value",
            "value": 3000
        },
        {
            "code": "liquid_depth_max",
            "custom_name": "",
            "dp_id": 21,
            "time": 1726589455111,
            "type": "value",
            "value": 750
        },
        {
            "code": "liquid_level_percent",
            "custom_name": "",
            "dp_id": 22,
            "time": 1727112710150,
            "type": "value",
            "value": 84
        }
    ]
}
bobvandevijver commented 4 weeks ago

Regarding the suggested flows: you can already do that using the logic cards.

wojtek1150 commented 1 week ago

Yea, but only for exact value but it wont work anyway :( Also in device list there is no info. You'll only get "everything ok, you can use this device". According to data points this could display some data in sensor tab for example, like for zehner. Also could be liquid level option in status indicator :)

image
bobvandevijver commented 1 week ago

I believe you misunderstood: your device type has been added to the request list. My comment was only regarding your question for the datapoint flows, which is already possible with the logic cards.