Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya integrated EV-charger (single phase, 32A 85-264v, 7,4 kwh) #1149

Closed
Striiter opened this issue Oct 7, 2023 · 25 comments
Closed

Tuya integrated EV-charger (single phase, 32A 85-264v, 7,4 kwh) #1149

Striiter opened this issue Oct 7, 2023 · 25 comments

Comments

@Striiter
Copy link

Striiter commented Oct 7, 2023

This is a Tuya EV charger, single phase 32a supports 85v to 264v. It uses Smart Life app, but it seems like other Tuya EV chargers use the same API (without confirming it)
link: https://www.aliexpress.com/item/1005005504929776.html?spm=a2g0o.order_list.order_list_main.48.4dbb1802z6vKSl

Log:

2023-09-26 23:36:15.707 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches dooya_curtain with quality of 31%. DPS: {"updated_at": 1695764174.6401825, "10": 0, "101": "no_connect", "102": 32, "103": true, "104": 0, "106": 0, "107": 229, "108": 0, "109": 0, "110": 413, "112": false, "113": 0, "114": 0}

DPS:
{"updated_at": 1695764174.6401825,
"10": 0,
"101": "no_connect",
Amps: "102": 32,
"103": true,
"104": 0,
"106": 0,
Voltage "107": 229,
"108": 0,
"109": 0,
"110": 413,
"112": false,
"113": 0,
"114": 0}

https://github.com/make-all/tuya-local/issues/new?assignees=&labels=new+device&projects=&template=new-device.md&title=Request+support+for+%5Bdevice+description%5D

API:

curl --request GET "https://openapi.tuyaeu.com/v2.0/cloud/thing/bfe9b32545f5176313izm1/model" --header "sign_method: HMAC-SHA256" --header "client_id: amud3mjp94mk3ys9htcu" --header "t: 1695764754888" --header "mode: cors" --header "Content-Type: application/json" --header "sign: 7DA40862FA91BFC4F76BA9F4D864A5553A139EE5A75C5B959E199F168658E2AD" --header "access_token: 1439e123e9726f509bf0328e6554d43b" 

{
"code": 28841002,
"msg": "No permissions. Your subscription to cloud development plan has expired.",
"success": false,
"t": 1695764750849,
"tid": "0f72c7925cb611ee8665fe445e07f2df"
}

DP’S:
Work State
Code 3
Type: Enum
{
"range": [
"charger_free",
"charger_insert",
"charger_free_fault",
"charger_wait",
"charger_charging",
"charger_pause",
"charger_end",
"charger_fault"
]
}

Fault
Code 10
Type: Bitmap.
{
"label": [
"ERR_UVP",
"ERR_OVP",
"ERR_OCP",
"ERR_PE",
"ERR_TEMP",
"ERR_CP",
"ERR_LEAK",
"ERR_RE_SCK",
"ERR_PE2",
"TEMP_PLUG",
"TEMP_PCB",
"TEMP_CORE",
"ESB",
"PE_SCK",
"LEAK_SCK",
"TEMP_SCK"
],
"maxlen": 16
}

Alarm Set 1
Code 11
Type: Raw
Unknown function

Alarm Set 2
Code 12
Type: Raw
Unkonwn function

Work Mode
Code 14
Type: Enum
{
"range": [
"charge_now",
"charge_pct",
"charge_energy",
"charge_schedule"
]
}

Balance Energy
Code 15
Type: Integer
{
"unit": "kW·h",
"min": 0,
"max": 99999999,
"scale": 3,
"step": 1
}

Clear Energy
Code 16
This will clear registered kwh displayed by the charger.
Type: Boolean
"{true,false}"

Switch:
Code 18
Type: Boolean
"{true,false}"

System Version
Code 23
Type: Boolean
"{true,false}"

Once Charge Energy
Code 25
Type: Integer
{
"unit": "kW·h",
"min": 1,
"max": 999999,
"scale": 2,
"step": 1
}

Online State
Code 27
Unknown - does not output value in tuya cloud

Equipment Status
Code 101
Connect/No Connect - meaning, if the charger detects and locks with the EV.

Set Charging Current
Code 102
8A/10A/13A/16A/25A/32Amp is what the manual says, but I’ve been able to change it in intervals of 1a from 8a to 32a

充电电流确认
Code 103
I think this is a confirmation of what selected Amp you’re currently using, or wish to set from listed above.

Delayed Charging
Code 104
In hours (devided by 10) - This is the option you set if you ie. want to delay charging by x hours.

VerificationSet
Code 105
Unknown function - My guess is that its a swhich you can enable if you want the charger to "learn" an RFID card, which have to be closed once done.

Energy
Code 106
In kwh. Ie. 0.00 kwh or 1.70 kwh used by the current charge session

Voltage
Code 107
In volt. Ie. 228V

Current
Code 108
Current current, ie. 0.00A (when not charging) or 15.8A (when charging)

Power
Code 109
In kwh. Ie. 0.00 kw or 5.60 kw

Temperature
Code 110
In Celsius, ie. 37.9 °C. This number needs to be devided by 10 since it spits out “379” for 37.9 degrees c

Set Charging Current
Code 111
8A/10A/13A/16A/25A/32Amp

Charging Selection
Code 112
Manual Stop charging / charging – like a switch

Time
Code 113
Delayed charging remaining (in hours, divided by 10) If you sat it at 4 hours beforehand, this will now show 400 or 399

Timed Charging
Code 114
Unknown

Other DP's with unkown DP_ID

Found these whilst browsing "Control Device with DP".

DeviceState
Type: Enum
{
"range": [
"no_connect",
"connect",
"charing",
"wait_rfid",
"finish",
"wait_charing",
"error"
]
}

Set32A
Type: Intiger
{
"unit": "A",
"min": 8,
"max": 32,
"scale": 0,
"step": 1
}

Set32Or16
Boolean
"{true,false}"

SetDelayTime
Type: Integer
{
"unit": "H",
"min": 0,
"max": 15,
"scale": 0,
"step": 1
}

IDVerificationSet
Type: Boolean
"{true,false}

Set16A
Type: Integer
{
"unit": "",
"min": 8,
"max": 16,
"scale": 0,
"step": 1
}

DeviceKwh
Type: Integer
{
"unit": "Kwh",
"min": 0,
"max": 10000,
"scale": 1,
"step": 1
}

InputVoltage
Type: Integer
{
"unit": "V",
"min": 0,
"max": 500,
"scale": 0,
"step": 1
}

OutCurrent
Type: Integer
{
"unit": "A",
"min": 0,
"max": 600,
"scale": 1,
"step": 1
}

DeviceKw
Type: Integer
{
"unit": "Kw",
"min": 0,
"max": 1000,
"scale": 1,
"step": 1
}

DeviceTemp
Type: Integer
{
"unit": " °C",
"min": -100,
"max": 1500,
"scale": 1,
"step": 1
}

SwipRfid ## note - this EV charger does not have RFID
Type: Boolean
"{true,false}"

SetDefineTime
Type: Integer
{
"unit": "H",
"min": 0,
"max": 15,
"scale": 0,
"step": 1
}

# Product ID
{
"code": 28841002,
"msg": "No permissions. Your subscription to cloud development plan has expired.",
"success": false,
"t": 1695765940186,
"tid": "d45d9d965cb811eebb19ce5fa22f6e19"
}

Link: https://www.aliexpress.com/item/1005005504929776.html?spm=a2g0o.order_list.order_list_main.48.4dbb1802z6vKSl

Extra things i had exported through the LocalKey extraction:

iconUrl https://images.tuyaeu.com/smart/icon/bay16226250696545rLI/35878abfb9cc339489fd3272154de112.png
verSw 2.5.2
MCU: v1.0.0
productid hytatexziwaifxj1
Product "菲尔雷交流充电盒"

It updates voltage and state every 4 seconds

@Striiter Striiter added the new device Unsupported device label Oct 7, 2023
@Striiter Striiter changed the title Tuya integrated EV-charger Tuya integrated EV-charger (single phase, 32A 85-264v, 7,4 kwh) Oct 7, 2023
@make-all make-all moved this to 📋 Backlog in Tuya Local Oct 7, 2023
@make-all make-all added the log provided Log of dps has been provided, though it is short of full info, so some guessing is needed label Oct 7, 2023
@ve1koz111
Copy link

Have a very similar charger (feyree 32A 240V) and the datapoints are identical.

2023-10-09 00:12:14.879 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches loratap_zigbee_six_switch with quality of 8%. DPS: {"updated_at": 1696770732.7265275, "10": 0, "101": "charing", "102": 32, "104": 0, "106": 12, "107": 221, "108": 307, "109": 67, "110": 301, "112": false, "113": 1, "114": 0}
2023-10-09 00:12:14.884 WARNING (MainThread) [custom_components.tuya_local.config_flow] Report this to https://github.com/make-all/tuya-local/issues/

@make-all make-all moved this from 📋 Backlog to 🔖 Ready in Tuya Local Oct 8, 2023
@make-all
Copy link
Owner

make-all commented Oct 8, 2023

@ve1koz111, if you have access to the iot.tuya.com developer portal, perhaps you can get the results of the Query Things Data Model API call (in API Explorer) for your device, as it will help with clarifying some of the details of the data points.

@Striiter
Copy link
Author

Striiter commented Oct 8, 2023

Idk if this helps.

This is the official "Tuya" app, It tells me "AC Charging Box (unsupported) by Tuya"

In the textfile it gives me through the diagnostic is this:

},
"data": {
"endpoint": "https://openapi.tuyaeu.com",
"auth_type": 0,
"country_code": "45",
"app_type": "smartlife",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"name": "AC charging box",
"model": "",
"category": "qccdz",
"product_id": "hytatexziwaifxj1",
"product_name": "AC charging box",
"online": false,
"sub": false,
"time_zone": "+02:00",
"active_time": "2023-10-07T11:48:11+00:00",
"create_time": "2023-10-07T11:48:11+00:00",
"update_time": "2023-10-08T08:52:34+00:00",
"function": {
"fault": {
"type": "Bitmap",
"value": {
"label": [
"ERR_UVP",
"ERR_OVP",
"ERR_OCP",
"ERR_PE",
"ERR_TEMP",
"ERR_CP",
"ERR_LEAK",
"ERR_RE_SCK",
"ERR_PE2",
"TEMP_PLUG",
"TEMP_PCB",
"TEMP_CORE",
"ESB",
"PE_SCK",
"LEAK_SCK",
"TEMP_SCK"
],
"maxlen": 16
}
},
"alarm_set_1": {
"type": "Raw",
"value": {}
},
"alarm_set_2": {
"type": "Raw",
"value": {}
},
"work_mode": {
"type": "Enum",
"value": {
"range": [
"charge_now",
"charge_pct",
"charge_energy",
"charge_schedule"
]
}
},
"clear_energy": {
"type": "Boolean",
"value": {}
},
"switch": {
"type": "Boolean",
"value": {}
},
"online_state": {
"type": "Enum",
"value": {
"range": [
"online",
"offline"
]
}
},
"Set32A": {
"type": "Integer",
"value": {
"unit": "A",
"min": 8,
"max": 32,
"scale": 0,
"step": 1
}
},
"SetDelayTime": {
"type": "Integer",
"value": {
"unit": "H",
"min": 0,
"max": 15,
"scale": 0,
"step": 1
}
},
"IDVerificationSet": {
"type": "Boolean",
"value": {}
},
"Set16A": {
"type": "Integer",
"value": {
"unit": "",
"min": 8,
"max": 16,
"scale": 0,
"step": 1
}
},
"SwipRfid": {
"type": "Boolean",
"value": {}
},
"SetDefineTime": {
"type": "Integer",
"value": {
"unit": "H",
"min": 0,
"max": 15,
"scale": 0,
"step": 1
}
}
},
"status_range": {
"work_state": {
"type": "Enum",
"value": {
"range": [
"charger_free",
"charger_insert",
"charger_free_fault",
"charger_wait",
"charger_charging",
"charger_pause",
"charger_end",
"charger_fault"
]
}
},
"fault": {
"type": "Bitmap",
"value": {
"label": [
"ERR_UVP",
"ERR_OVP",
"ERR_OCP",
"ERR_PE",
"ERR_TEMP",
"ERR_CP",
"ERR_LEAK",
"ERR_RE_SCK",
"ERR_PE2",
"TEMP_PLUG",
"TEMP_PCB",
"TEMP_CORE",
"ESB",
"PE_SCK",
"LEAK_SCK",
"TEMP_SCK"
],
"maxlen": 16
}
},
"alarm_set_1": {
"type": "Raw",
"value": {}
},
"alarm_set_2": {
"type": "Raw",
"value": {}
},
"work_mode": {
"type": "Enum",
"value": {
"range": [
"charge_now",
"charge_pct",
"charge_energy",
"charge_schedule"
]
}
},
"balance_energy": {
"type": "Integer",
"value": {
"unit": "kW\u00b7h",
"min": 0,
"max": 99999999,
"scale": 3,
"step": 1
}
},
"clear_energy": {
"type": "Boolean",
"value": {}
},
"switch": {
"type": "Boolean",
"value": {}
},
"system_version": {
"type": "String",
"value": {
"maxlen": 255
}
},
"charge_energy_once": {
"type": "Integer",
"value": {
"unit": "kW\u00b7h",
"min": 1,
"max": 999999,
"scale": 2,
"step": 1
}
},
"online_state": {
"type": "Enum",
"value": {
"range": [
"online",
"offline"
]
}
},
"DeviceState": {
"type": "Enum",
"value": {
"range": [
"no_connect",
"connect",
"charing",
"wait_rfid",
"finish",
"wait_charing",
"error"
]
}
},
"Set32A": {
"type": "Integer",
"value": {
"unit": "A",
"min": 8,
"max": 32,
"scale": 0,
"step": 1
}
},
"Set32Or16": {
"type": "Boolean",
"value": {}
},
"SetDelayTime": {
"type": "Integer",
"value": {
"unit": "H",
"min": 0,
"max": 15,
"scale": 0,
"step": 1
}
},
"IDVerificationSet": {
"type": "Boolean",
"value": {}
},
"DeviceKwh": {
"type": "Integer",
"value": {
"unit": "Kwh",
"min": 0,
"max": 10000,
"scale": 1,
"step": 1
}
},
"InputVoltage": {
"type": "Integer",
"value": {
"unit": "V",
"min": 0,
"max": 500,
"scale": 0,
"step": 1
}
},
"OutCurrent": {
"type": "Integer",
"value": {
"unit": "A",
"min": 0,
"max": 600,
"scale": 1,
"step": 1
}
},
"DeviceKw": {
"type": "Integer",
"value": {
"unit": "Kw",
"min": 0,
"max": 1000,
"scale": 1,
"step": 1
}
},
"DeviceTemp": {
"type": "Integer",
"value": {
"unit": " \u00b0C",
"min": -100,
"max": 1500,
"scale": 1,
"step": 1
}
},
"Set16A": {
"type": "Integer",
"value": {
"unit": "",
"min": 8,
"max": 16,
"scale": 0,
"step": 1
}
},
"SwipRfid": {
"type": "Boolean",
"value": {}
},
"ctime": {
"type": "Integer",
"value": {
"unit": "H",
"min": 0,
"max": 240,
"scale": 1,
"step": 1
}
},
"SetDefineTime": {
"type": "Integer",
"value": {
"unit": "H",
"min": 0,
"max": 15,
"scale": 0,
"step": 1
}
}
},
"status": {
"work_state": "charger_free",
"fault": 0,
"alarm_set_1": "",
"alarm_set_2": "",
"work_mode": "charge_now",
"balance_energy": 0,
"clear_energy": false,
"switch": false,
"system_version": "",
"charge_energy_once": 1,
"online_state": "online",
"DeviceState": "connect",
"Set32A": 8,
"Set32Or16": true,
"SetDelayTime": 0,
"IDVerificationSet": false,
"DeviceKwh": 0,
"InputVoltage": 222,
"OutCurrent": 0,
"DeviceKw": 0,
"DeviceTemp": 255,
"Set16A": 8,
"SwipRfid": false,
"ctime": 0,
"SetDefineTime": 0
},
"home_assistant": {
"name": "AC charging box",
"name_by_user": null,
"disabled": false,
"disabled_by": null,
"entities": []
}
}
}

@make-all
Copy link
Owner

make-all commented Oct 9, 2023

Thanks, yes this helps, the only thing missing is dp ids, which can be correlated from above, but that also indicates that it is likely cloud API docs, so if any of the enum values differ between cloud and local protocol it won't quite work (but probably 90% chance it will be OK).

@make-all make-all added full_info All info needed was provided and removed log provided Log of dps has been provided, though it is short of full info, so some guessing is needed labels Oct 9, 2023
make-all added a commit that referenced this issue Oct 9, 2023
@make-all make-all added awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release and removed full_info All info needed was provided labels Oct 9, 2023
@make-all make-all moved this from 🔖 Ready to ✅ Done in Tuya Local Oct 9, 2023
@make-all
Copy link
Owner

make-all commented Oct 9, 2023

I have added support for the dps that are showing in the logs. There are others which seem to be for setting different charging modes - I don't know if they are missing from the log because the charger does not support them, or because they are mode dependant. They have been added as optional attributes, mostly of the Status entity, so they are available for monitoring, if you can confirm that the device does send them in some modes, I can separate them into separate entities, particularly the config options that you want to be able to change rather than just monitor.

@Striiter
Copy link
Author

Striiter commented Oct 9, 2023

Thank you @make-all This was very quick! I will await release so i can test and give a comprehensive repport if i find bugs or such.

Thank you again.

Kind regards!

@flyingrayson
Copy link

flyingrayson commented Oct 12, 2023

Hello,

I have the same issue than ve1koz111. When I try to configure, my device is seen as a lora tap 6 switches.
The query you requests (query thigs data model) gives me :

=====

EDIT :
I have a different version of charger, mine is a wallbox : https://fr.aliexpress.com/item/1005006058252591.html?spm=a2g0o.productlist.main.91.72b31Epz1EpzpX&algo_pvid=994d2a40-6ce1-48cb-a176-5a8bc1e26d58&algo_exp_id=994d2a40-6ce1-48cb-a176-5a8bc1e26d58-45&pdp_npi=4%40dis%21EUR%21495.92%21342.19%21%21%213728.74%21%21%40211b5dec16971917862401978e374a%2112000035536201702%21sea%21FR%210%21AB&curPageLogUid=ErOoKrrBV2bf

I tried to take your feyree.yaml file and rewrite it in order to map the DPS and make their different types to match to the what is in the file below but it still does not work (still 6% match with Loratap zigbee switch).

I'm very bad at this... My understanding of your code is that there is a comparison of the DPS from the "devices".yaml file to something that must be coming from tuya or the device when you try to connect. Then if there is a 100% match, it's fine, if not, it gives you the best match with the one of the devices that are in the devices directory.

I don't get the distinction between primary entity and secondary entities and how to define it. Maybe it is not well defined in the yaml that I'm trying to edit and does not work, I don't know....

=====

{
"result": {
"model": "{"modelId":"000004b5t9","services":[{"actions":[],"code":"","description":"","events":[],"name":"默认服务","properties":[{"abilityId":3,"accessMode":"ro","code":"work_state","description":"","extensions":{"iconName":"icon-zhuangtai"},"name":"工作状态","typeSpec":{"range":["charger_free","charger_insert","charger_free_fault","charger_wait","charger_charging","charger_pause","charger_end","charger_fault"],"type":"enum","typeDefaultValue":"charger_free"}},{"abilityId":10,"accessMode":"ro","code":"fault","description":"","extensions":{"iconName":"icon-baojing","scope":"fault"},"name":"故障告警","typeSpec":{"label":["err_leak","err_cp","err_temp","warn_a_uvp","warn_b_uvp","warn_c_uvp","err_a_ovp","err_b_ovp","err_c_ovp","err_ocp","err_10","err_11","err_esb","warn_pe_sck","err_leak_sck"],"maxlen":15,"type":"bitmap","typeDefaultValue":0}},{"abilityId":11,"accessMode":"rw","code":"alarm_set_1","description":"1.1 名称:告警设置1\n1.2 含义:用于告知面板有哪些告警,对每个告警项进行设置,例如是否动作,动作阈值数值设置。\n2 格式:HEX格式,大端模式, 总告警的数量4字节= 设置告警总长度。\n3,报文格式\n每个告警由4个字节组成,第1个字节(表示该告警存在);第2个字节(发生此告警时,设备是否告警及保护动作;第3、4字节:设置告警阈值","extensions":{"iconName":"icon-dp_warming"},"name":"告警设置1","typeSpec":{"maxlen":128,"type":"raw"}},{"abilityId":12,"accessMode":"rw","code":"alarm_set_2","description":"1.1 名称:告警设置2\n1.2 含义:用于告知面板有哪些告警,对每个告警项进行设置,例如是否动作,动作阈值数值设置。\n2 格式:HEX格式,大端模式, 总告警的数量4字节= 设置告警总长度。\n3,报文格式\n每个告警由4个字节组成,第1个字节(表示该告警存在);第2个字节(发生此告警时,设备是否告警及保护动作;第3、4字节:设置告警阈值","extensions":{"iconName":"icon-dp_warming"},"name":"告警设置2","typeSpec":{"maxlen":128,"type":"raw"}},{"abilityId":14,"accessMode":"rw","code":"work_mode","description":"","extensions":{"iconName":"icon-dp_mode","trigger":"direct"},"name":"工作模式","typeSpec":{"range":["charge_now","charge_pct","charge_energy","charge_schedule"],"type":"enum","typeDefaultValue":"charge_now"}},{"abilityId":15,"accessMode":"ro","code":"balance_energy","description":"","extensions":{"iconName":"icon-dp_lightning"},"name":"剩余可用电量","typeSpec":{"max":99999999,"min":0,"scale":3,"step":1,"type":"value","typeDefaultValue":0,"unit":"kW·h"}},{"abilityId":16,"accessMode":"rw","code":"clear_energy","description":"","extensions":{"iconName":"icon-dp_lightning"},"name":"电量清零","typeSpec":{"type":"bool","typeDefaultValue":false}},{"abilityId":18,"accessMode":"rw","code":"switch","description":"","extensions":{"iconName":"icon-dp_power2","trigger":"direct"},"name":"开关","typeSpec":{"type":"bool","typeDefaultValue":false}},{"abilityId":23,"accessMode":"ro","code":"system_version","description":"1.1 名称:充电桩软硬件版本号\n1.2 含义:硬件、固件等当前版本号\n2 格式\n 数据类型: string\n 功能属性: 最大长度128字节\n4 报文格式\n 举例:\"HW V1.0,SW V1.0.3\"","extensions":{"iconName":"icon-dp_mode"},"name":"系统版本","typeSpec":{"maxlen":255,"type":"string","typeDefaultValue":""}},{"abilityId":25,"accessMode":"ro","code":"charge_energy_once","description":"","extensions":{"iconName":"icon-Ele","attribute":"2048","trigger":"direct"},"name":"单次充电量","typeSpec":{"max":999999,"min":1,"scale":2,"step":1,"type":"value","typeDefaultValue":1,"unit":"kW·h"}},{"abilityId":27,"accessMode":"rw","code":"online_state","description":"","extensions":{"iconName":"icon-dp_updown"},"name":"在线状态","typeSpec":{"range":["online","offline"],"type":"enum","typeDefaultValue":"online"}},{"abilityId":101,"accessMode":"ro","code":"DeviceState","description":"","name":"设备状态","typeSpec":{"range":["no_connet","connect","charing","wait_rfid","finish","wait_charing","error"],"type":"enum","typeDefaultValue":"no_connet"}},{"abilityId":102,"accessMode":"ro","code":"A_Voltage","description":"","name":"A相电压","typeSpec":{"max":3200,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"V"}},{"abilityId":103,"accessMode":"ro","code":"B_Voltage","description":"","name":"B相电压","typeSpec":{"max":3200,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"V"}},{"abilityId":104,"accessMode":"ro","code":"C_Voltage","description":"","name":"C相电压","typeSpec":{"max":3200,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"V"}},{"abilityId":105,"accessMode":"ro","code":"A_Current","description":"","name":"A相电流","typeSpec":{"max":600,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"A"}},{"abilityId":106,"accessMode":"ro","code":"B_Current","description":"","name":"B相电流","typeSpec":{"max":600,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"A"}},{"abilityId":107,"accessMode":"ro","code":"C_Current","description":"","name":"C相电流","typeSpec":{"max":600,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"A"}},{"abilityId":108,"accessMode":"ro","code":"PhaseFlag","description":"","name":"单三相接入标志","typeSpec":{"range":["Single_phase","Three_phase","No_phase","Phase_err"],"type":"enum","typeDefaultValue":"Single_phase"}},{"abilityId":109,"accessMode":"ro","code":"DeviceKw","description":"","name":"设备总功率","typeSpec":{"max":1000,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"kW"}},{"abilityId":110,"accessMode":"ro","code":"DeviceTemp","description":"ID-111 为设备温度2 备用 ","name":"设备温度1","typeSpec":{"max":1050,"min":-300,"scale":1,"step":1,"type":"value","typeDefaultValue":-300,"unit":"℃"}},{"abilityId":111,"accessMode":"ro","code":"DeviceTemp2","description":"设备温度2 备用","name":"设备温度2","typeSpec":{"max":1050,"min":-300,"scale":1,"step":1,"type":"value","typeDefaultValue":-300,"unit":"℃"}},{"abilityId":112,"accessMode":"ro","code":"DeviceKwh","description":"一次充电的累计功率,拔枪后清零。","name":"累计功率","typeSpec":{"max":10000,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"kWh"}},{"abilityId":113,"accessMode":"ro","code":"DeviceMaxSetA","description":"","name":"设备最大充电电流","typeSpec":{"range":["Max16A","Max32A","Max40A","Max50A"],"type":"enum","typeDefaultValue":"Max16A"}},{"abilityId":114,"accessMode":"rw","code":"Set16A","description":"","name":"设置电流(16A)","typeSpec":{"max":16,"min":8,"scale":0,"step":1,"type":"value","typeDefaultValue":8,"unit":"A"}},{"abilityId":115,"accessMode":"rw","code":"Set32A","description":"","name":"设置电流(32A)","typeSpec":{"max":32,"min":8,"scale":0,"step":1,"type":"value","typeDefaultValue":8,"unit":"A"}},{"abilityId":116,"accessMode":"rw","code":"Set40A","description":"","name":"设置电流(40A)","typeSpec":{"max":40,"min":12,"scale":0,"step":1,"type":"value","typeDefaultValue":12,"unit":"A"}},{"abilityId":117,"accessMode":"rw","code":"spare1","description":"","name":"设置电流(50A)","typeSpec":{"max":50,"min":12,"scale":0,"step":1,"type":"value","typeDefaultValue":12,"unit":""}},{"abilityId":118,"accessMode":"rw","code":"SetDelayTime","description":"","name":"延时充电","typeSpec":{"max":15,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"H"}},{"abilityId":119,"accessMode":"rw","code":"SetDefineTime","description":"","name":"定时充电","typeSpec":{"max":15,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"H"}},{"abilityId":120,"accessMode":"ro","code":"Ctime","description":"","name":"充电时间","typeSpec":{"maxlen":255,"type":"string","typeDefaultValue":""}},{"abilityId":121,"accessMode":"rw","code":"spare2","description":"","name":"备用2","typeSpec":{"type":"bool","typeDefaultValue":false}},{"abilityId":122,"accessMode":"rw","code":"IDVerificationSet","description":"","name":"身份验证","typeSpec":{"type":"bool","typeDefaultValue":false}},{"abilityId":123,"accessMode":"rw","code":"spare3","description":"","name":"备用3","typeSpec":{"type":"bool","typeDefaultValue":false}},{"abilityId":124,"accessMode":"rw","code":"ChargingOperation","description":"","name":"充电操作","typeSpec":{"range":["OpenCharging","CloseCharging","WaitOperation"],"type":"enum","typeDefaultValue":"OpenCharging"}}]}]}"
},
"success": true,
"t": 1697118510048,
"tid": "06c42b0c690611ee95454a52bad04d54"
}

Does it help ?

Kind regards !

@make-all make-all removed new device Unsupported device awaiting confirmation Wating for confirmation the issue is solved unreleased Will be in next release labels Oct 16, 2023
@aspiringguru
Copy link

I found this thread while looking for ideas on how to setup user selectable kw.hr charge sessions.
that said, I think integration with home assistant will be easier.

just dropping these notes in the hope someone else finds it useful. (issue closed before I found this thread)

I bought this one on aliexpress, paid extra to have an Australian 5 pin 3 phase plug wired on prior to delivery. Has worked well for a couple of months now.
https://www.aliexpress.com/item/1005006061509862.html

Similar charger on ebay
https://www.ebay.com.au/itm/286059027323

@MichalAug
Copy link

Hello. I have this wallbox: https://www.aliexpress.com/item/1005007333648233.html?spm=a2g0o.order_list.order_list_main.11.210d1802w109Jv

The Tuya app works, the iot account too, I have all the keys and ids, but I can't add the device to the home assistant. It shows:

feyree (unsupported) (xiptqjoa8q9ltqhr)
manufacturer: Tuya

I can't add the device via local integration either, the message appears:

Find the device's IP address
The Tuya cloud doesn't share local IP addresses

Please help, I've spent many hours on this without any results.

@make-all
Copy link
Owner

make-all commented Dec 8, 2024

If you have attempted to add this device via this integration, then you need to check in Settings / System / Logs, and paste any Warning messages related to this integration with your report here.

We can't help if all we have is a vague description of things not working, much of which does not appear to be related to this integration.

@MichalAug
Copy link

Find the device's IP address
The Tuya cloud doesn't share local IP addresses

Thank you. After trying to add a device, this entry appears in the logs.

Rejestrator: aiohttp.server
Źródło: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451
Pierwsze zdarzenie: 03:20:45 (4 zdarzenia)
Ostatnio zalogowany: 03:52:47

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flow, cur_step["step_id"], user_input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tuya_local/config_flow.py", line 297, in async_step_search
self.__cloud_device["local_product_id"] = local_device["productKey"]
~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'productKey'

@make-all
Copy link
Owner

make-all commented Dec 8, 2024

You are getting an error in unreleased code. It may be better if you stick to the released version rather than pulling directly from the development head.

make-all added a commit that referenced this issue Dec 8, 2024
It looks like productKey is not always supported.

Comment on #1149
@MichalAug
Copy link

Thank you. I used version 2024.11.4.

This time the error did not pop up immediately, but something was happening. After trying to integrate using the application, a message appeared saying that the application does not provide IP and automatically went to manual configuration. Unfortunately, after entering the data, a login error.

Register: custom_components.tuya_local.device
Source: custom_components/tuya_local/device.py:475
integration: Tuya Local (documentation, Problems)
First event: 12:11:52 (2 events)
Last logged in: 12:11:56

Test protocol error 901: Network Error: Unable to Connect

I checked the keys many times, but I am not sure about the node_id, it is not available anywhere in the portal, so I entered the uuid.

@make-all
Copy link
Owner

make-all commented Dec 8, 2024

You should leave the node_id blank if you are connecting directly to a WiFi device. node_id is only for subdevices that are connected via hubs.

@MichalAug
Copy link

I also tried with empty node_id field, with local and external IP, it always ends with this error.

This error comes from custom integration.

Logger: custom_components.tuya_local.device
Source: custom_components/tuya_local/device.py:475
integration: Tuya Local (documentation, Problems)
First event: 12:21:41 (3 events)
Last logged in: 12:23:06

Test protocol error 901: Network Error: Unable to Connect

@MichalAug
Copy link

Device parameters downloaded from the portal. Maybe I'm doing something wrong, but I'm a fairly informed user.
tuya

And this is what it looks like in HA.
Message says: "Cannot connect to device with this data. This may be a temporary problem or the data may be invalid."
tuyaha

@make-all
Copy link
Owner

make-all commented Dec 8, 2024

The only thing I can see is that you have left the protocol as auto, which might not always work. It would be better to find out what protocol version your device is.

Also, your IP address is 192.168.2.x. If this is a different /24 than your Home Assistant server, then check that there is not a routing issue between the subnets.

@MichalAug
Copy link

I have tried all protocol versions. :(
Feyree and Home assistant are on the same subnet.

@make-all
Copy link
Owner

make-all commented Dec 8, 2024

You could try pairing it with the app again to get another local key issued. I see there is a # character in the current local key. There have been multiple reports from users suspecting "special characters in local keys", a specific problem has never been found, but if any character is likely to cause problems, the Python comment character would be high on the list.

@MichalAug
Copy link

I've done this before, but I don't have any other ideas, so I'll try again.

Maybe I could do it with the smart-life app instead of tuya smart? Would I have to connect the smart-life app to the developer portal then?

It's also very strange that the standard tuya cloud integration shows feyree as unavailable and there are no entities.

@MichalAug
Copy link

MichalAug commented Dec 8, 2024

I created a new project, connected the device via the smart-life app and the error didn't pop up, but now I have these warnings:

Zrzut ekranu 2024-12-08 133627

I feel like I'm close. Can you support me a little more? :)

Should device be in standard instruction set and device permision should be coverted to controllable device?
Zrzut ekranu 2024-12-08 134505

I changed the product code in feyree_3phase_ev_charger.yaml but nothing changed.
name: EV charger
products:

  • id: xiptqjoa8q9ltqhr #j6bzjwhiv2cljjcy
    name: Feyree 32A 85-264V 3 phase
  • id: basqjlsmzcq8ipva
    name: Feyree 7.6kW 32A
    primary_entity:

Same warning occur:
This error comes from a custom integration.

Logger: custom_components.tuya_local.config_flow
Source: custom_components/tuya_local/config_flow.py:393
Integration: Tuya Local (documentation, Issues)
First event: 13:33:37 (2 events)
Last logged in: 13:49:22

Device matches None with quality of 0%. DPS: {"updated_at": 1733661198.971791, "102": 2268, "103": 2274, "104": 2296, "105": 0, "106": 0, "107": 0, "109": 0, "110": 121, "112": 0, "113": "Max32A", "114": 14, "115": 14, "116": 14, "117": 14, "118": 0, "119": 0, "120": "00:00:00", "121": "T:00H", "122": "D:00H", "123": false, "124": "WaitOperation", "125": 14}
Device matches None with quality of 0%. DPS: {"updated_at": 1733662145.5996552, "102": 2254, "103": 2268, "104": 2276, "105": 0, "106": 0, "107": 0, "109": 0, "110": 121, "112": 0, "113": "Max32A", "114": 14, "115": 14, "116": 14, "117": 14, "118": 0, "119": 0, "120": "00:00:00", "121": "T:00H", "122": "D:00H", "123": false, "124": "WaitOperation", "125": 14}

@make-all
Copy link
Owner

make-all commented Dec 8, 2024

Now you are getting some log messages, showing that the basic communication is working. However your device appears to be incompatible with any of the implemented devices so far.

@MichalAug
Copy link

So we need to add a completely new device to the integration? Do I have to do it myself or can I generate a set of commands from the tuya portal and you will be able to implement it?

@make-all
Copy link
Owner

make-all commented Dec 8, 2024

File a New Device request under Issues, giving the logs at the end of your comment above, and QueryThingsDataModel API result from the tuya developer portal.

@MichalAug
Copy link

Done. Thank You. #2628

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

6 participants