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

[Bug]: EV Charger Support #479

Closed
3 tasks
Fannangir opened this issue Jan 12, 2025 · 9 comments
Closed
3 tasks

[Bug]: EV Charger Support #479

Fannangir opened this issue Jan 12, 2025 · 9 comments
Labels
auto configure Related to auto configure entities feature.

Comments

@Fannangir
Copy link

LocalTuya Version

2024.12.1

Home Assistant Version

2025.1.2

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

What happened?

Hi,
Could you please add EV Charger Support?
Thanks in advance.
Logs attached.

Steps to reproduce.

New device and device category.

Relevant log output

2025-01-12 21:01:01.945 DEBUG (MainThread) [custom_components.localtuya.config_flow] [bf2...apk - EV Charger] Detected DPS: {'102': False, '103': 24190, '104': 24300, '105': 24270, '106': 0, '107': 0, '108': 0, '109': False, '110': 10, '111': 10, '112': 0, '113': '0000000000000197', '115': 1600, '116': False, '117': 10000, '123': 'netversion', '126': 'internal_meter', '127': 'V2.4.13', '128': 'enabled_energy', '129': 'enabled_energy', '131': 0, '140': 'LAN', '142': True}
2025-01-12 21:01:01.945 DEBUG (MainThread) [custom_components.localtuya.config_flow] [bf2...apk - EV Charger] Total DPS: {'102': False, '103': 24190, '104': 24300, '105': 24270, '106': 0, '107': 0, '108': 0, '109': False, '110': 10, '111': 10, '112': 0, '113': '0000000000000197', '115': 1600, '116': False, '117': 10000, '123': 'netversion', '126': 'internal_meter', '127': 'V2.4.13', '128': 'enabled_energy', '129': 'enabled_energy', '131': 0, '140': 'LAN', '142': True}
2025-01-12 21:01:01.946 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [bf2...apk] Connection lost: None
2025-01-12 21:01:03.331 DEBUG (MainThread) [custom_components.localtuya.core.ha_entities] EV Charger: Configured entities: []

Diagnostics information.

No response

@Fannangir Fannangir added the bug Something isn't working label Jan 12, 2025
@xZetsubou
Copy link
Owner

Do you mean in auto configure? If so, post the entry diagnostic

@xZetsubou xZetsubou added auto configure Related to auto configure entities feature. and removed bug Something isn't working labels Jan 12, 2025
@Fannangir
Copy link
Author

Sure.
Thank you very much for the quick reply.
Attached the EV charger log.

{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2025.1.2",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.13.1",
"docker": true,
"arch": "x86_64",
"timezone": "Asia/Jerusalem",
"os_name": "Linux",
"os_version": "6.6.66-haos",
"supervisor": "2024.12.3",
"host_os": "Home Assistant OS 14.1",
"docker_version": "27.2.0",
"chassis": "vm",
"run_as_root": true
},
"custom_components": {
"localtuya": {
"documentation": "https://github.com/xZetsubou/hass-localtuya/",
"version": "2024.12.1",
"requirements": []
},
},
"integration_manifest": {
"domain": "localtuya",
"name": "Local Tuya",
"codeowners": [],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/xZetsubou/hass-localtuya/",
"integration_type": "hub",
"iot_class": "local_push",
"issue_tracker": "https://github.com/xZetsubou/hass-localtuya/issues",
"requirements": [],
"version": "2024.12.1",
"is_built_in": false,
"overwrites_built_in": false
},
"setup_times": {
"null": {
"setup": 0.0015240490902215242
},
"a73bfc554e494d77ddb6e443e3fa5b2d": {
"wait_import_platforms": -3.4206854549702257,
"wait_base_component": -0.0011735961306840181,
"config_entry_setup": 4.084277210058644
}
},
"data": {
"client_id": "p9q...hxd",
"client_secret": "7c9...70e",
"devices": {
"bf2b5e90795b6c04818apk": {
"active_time": 1736706122,
"biz_type": 18,
"category": "qt",
"create_time": 1736706122,
"icon": "smart/icon/bay16667069738394mH8/d89f43c0bf8357b9e047e69a21940c71.png",
"id": "bf2b5e90795b6c04818apk",
"ip": "7...9",
"lat": "",
"local_key": "Lg9...mHF",
"lon": "",
"model": "",
"name": "EV Charger",
"online": true,
"owner_id": "28309820",
"product_id": "s2wublk5n2pycus1",
"product_name": "EV Charger",
"sub": false,
"time_zone": "+02:00",
"uid": "eu1...Qo6",
"update_time": 1736730181,
"uuid": "d64622b910812ee7",
"dps_data": {
"101": {
"code": "auth_password",
"custom_name": "",
"dp_id": 101,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 101,
"accessMode": "wr",
"values": "{"type": "string", "maxlen": 255}"
},
"102": {
"code": "is_login",
"custom_name": "",
"dp_id": 102,
"time": 1736801107316,
"type": "bool",
"value": false,
"id": 102,
"accessMode": "ro",
"values": "{"type": "bool"}"
},
"103": {
"code": "voltage_phase_a",
"custom_name": "",
"dp_id": 103,
"time": 1736801107320,
"type": "value",
"value": 24070,
"id": 103,
"accessMode": "ro",
"values": "{"type": "value", "max": 100000, "min": 0, "scale": 2, "step": 1, "unit": "V"}"
},
"104": {
"code": "voltage_phase_b",
"custom_name": "",
"dp_id": 104,
"time": 1736801107323,
"type": "value",
"value": 24230,
"id": 104,
"accessMode": "ro",
"values": "{"type": "value", "max": 100000, "min": 0, "scale": 2, "step": 1, "unit": "V"}"
},
"105": {
"code": "voltage_phase_c",
"custom_name": "",
"dp_id": 105,
"time": 1736801107326,
"type": "value",
"value": 24190,
"id": 105,
"accessMode": "ro",
"values": "{"type": "value", "max": 100000, "min": 0, "scale": 2, "step": 1, "unit": "V"}"
},
"106": {
"code": "electricity_phase_a",
"custom_name": "",
"dp_id": 106,
"time": 1736801107331,
"type": "value",
"value": 0,
"id": 106,
"accessMode": "ro",
"values": "{"type": "value", "max": 20000, "min": 0, "scale": 2, "step": 1, "unit": "A"}"
},
"107": {
"code": "electricity_phase_b",
"custom_name": "",
"dp_id": 107,
"time": 1736801107333,
"type": "value",
"value": 0,
"id": 107,
"accessMode": "ro",
"values": "{"type": "value", "max": 20000, "min": 0, "scale": 2, "step": 1, "unit": "A"}"
},
"108": {
"code": "electricity_phase_c",
"custom_name": "",
"dp_id": 108,
"time": 1736706834856,
"type": "value",
"value": 0,
"id": 108,
"accessMode": "ro",
"values": "{"type": "value", "max": 20000, "min": 0, "scale": 2, "step": 1, "unit": "A"}"
},
"109": {
"code": "charging_state",
"custom_name": "",
"dp_id": 109,
"time": 1736801107336,
"type": "bool",
"value": false,
"id": 109,
"accessMode": "rw",
"values": "{"type": "bool"}"
},
"110": {
"code": "charge_electric_quantity",
"custom_name": "",
"dp_id": 110,
"time": 1736801107339,
"type": "value",
"value": 0,
"id": 110,
"accessMode": "ro",
"values": "{"type": "value", "max": 999999999, "min": 0, "scale": 2, "step": 1, "unit": "kWh"}"
},
"111": {
"code": "charge_money",
"custom_name": "",
"dp_id": 111,
"time": 1736801109487,
"type": "value",
"value": 0,
"id": 111,
"accessMode": "ro",
"values": "{"type": "value", "max": 999999999, "min": 0, "scale": 2, "step": 1, "unit": ""}"
},
"112": {
"code": "card_balance",
"custom_name": "",
"dp_id": 112,
"time": 1736801109487,
"type": "value",
"value": 0,
"id": 112,
"accessMode": "ro",
"values": "{"type": "value", "max": 999999999, "min": 0, "scale": 2, "step": 1, "unit": ""}"
},
"113": {
"code": "pile_number",
"custom_name": "",
"dp_id": 113,
"time": 1736801107403,
"type": "string",
"value": "0000000000000197",
"id": 113,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"114": {
"code": "cp",
"custom_name": "",
"dp_id": 114,
"time": 1736706122141,
"type": "value",
"value": 0,
"id": 114,
"accessMode": "ro",
"values": "{"type": "value", "max": 10000, "min": 0, "scale": 2, "step": 1, "unit": "V"}"
},
"115": {
"code": "rated_current",
"custom_name": "",
"dp_id": 115,
"time": 1736801107414,
"type": "value",
"value": 1600,
"id": 115,
"accessMode": "rw",
"values": "{"type": "value", "max": 20000, "min": 0, "scale": 2, "step": 1, "unit": "A"}"
},
"116": {
"code": "load_balancing_state",
"custom_name": "",
"dp_id": 116,
"time": 1736801107418,
"type": "bool",
"value": false,
"id": 116,
"accessMode": "ro",
"values": "{"type": "bool"}"
},
"117": {
"code": "load_balancing_current",
"custom_name": "",
"dp_id": 117,
"time": 1736801107421,
"type": "value",
"value": 10000,
"id": 117,
"accessMode": "rw",
"values": "{"type": "value", "max": 20000, "min": 0, "scale": 2, "step": 1, "unit": "A"}"
},
"123": {
"code": "charge_pattern",
"custom_name": "",
"dp_id": 123,
"time": 1736801107423,
"type": "enum",
"value": "netversion",
"id": 123,
"accessMode": "rw",
"values": "{"type": "enum", "range": ["netversion", "standalone", "standalone_reserved", "plug_and_charge"]}"
},
"124": {
"code": "equipment_time",
"custom_name": "",
"dp_id": 124,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 124,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"125": {
"code": "ocpp_url",
"custom_name": "",
"dp_id": 125,
"time": 1736712739878,
"type": "string",
"value": "192.168.1.46:9005/",
"id": 125,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"126": {
"code": "measurement_model",
"custom_name": "",
"dp_id": 126,
"time": 1736801107426,
"type": "enum",
"value": "internal_meter",
"id": 126,
"accessMode": "rw",
"values": "{"type": "enum", "range": ["internal_meter", "external_meter"]}"
},
"127": {
"code": "version_number",
"custom_name": "",
"dp_id": 127,
"time": 1736801109487,
"type": "string",
"value": "V2.4.13",
"id": 127,
"accessMode": "ro",
"values": "{"type": "string", "maxlen": 255}"
},
"128": {
"code": "earth_test",
"custom_name": "",
"dp_id": 128,
"time": 1736801107457,
"type": "enum",
"value": "enabled_energy",
"id": 128,
"accessMode": "rw",
"values": "{"type": "enum", "range": ["enabled_energy", "forbidden_energy"]}"
},
"129": {
"code": "pen_protect",
"custom_name": "",
"dp_id": 129,
"time": 1736801109487,
"type": "enum",
"value": "enabled_energy",
"id": 129,
"accessMode": "rw",
"values": "{"type": "enum", "range": ["enabled_energy", "forbidden_energy"]}"
},
"130": {
"code": "update_password",
"custom_name": "",
"dp_id": 130,
"time": 1736712724625,
"type": "string",
"value": "888888",
"id": 130,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"131": {
"code": "electricity_total",
"custom_name": "",
"dp_id": 131,
"time": 1736801107410,
"type": "value",
"value": 0,
"id": 131,
"accessMode": "ro",
"values": "{"type": "value", "max": 20000, "min": 0, "scale": 2, "step": 1, "unit": "A"}"
},
"132": {
"code": "apn",
"custom_name": "",
"dp_id": 132,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 132,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"133": {
"code": "apn_user_name",
"custom_name": "",
"dp_id": 133,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 133,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"134": {
"code": "apn_user_password",
"custom_name": "",
"dp_id": 134,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 134,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"135": {
"code": "charge_card_no1",
"custom_name": "",
"dp_id": 135,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 135,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"136": {
"code": "charge_card_no2",
"custom_name": "",
"dp_id": 136,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 136,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"140": {
"code": "network_model",
"custom_name": "",
"dp_id": 140,
"time": 1736801107493,
"type": "enum",
"value": "4G",
"id": 140,
"accessMode": "rw",
"values": "{"type": "enum", "range": ["LAN", "4G"]}"
},
"141": {
"code": "qr_code_prefix",
"custom_name": "",
"dp_id": 141,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 141,
"accessMode": "rw",
"values": "{"type": "string", "maxlen": 255}"
},
"142": {
"code": "touch_warning",
"custom_name": "",
"dp_id": 142,
"time": 1736706129515,
"type": "bool",
"value": true,
"id": 142,
"accessMode": "ro",
"values": "{"type": "bool"}"
},
"143": {
"code": "ocpp_tls",
"custom_name": "",
"dp_id": 143,
"time": 1736706122141,
"type": "bool",
"value": false,
"id": 143,
"accessMode": "rw",
"values": "{"type": "bool"}"
},
"150": {
"code": "charge_power1",
"custom_name": "",
"dp_id": 150,
"time": 1736706122141,
"type": "value",
"value": 0,
"id": 150,
"accessMode": "ro",
"values": "{"type": "value", "max": 100000, "min": 0, "scale": 2, "step": 1, "unit": "kw"}"
},
"151": {
"code": "charge_power2",
"custom_name": "",
"dp_id": 151,
"time": 1736706122141,
"type": "value",
"value": 0,
"id": 151,
"accessMode": "ro",
"values": "{"type": "value", "max": 100000, "min": 0, "scale": 2, "step": 1, "unit": "kw"}"
},
"152": {
"code": "device_number",
"custom_name": "",
"dp_id": 152,
"time": 1736706122141,
"type": "string",
"value": "",
"id": 152,
"accessMode": "ro",
"values": "{"type": "string", "maxlen": 255}"
},
"153": {
"code": "transaction_energy",
"custom_name": "",
"dp_id": 153,
"time": 1736706122141,
"type": "value",
"value": 0,
"id": 153,
"accessMode": "ro",
"values": "{"type": "value", "max": 99999999, "min": 0, "scale": 2, "step": 1, "unit": "kWh"}"
},
"154": {
"code": "transaction_time",
"custom_name": "",
"dp_id": 154,
"time": 1736706122141,
"type": "value",
"value": 0,
"id": 154,
"accessMode": "ro",
"values": "{"type": "value", "max": 999999999, "min": 0, "scale": 0, "step": 1, "unit": ""}"
},
"155": {
"code": "transaction_monry",
"custom_name": "",
"dp_id": 155,
"time": 1736706122141,
"type": "value",
"value": 0,
"id": 155,
"accessMode": "ro",
"values": "{"type": "value", "max": 999999999, "min": 0, "scale": 2, "step": 1, "unit": ""}"
},
"156": {
"code": "transaction_status",
"custom_name": "",
"dp_id": 156,
"time": 1736706122141,
"type": "bool",
"value": false,
"id": 156,
"accessMode": "ro",
"values": "{"type": "bool"}"
}
}
},
}
}
}

@Fannangir
Copy link
Author

@xZetsubou Did you have a chance to look whether all the needed information is here?
Thanks in advance.

xZetsubou added a commit that referenced this issue Jan 17, 2025
@xZetsubou xZetsubou added the master/next-release Fixed in master branch, Will be ready in the next release label Jan 17, 2025
Copy link

This issue was closed because it was resolved on the release: 2025.1.0

@github-actions github-actions bot added stale and removed master/next-release Fixed in master branch, Will be ready in the next release stale labels Jan 17, 2025
@Fannangir
Copy link
Author

@xZetsubou Thank you very much.
Recognized.
One small issue I have noticed is that Electricity Phase A and Electricity Phase B show as voltage instead of current.
Could you please update Electricity Phases A and B to current?
Please refer to the image below.
Thanks.

Image

@xZetsubou
Copy link
Owner

I probably forgot to change the unit for these two entities however for now you can only change them manually,

Go to HA Settings -> Devices & Services -> Localtuya -> Configure -> Reconfigure an existing device > choose EV Charger. keep submit until you see the configuration for both Electricity Phase A and B and change device class to current and unit of measurement type A. and leave the rest the same

Image ex

Image

@Fannangir
Copy link
Author

Updated Current.
I have noticed another point in the log:

logger:%20homeassistant.components.sensor%0ASource%3A%20components/sensor/init.py:547%0Aintegration:%20Sensor%20(documentation,%20issues)%0AFirst%20occurred:%20January%2017,%202025%20at%202:36:27%20PM%20(2%20occurrences)%0ALast%20logged:%207:18:41%20AM%0A%0AEntity%20sensor.ev_charger_charge_electric_quantity%20(%3Cclass%20'custom_components.localtuya.sensor.LocalTuyaSensor'%3E)%20is%20using%20state%20class%20'measurement'%20which%20is%20impossible%20considering%20device%20class%20('energy')%20it%20is%20using;%20expected%20None%20or%20one%20of%20'total_increasing',%20'total';%20Please%20update%20your%20configuration%20if%20your%20entity%20is%20manually%20configured,%20otherwise%20create%20a%20bug%20report%20at%20https://github.com/xZetsubou/hass-localtuya/issues

@xZetsubou
Copy link
Owner

You can repeated the process #479 (comment) and change the entity named "Charge Electric Quantity" state class from measurement to total

@Fannangir
Copy link
Author

Thank you very much.

I can see that you have committed already.

Please also include the commits for the Phases so it would be perfect in the next release.

Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto configure Related to auto configure entities feature.
Projects
None yet
Development

No branches or pull requests

2 participants