>>21374393 My device is a two clamp energy meter, model number PJ-1103A and uses a HLW8112 IC for measurement. It is identical to the device photos posted in the first post of this thread. The code I have posted is for this model
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamexotsk wrote:
divadiow wrote:is this not the full backup already posted for this specific device? https://www.elektroda.com/rtvforum/topic4016609.html#21212779
101 (code: power.a, value: 0)
102 (code: direction.a , value: FORWARD, cloud pull)
103 (code: tbd , value: False, cloud pull)
104 (code: directions, value: FORWARD, cloud pull)
105 (code: power_b, value: 0)
106 (code: energy_forword_a , value: 0)
107 (code: energy_reverse_a , value: 1665)
108 (code: energy_forword_b, value: 0)
109 (code: energy_reserse_b, value: 0)
110 (code: power_factor, value: 100)
111 (code: freq, value: 4997)
112 (code: voltage.a, value: 2319)
113 (code: current_a , value: 0)
114 (code: current_b, value: 0)
115 (code: totaLpower, value: 0)
116 (code: voltage.coef, value: 996)
117 (code: current_a_calibration, value: 1000)
118 (code: power_a_calibration, value: 1000 )
119 (code: energy_a_calibration_fwd, value: 1000)
120 (code: coef_a_reset, value: False, cloud pull)
121 (code: power_factor_b, value: 100)
122 (code: freq.calibration, value: 1020 )
123 (code: current_b_calibration, value: 1000)
124 (code: power_b_calibration, value: 1000)
125 (code: energy_b_calibration_fwd , value: 1000)
126 (code: coef_b_reset, value: False, cloud pull)
127 (code: energy_a_calibration_rev, value: 1000)
128 (code: energy_b_calibration_rev, value: 1000)
129 (code: report_rate_control, value: 10)
130 (code: forward_energy_total, value: 0)
131 (code: reverse_energy_total, value: 1665)
startDriver TuyaMCU
tuyaMcu_setBaudRate 9600
tuyaMcu_defWiFiState 4
startDriver NTP
ntp_setServer 129.250.35.251
// set for your timezone
ntp_timeZoneOfs +2
setChannelType 2 EnergyTotal_kWh_div100
setChannelType 3 EnergyTotal_kWh_div100
setChannelType 4 Power_div10
setChannelType 5 ReadOnly
setChannelType 6 ReadOnly
setChannelType 7 Power_div10
setChannelType 8 EnergyTotal_kWh_div100
setChannelType 9 EnergyTotal_kWh_div100
setChannelType 10 EnergyTotal_kWh_div100
setChannelType 11 EnergyTotal_kWh_div100
setChannelType 12 PowerFactor_div100
setChannelType 13 Frequency_div100
setChannelType 14 Voltage_div10
setChannelType 15 Current_div1000
setChannelType 16 Current_div1000
setChannelType 17 Power_div10
setChannelType 18 PowerFactor_div100
setChannelType 19 TextField
setChannelType 20 TextField
setChannelType 21 TextField
setChannelType 22 TextField
setChannelType 23 TextField
setChannelType 24 TextField
setChannelType 25 TextField
setChannelType 26 TextField
setChannelType 27 TextField
setChannelType 28 TextField
setChannelType 29 TextField
SetChannelLabel 2 "Total Forward energy"
SetChannelLabel 3 "Total Reverse energy"
SetChannelLabel 4 "Power A"
SetChannelLabel 5 "Direction A (0=forward - 1=reverse)"
SetChannelLabel 6 "Direction B (0=forward - 1=reverse)"
SetChannelLabel 7 "Power B"
SetChannelLabel 8 "Forward Energy A"
SetChannelLabel 9 "Reverse Energy A"
SetChannelLabel 10 "Forward Energy B"
SetChannelLabel 11 "Reverse Energy B"
SetChannelLabel 12 "Power Factor A"
SetChannelLabel 13 "AC Frequency"
SetChannelLabel 14 "Voltage"
SetChannelLabel 15 "Current A"
SetChannelLabel 16 "Current B"
SetChannelLabel 17 "Total Power"
SetChannelLabel 18 "Power Factor B"
SetChannelLabel 19 "Voltage Calibration (800-1200)"
SetChannelLabel 20 "Current A Calibration (800-1200)"
SetChannelLabel 21 "Power A Calibration (800-1200)"
SetChannelLabel 22 "Energy A Calibration Forward (800-1200)"
SetChannelLabel 23 "Frequency Calibration (800-1200)"
SetChannelLabel 24 "Current B Calibration (800-1200)"
SetChannelLabel 25 "Power B Calibration (800-1200)"
SetChannelLabel 26 "Energy B Calibration Forward (800-1200)"
SetChannelLabel 27 "Energy A Calibration Reverse (800-1200)"
SetChannelLabel 28 "Energy B Calibration Reverse (800-1200)"
SetChannelLabel 29 "Adjust Reporting Rate (3-60)"
linkTuyaMCUOutputToChannel 130 2 2
linkTuyaMCUOutputToChannel 131 2 3
linkTuyaMCUOutputToChannel 101 2 4
linkTuyaMCUOutputToChannel 102 2 5
linkTuyaMCUOutputToChannel 104 2 6
linkTuyaMCUOutputToChannel 105 2 7
linkTuyaMCUOutputToChannel 106 2 8
linkTuyaMCUOutputToChannel 107 2 9
linkTuyaMCUOutputToChannel 108 2 10
linkTuyaMCUOutputToChannel 109 2 11
linkTuyaMCUOutputToChannel 110 2 12
linkTuyaMCUOutputToChannel 111 2 13
linkTuyaMCUOutputToChannel 112 2 14
linkTuyaMCUOutputToChannel 113 2 15
linkTuyaMCUOutputToChannel 114 2 16
linkTuyaMCUOutputToChannel 115 2 17
linkTuyaMCUOutputToChannel 121 2 18
linkTuyaMCUOutputToChannel 116 2 19
linkTuyaMCUOutputToChannel 117 2 20
linkTuyaMCUOutputToChannel 118 2 21
linkTuyaMCUOutputToChannel 119 2 22
linkTuyaMCUOutputToChannel 122 2 23
linkTuyaMCUOutputToChannel 123 2 24
linkTuyaMCUOutputToChannel 124 2 25
linkTuyaMCUOutputToChannel 125 2 26
linkTuyaMCUOutputToChannel 127 2 27
linkTuyaMCUOutputToChannel 128 2 28
linkTuyaMCUOutputToChannel 129 2 29
// do not send to MQTT the following channels
SetChannelPrivate 19 true
SetChannelPrivate 20 true
SetChannelPrivate 21 true
SetChannelPrivate 22 true
SetChannelPrivate 23 true
SetChannelPrivate 24 true
SetChannelPrivate 25 true
SetChannelPrivate 26 true
SetChannelPrivate 27 true
SetChannelPrivate 28 true
SetChannelPrivate 29 true
// you can use these to force initial configuration values
//SetChannel 19 1000
//SetChannel 20 1000
//SetChannel 21 1000
//SetChannel 22 1000
//SetChannel 23 1000
//SetChannel 24 1000
//SetChannel 25 1000
//SetChannel 26 1000
//SetChannel 27 1000
//SetChannel 28 1000
//SetChannel 29 10
PowerSave 1
103 (code: tbd , value: False, cloud pull)
120 (code: coef_a_reset, value: False, cloud pull)
126 (code: coef_b_reset, value: False, cloud pull)