athombv / com.tuya

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

Further Improve the unknown device functionality #136

Closed mruiter closed 1 month ago

mruiter commented 2 months ago

Homey version

All

Tuya app version

1.2 Latest

App diagnostics report ID

None

Description

Improve unknown device functionality:

The function kinda works . The auto fill of the values is missing a lot of available values. And since i can only select the values that came back in the app and my own values that i know that get reported since they work great in the community app it's still not functioning like it should.

The Athom tuya app gives me 12 different values combined with the text bool number etc

The community app gives me 39 ! values to read from Thats a big difference , most of the important values are missing

Looks like the Athom app is just using the "Standard Instruction Set" and not the bigger device related "Standard Status Set"

Device specification

No response

bobvandevijver commented 2 months ago

Can you please share some more information about the device this issue holds for?

mruiter commented 2 months ago

This is what the homey json looks line in de advanced tab:

{
    "device": {
        "active_time": 1707301669,
        "biz_type": 18,
        "category": "znrb",
        "create_time": 1707301669,
        "icon": "smart/icon/bay16302847342400WtY/9831a0d3f6be36e5b3840235bfc39c63.png",
        "id": "bfc9c6d6ded27c80a3im4n",
        "ip": "<redacted>",
        "lat": "<redacted>",
        "local_key": "<redacted>",
        "lon": "<redacted>",
        "model": "",
        "name": "Intelligente drievoudige warmtepomp",
        "online": true,
        "owner_id": "<redacted>",
        "product_id": "g9m7honkxjweukvt",
        "product_name": "Intelligent Heat Pump",
        "status": [
            {
                "code": "switch",
                "value": false
            },
            {
                "code": "mode",
                "value": "heating"
            },
            {
                "code": "temp_set",
                "value": 20
            },
            {
                "code": "water_set",
                "value": 1
            },
            {
                "code": "countdown_left",
                "value": 398
            },
            {
                "code": "temp_current",
                "value": 250
            },
            {
                "code": "power_consumption",
                "value": 0
            },
            {
                "code": "compressor_strength",
                "value": 0
            },
            {
                "code": "temp_top",
                "value": 32
            },
            {
                "code": "temp_bottom",
                "value": 31
            },
            {
                "code": "compressor_state",
                "value": true
            },
            {
                "code": "defrost_state",
                "value": false
            }
        ],
        "sub": false,
        "time_zone": "+01:00",
        "uid": "<redacted>",
        "update_time": 1722870361,
        "uuid": "<redacted>"
    },
    "specifications": {
        "category": "znrb",
        "functions": [
            {
                "code": "switch",
                "desc": "{}",
                "name": "开关",
                "type": "Boolean",
                "values": "{}"
            },
            {
                "code": "mode",
                "desc": "{\"range\":[\"cold\",\"heating\"]}",
                "name": "模式",
                "type": "Enum",
                "values": "{\"range\":[\"cold\",\"heating\"]}"
            },
            {
                "code": "temp_set",
                "desc": "{\"unit\":\"℃\",\"min\":5,\"max\":75,\"scale\":0,\"step\":1}",
                "name": "温度设置",
                "type": "Integer",
                "values": "{\"unit\":\"℃\",\"min\":5,\"max\":75,\"scale\":0,\"step\":1}"
            },
            {
                "code": "water_set",
                "desc": "{\"unit\":\"L\",\"min\":0,\"max\":1,\"scale\":0,\"step\":1}",
                "name": "水位设置",
                "type": "Integer",
                "values": "{\"unit\":\"L\",\"min\":0,\"max\":1,\"scale\":0,\"step\":1}"
            }
        ],
        "status": [
            {
                "code": "switch",
                "name": "开关",
                "type": "Boolean",
                "values": "{}"
            },
            {
                "code": "mode",
                "name": "模式",
                "type": "Enum",
                "values": "{\"range\":[\"cold\",\"heating\"]}"
            },
            {
                "code": "temp_set",
                "name": "温度设置",
                "type": "Integer",
                "values": "{\"unit\":\"℃\",\"min\":5,\"max\":75,\"scale\":0,\"step\":1}"
            },
            {
                "code": "water_set",
                "name": "水位设置",
                "type": "Integer",
                "values": "{\"unit\":\"L\",\"min\":0,\"max\":1,\"scale\":0,\"step\":1}"
            },
            {
                "code": "countdown_left",
                "name": "倒计时剩余时间",
                "type": "Integer",
                "values": "{\"unit\":\"\",\"min\":0,\"max\":2000,\"scale\":0,\"step\":1}"
            },
            {
                "code": "temp_current",
                "name": "当前温度",
                "type": "Integer",
                "values": "{\"unit\":\"P\",\"min\":-500,\"max\":500,\"scale\":0,\"step\":1}"
            },
            {
                "code": "power_consumption",
                "name": "耗电量",
                "type": "Integer",
                "values": "{\"unit\":\"kW·h\",\"min\":0,\"max\":200000,\"scale\":2,\"step\":1}"
            },
            {
                "code": "compressor_strength",
                "name": "压缩机强度",
                "type": "Integer",
                "values": "{\"unit\":\"Hz\",\"min\":0,\"max\":200,\"scale\":0,\"step\":1}"
            },
            {
                "code": "temp_top",
                "name": "上水箱温度",
                "type": "Integer",
                "values": "{\"unit\":\"℃\",\"min\":-50,\"max\":150,\"scale\":0,\"step\":1}"
            },
            {
                "code": "temp_bottom",
                "name": "下水箱温度",
                "type": "Integer",
                "values": "{\"unit\":\"℃\",\"min\":-50,\"max\":150,\"scale\":0,\"step\":1}"
            },
            {
                "code": "compressor_state",
                "name": "压缩机状态",
                "type": "Boolean",
                "values": "{}"
            },
            {
                "code": "defrost_state",
                "name": "除霜状态",
                "type": "Boolean",
                "values": "{}"
            }
        ]
    }
}

And when i use the community app i can use all of this that reports back:

switch Boolean "{true,false}"
mode Enum { "range": [ "cold", "heating", "floor_heating", "hot_water", "cold_and_hotwater", "heating_and_hot_water", "floor_heatign_and_hot_water" ] }
temp_set Integer { "unit": "℃", "min": 5, "max": 75, "scale": 0, "step": 1 }
work_mode Enum { "range": [ "ECO", "Normal", "Boost" ] }
water_set Integer { "unit": "L", "min": 0, "max": 1, "scale": 0, "step": 1 }
capacity_set Enum { "range": [ "OFF", "H1", "H2", "H3", "H4" ] }
countdown_set Enum { "range": [ "OFF", "H1", "H2", "H3", "H4", "H5", "H6", "H7", "H8", "L1", "L2", "L3", "L4", "L5", "L6", "L7", "L8" ] }
countdown_left Integer { "unit": "", "min": 0, "max": 2000, "scale": 0, "step": 1 }
fault Bitmap { "label": [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30" ], "maxlen": 30 }
temp_current Integer { "unit": "P", "min": -500, "max": 500, "scale": 0, "step": 1 }
power_consumption Integer { "unit": "kW·h", "min": 0, "max": 200000, "scale": 2, "step": 1 }
compressor_strength Integer { "unit": "Hz", "min": 0, "max": 200, "scale": 0, "step": 1 }
temp_top Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
temp_bottom Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
coiler_temp Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
venting_temp Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
effluent_temp Integer { "unit": "P", "min": -500, "max": 500, "scale": 0, "step": 1 }
around_temp Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
compressor_state Boolean "{true,false}"
backwater Boolean "{true,false}"
defrost_state Boolean "{true,false}"
temp_current_f Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
top_temp_f Integer { "unit": "℉", "min": -50, "max": 150, "scale": 0, "step": 1 }
bottom_temp_f Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
around_temp_f Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
venting_temp_f Integer { "unit": "L/min", "min": 0, "max": 100, "scale": 0, "step": 1 }
effluent_temp_f Integer { "unit": "Hz", "min": 0, "max": 100, "scale": 0, "step": 1 }
coiler_temp_f Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
minitemp_set Integer { "unit": "℃", "min": 10, "max": 75, "scale": 0, "step": 1 }
cur_current Integer { "unit": "A", "min": 0, "max": 99999, "scale": 3, "step": 1 }
voltage_current Integer { "unit": "V", "min": 0, "max": 9999, "scale": 1, "step": 1 }
cur_power Integer { "unit": "W", "min": 0, "max": 500000, "scale": 1, "step": 1 }
electric_total Integer { "unit": "kW·h", "min": 0, "max": 9999999, "scale": 2, "step": 1 }
volume_set Integer { "unit": "", "min": 0, "max": 2, "scale": 0, "step": 1 }
eviin Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
eviout Integer { "unit": "℃", "min": -50, "max": 150, "scale": 0, "step": 1 }
b_cur Integer { "unit": "A", "min": 0, "max": 99999, "scale": 3, "step": 1 }
c_cur Integer { "unit": "A", "min": 0, "max": 99999, "scale": 3, "step": 1 }
bv Integer { "unit": "V", "min": 0, "max": 10000, "scale": 1, "step": 1 }
cv Integer { "unit": "V", "min": 0, "max": 10000, "scale": 1, "step": 1 }
bobvandevijver commented 2 months ago

@mruiter Which exact community app are you referring to? Tuya or Tuya cloud?

mruiter commented 2 months ago

The Tuya Cloud

https://homey.app/nl-nl/app/com.tuya.cloud/Tuya-cloud/

mruiter commented 2 months ago

Here is a one example flow that uses the community i marked two of the values the athom app doesnt see

tuya

mruiter commented 2 months ago

If you like i can give you access to my tuya ID and the tuya smart developer center where the device is in

bobvandevijver commented 2 months ago

@mruiter Can you share your device with me (open the device settings, share device and generate a link)? You won't want to put that here, but you should be able to find my email address quite easily.

mruiter commented 2 months ago

You should have gotten the invite on Drenso

You will find all values (most of them are all missing) the "opgericht"(no clue why its valled that) and then query.

bobvandevijver commented 2 months ago

Thank you for sharing the device with us. We have now seen where the difference comes from: Tuya devices internally use data points, which can be fully configured for each device and depends on whatever the manufacturer needs or wants. Next to that, Tuya offers a standard instruction/status set. But, in order to utilise the standard instructions/status information, a mapping with the data points must be made. It appears that that is either not done (for certain devices) or partially done. For the device you have this has been done partially, which is why you only see the limited options.

We will be looking into exposing all data points through those flow cards. We will most probably not map it to Homey capabilities as we are using the standard sets for a good reason: they are the standard set related to a device category. But making the values available in flows is a great feature.

mruiter commented 2 months ago

For this particular device there was also a user device add request .I’m in the car so I can’t look up the #id but it’s for the Adlar Heat Pump Maybee it’s handy dandy for you to have access to the device to fulfill the device support request for it on GitHub ?

bobvandevijver commented 2 months ago

I believe you refer to #141, we mostly need the device specification of the requested device there.

mruiter commented 2 months ago

Yes indeed #141

BerndGaykema commented 2 months ago

141 is my request. It's about the same device (Adlar Aurora II heat pump) as discussed in this threat.

I use the Smart Life app from Tuya to control the Aurora.

As far as I can see Bob, is that you received all requested device specifications in the replies from Marco Ruiter.

bobvandevijver commented 2 months ago

I just merged the change that will allow all datapoints to be control from the flow cards, which will become available with the next version 👍🏻

mruiter commented 2 months ago

Luv You 💋

mruiter commented 2 months ago

I downloaded the latest git and did a cli install.

In the advanced device info i can now see all the missing datapoints.

BUT, when i make a flow with the unknown device card is still cant select all these extra datapoint and still just gives me the basic ones just like before. I Guess there alse needs to come a update in the unknown device flows for it to see the new datapoints added in this update

bobvandevijver commented 2 months ago

@mruiter I think you made a mistake somewhere, I am seeing all different datapoints for your device just fine. Maybe you selected the string card instead of the number and/or boolean one?

image

mruiter commented 2 months ago

Strange , just did a clean clone from github and a build / install. Removed the device and readded , still only the points in advanced device info not in flows.

These are all the values , missing the new ponts. I'll just wait until the update hits the appstore under test . I dont think i'm doing anything wrong installing and building but let see if that makes a differemce

missing

mruiter commented 2 months ago

While i was posting i did a restart of homey .. Guess what , now they are there . Guess something was cached somewhere.

mruiter commented 2 months ago

Back again , and i did a extra reboot of homey just to be sure..

I made flows with the new available values like venting_temp_f , compressor_strengh and coiler_temp_f

In the tuya cloud dev page in debug i see these messages post a lot of new values in the log. But the Tuya app doesnt process/sees these values . I push them into variables and also in a push message but non of the new datapoints process new values.

The "normal" values report just like always at the same time i see them pass in de tuya cloud develp portal debug window. homeyad

bobvandevijver commented 2 months ago

As mentioned in the card hint, data points might not be reported. I have seen data points being reported when toggling some settings for the other device shared with me, but that device does not have any standard status properties so that might be related, or the fact that that device has been added using Tuya Smart instead of Smart Life.

@HenkRenting As that other device is yours, can you maybe test the new data point support and verify whether reporting is working for your data points? I did test the sound setting (and that works), but I did not test the ones that actually change the operating state.

mruiter commented 2 months ago

Hello Bob,

Then the strange thing is that the community app does report all data from these datapoints. I have them running both atm . The community app gets all reports on all datapoints. At the moment the ventimg_temp_f is the wather flow speed and is giving 3 to 4 new numbers every minute

Bob van de Vijver schreef op 2024-08-28 09:57:

As mentioned in the card hint, data points might not be reported. I have seen data points being reported when toggling some settings for the other device shared with me, but that device does not have any standard status properties so that might be related, or the fact that that device has been added using Tuya Smart instead of Smart Life.

@HenkRenting [1] As that other device is yours, can you maybe test the new data point support and verify whether reporting is working for your data points? I did test the sound setting (and that works), but I did not test the ones that actually change the operating state.

-- Reply to this email directly, view it on GitHub [2], or unsubscribe [3]. You are receiving this because you were mentioned.Message ID: @.***>

Links:

[1] https://github.com/HenkRenting [2] https://github.com/athombv/com.tuya/issues/136#issuecomment-2314596079 [3] https://github.com/notifications/unsubscribe-auth/AEHK6DYGN5FRTBANQZRVBGTZTV7GDAVCNFSM6AAAAABMIZMYRCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJUGU4TMMBXHE

HenkRenting commented 2 months ago

@HenkRenting As that other device is yours, can you maybe test the new data point support and verify whether reporting is working for your data points? I did test the sound setting (and that works), but I did not test the ones that actually change the operating state.

I would love to @bobvandevijver, but... I downloaded the current .zip from github here and installed it via CLI. When I try to add a "uknown" device I get a blank screen after login in the Tuya API. So right after I click "Confirm Authorization" in this screen: Tuya confirm authorization this screen closed and in Homey I see the following blank screen: Login Homey When doing all this from the Homey (Android) app, I just see the blank screen with the text "Login met je account". When doing all this from my.homey.app I also see the above shown popup with the text "OAuth2 Client already exits"

Furthermore the capcha's of Tuya ("completing the puzzle") still needs several attempts. Both in the Homey (Android) app and in my.homey.app.

By the way: feel free to test the other settings/datapoints as well, the device is not being used at the moment, so you can "freewheel" as much as you want... :-)

bobvandevijver commented 1 month ago

So, I have great news: it seems that we have found why not all data points are reported, which is due to some interesting behaviour on the Tuya side. Luckily, it seems that we can fix that with some adjustment on our side. Work in progress, when I know more I will let you know.

mruiter commented 1 month ago

Are you still available for marriage ? 💋Great news 👌Verstuurd vanaf mijn iPhoneOp 11 sep 2024 om 14:57 heeft Bob van de Vijver @.***> het volgende geschreven: So, I have great news: it seems that we have found why not all data points are reported, which is due to some interesting behaviour on the Tuya side. Luckily, it seems that we can fix that with some adjustment on our side. Work in progress, when I know more I will let you know.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

HenkRenting commented 1 month ago

Great news indeed, @bobvandevijver! Thanks for that. Please let me know if I can do anything to test.

kaohlive commented 1 month ago

So, I have great news: it seems that we have found why not all data points are reported, which is due to some interesting behaviour on the Tuya side. Luckily, it seems that we can fix that with some adjustment on our side. Work in progress, when I know more I will let you know.

Excellent news, let us know when we can validate 👍🏻👍🏻👍🏻

bobvandevijver commented 1 month ago

Alright, I believe that with version 1.3.3 (now in test) the issues with missing updates should be fully resolved!

@mruiter I've seen venting_temp_f work, and also for my own test devices additional data is now being reported :+1:

I will be closing this ticket now: if there are still messages missing please open a new ticket accompanied with a diagnostics report made when you would have expected something to be changed.

mruiter commented 1 month ago

@bobvandevijver thanks so much for this.

I Can confirm its working like a charm. I updated it and works on the multiple devices i have these missing reports on !!!!