Replies: 2 comments 5 replies
-
Device config files are here: https://github.com/make-all/tuya-local/tree/main/custom_components/tuya_local/devices There are a number of energy meter devices that will give examples of the types of sensor, binary_sensor and maybe switch,number, select and button entities you will need, but none are closely matching that device's dp layout. Probably you will need more info from iot.tuya.com for possible values for some of those, and whether any are read-write. In particular the string value ones, which may be enums intended to select certain functions, and if any of the numeric ones are writable (for number entities), the min and max values. |
Beta Was this translation helpful? Give feedback.
-
Thanks.....I think I am making progress, but get an "unnexpected Error" when trying to add this device once I upload my YAML file. Any chance someone could look this over and see if they find a glaring error that is causing it not to work: name: Tuya Dual Channel Wifi Energy Meter
Thanks, |
Beta Was this translation helpful? Give feedback.
-
EDIT -- Figured out how to create and upload a custom device yaml file, but when I try to add the device, I get an "Unknown error Occured" error. If I delete my custom YAML file, I go back to usupported device error.
Here is my YAML file where I try to devine the dp's I care about:
name: Tuya Dual Channel Wifi Energy Meter
products:
name: Double Digital Meter
primary_entity:
entity: sensor
name: Total energy
class: energy
dps:
type: integer
name: Total Energy
unit: kWh
class: measurement
mapping:
secondary_entities:
name: Ch1 Power
class: power
category: Energy
dps:
type: integer
name: sensor
unit: kW
class: diagnostic
scale: 10000
name: Ch1 Current
class: Current
category: Energy
dps:
type: integer
name: sensor
unit: A
class: diagnostic
scale: 1000
name: Ch1 Voltage
class: Voltage
category: Energy
dps:
type: integer
name: sensor
unit: V
class: diagnostic
scale: 10
name: Ch1 Total Energy
class: Power
category: Energy
dps:
type: integer
name: sensor
unit: kWh
class: diagnostic
scale: 1000
name: Ch1 Daily Energy
class: Power
category: Energy
dps:
type: integer
name: sensor
unit: kWh
class: diagnostic
scale: 1000
name: Ch2 Power
class: power
category: Energy
dps:
type: integer
name: sensor
unit: kW
class: diagnostic
scale: 10000
name: Ch2 Current
class: Current
category: Energy
dps:
type: integer
name: sensor
unit: A
class: diagnostic
scale: 1000
name: Ch2 Voltage
class: Voltage
category: Energy
dps:
type: integer
name: sensor
unit: V
class: diagnostic
scale: 10
name: Ch2 Total Energy
class: Power
category: Energy
dps:
type: integer
name: sensor
unit: kWh
class: diagnostic
scale: 1000
name: Ch2 Daily Energy
class: Power
category: Energy
dps:
type: integer
name: sensor
unit: kWh
class: diagnostic
scale: 1000
Product is Tuya Double Digital Meter (2 channel, single phase power meter)
Device ID: ebaf4e54462e05891bppri
IP: 10.0.0.65
local_key: =REDACTED
product_id: 79a7z01v3n35kytb
uuid: a8599604eec2dbd1
Scan from TinyTuya:
"id": "ebaf4e54462e05891bppri",
"ip": "10.0.0.65",
"uuid": "a8599604eec2dbd1",
"active": 2,
"encrypt": true,
"productKey": "79a7z01v3n35kytb",
"token": true,
"wf_cfg": true,
"clientLink": 3,
"name": "House & HW Power Meter",
"key": "=REDACTED",
"mac": "18:de:50:4c:ad:cf",
"ability": 0,
"dev_type": "default",
"err": "",
"type": "default",
"dps": {
"dps": {
"101": "request",
"102": "idle",
"103": "working",
"104": 1,
"105": 4031,
"106": 2995,
"107": 2328,
"108": 22302,
"109": 14202,
"110": "normal",
"111": 15000,
"112": 1,
"113": "monitor",
"114": 5,
"115": 0,
"116": 0,
"117": 2333,
"118": 16059,
"119": 10724,
"120": "normal",
"121": 4800,
"122": 5,
"123": 38361,
"124": "cloud_net"
}
},
"origin": "broadcast",
"ver": "3.5"
Datapoints: (#=Value (Explanation))
101=request ("Request Sync")
102=idle ("Sync Response")
103=working (Ch 1 Status = working or monitor)
104=1 (Electricity Statistics - I believe this means 0.01kWh of energy since prior report, but unclear what this means)
105=4031 (Ch1 Power in Watts = 4.031kW)
106=2995 (Ch1 Current in mA = 2.995A)
107=2328 (Ch1 Voltage in V10 = 232.8V)
108=22302 (Ch1 Total Energy = 22.302kWh)
109=14202 (Ch1 Daily Energy = 14.202kWh)
110=normal (Ch1 "Power Type")
111=15000 (Ch 1 Power Alarm in Watts)
112=1 ("Today's Energy Add1" -- I believe this means 0.01kWh of energy since prior report, but unclear what this means)
113=monitor (Ch 2 Status = working or monitor)
114=5 (Electricity Statistics - I believe this means 0.01kWh of energy since prior report, but unclear what this means)
115=0 (Ch2 Power in Watts)
116=0 (Ch2 Current in mA)
117=2333 (Ch2 Voltage in V10)
118=16059 (Ch2 Total Energy = 16.059kWh)
119=10724 (Ch2 Daily Energy = 10.724kWh)
120=normal (Ch2 "Power Type")
121=4800 (Ch 2 Power Alarm in Watts)
122=5 ("Today's Energy Add2" -- I believe this means 0.01kWh of energy since prior report, but unclear what this means)
123=38361 ("All Energy" -- Sum of Ch1 + Ch2 Total Energy)
124=cloud_net
Can anyone give me a clue where I might be going wrong with my yaml file, or guides on what these should look like other than just reviewing the examples, which Is what I tried thus far.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions