You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Smart-Meter-Interface.md
+54-4Lines changed: 54 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,8 @@ Additional features can be enabled by adding the following `#define` compiler di
34
34
|NO_SML_REPLACE_VARS | disables replacement of any text in descriptor by script text variables. Useful if several occurrences of a text occupies a lot of space and you get short of script buffer. Readability may get worse so only makes sense on large descriptors. Note: to use `%` symbol un measurement units, you need to escape it like `%%`.|
35
35
|NO_USE_SML_DECRYPT | disables decoding of encrypted ams meters. decrypting needs TLS, so must define USE_TLS also.|
36
36
|USE_SML_AUTHKEY | enables authentication, this is not needed by most energy meters.|
37
-
|USE_SML_TCP | enables TCP MODBUS support.|
37
+
|NO_USE_SML_TCP | disables TCP MODBUS support.|
38
+
|NO_USE_SML_CANBUS | disables CANBUS support.|
38
39
39
40
### General description
40
41
@@ -56,6 +57,7 @@ The Smart Meter Interface provides a means to connect many kinds of meters to Ta
56
57
| OBIS ASCII | telegrams emitted from many smart meters, including [P1 Smart Meters](https://tasmota.github.io/docs/P1-Smart-Meter/)|
57
58
| OBIS Binary SML| telegrams emitted from many smart meters |
58
59
| MODBus Binary | telegrams used by many power meters and industrial devices |
60
+
| CANBus Binary | telegrams used by battery monitoring systems and industrial devices |
59
61
| Kamstrup Binary | telegrams used by many power meters from Kamstrup |
60
62
| EBus Binary | telegrams emitted by many heaters and heat pumps (e.g. Vaillant, Wolf) |
61
63
| VBus Binary | telegrams emitted by many solar thermal systems boilers (e.g. Resol, Viessmann) |
@@ -97,9 +99,9 @@ Declare `>M` section with the number of connected meters (n = `1..5`):
97
99
| :--- | :--- |
98
100
|`+<M>`| Meter number. The number must be increased with each additional Meter (default 1 to 5).|
99
101
|`<rxGPIO>`| The GPIO pin number where meter data is received. <BR> [xxx.xxx.xxx.xxx] IP number instead of pin number enables MODBUS TCP mode, the tcp port number is given at the baudrate position. (tx pin can be any number and is ignored)|
100
-
|`<type>`| The type of meter: <BR>- `o` - OBIS ASCII type of coding<BR>- `s` - SML binary smart message coding<BR>- `e` - EBus binary coding<BR>- `v` - VBus binary coding<BR>- `m` - MODBus binary coding with serial mode 8N1<BR>- `M` - MODBus binary coding with serial mode 8E1<BR>- `k` - Kamstrup binary coding with serial mode 8N1<BR>- `c` - Counter type<BR>- `r` - Raw binary coding (any binary telegram) |
102
+
|`<type>`| The type of meter: <BR>- `o` - OBIS ASCII type of coding<BR>- `s` - SML binary smart message coding<BR>- `e` - EBus binary coding<BR>- `v` - VBus binary coding<BR>- `m` - MODBus binary coding with serial mode 8N1<BR>- `M` - MODBus binary coding with serial mode 8E1<BR>- `k` - Kamstrup binary coding with serial mode 8N1<BR>- `C` - CANBus type<BR>- `c` - Counter type<BR>- `r` - Raw binary coding (any binary telegram) |
101
103
|`<flag>`| Options flag:<BR>- `0` - counter without pullup<BR>- `1` - counter with pullup<BR>- `16` - enable median filter for that meter. Can help with sporadic dropouts, reading errors (not available for counters). this option is enabled by default #define USE_SML_MEDIAN_FILTER, if you are low on memory and dont use this feature you may outcomment this define in the driver |
102
-
|`<parameter>`| Parameters according to meter type:<BR>- for `o,s,e,v,m,M,k,r` types: serial baud rate e.g. `9600` (or port# for Modbus TCP).<BR>- for `c` type: a positive value = counter poll interval (not really recommended) or a negative value = debounce time (milliseconds) for irq driven counters. |
104
+
|`<parameter>`| Parameters according to meter type:<BR>- for `o,s,e,v,m,M,k,r` types: serial baud rate e.g. `9600` (or port# for Modbus TCP).<BR>- for type `c` Canbus Baudrates and Number of receive buffers. (see example)<BR>- for `c` type: a positive value = counter poll interval (not really recommended) or a negative value = debounce time (milliseconds) for irq driven counters. |
103
105
|`<jsonPrefix>`| Prefix for Web UI and MQTT JSON payload. Up to 7 characters.|
104
106
|`<txGPIO>`| The GPIO pin number where meter command is transmitted (optional).|
105
107
|`<tx enable>`| The GPIO pin number to enable transmitter (RS485) may follow the TX pin in bracket (pin) without a colon an 'i' in front of the pin number means 'inverted' (optional).|
@@ -218,7 +220,9 @@ With `=` character at the beginning of a line you can do some special decoding.
218
220
|`M,=so5 `| sets AES authentication key for encrypted meters.must define exactly 16 hexadecimal chars<BR>e.g. not needed by most energy meters (needs USE_SML_AUTHKEY).<BR>|
219
221
|`M,=so6 `| sync time in milliseconds for serial block detection with AMS meters (defaults to 1000).<BR>|
220
222
|`M,=so7 `| on ESP32 force selection of UART Nr. X (0,1,2) allows coexistence with other serial drivers <BR>|
221
-
223
+
|`M,=so8 `| CAN bus filter mask <BR>|
224
+
|`M,=so9 `| CAB bus filter <BR>|
225
+
222
226
!!! example
223
227
To get the value of one of the descriptor lines, use `sml[X]`. `X` = Line number. Starts with `1`. (compiling with `USE_SML_SCRIPT_CMD` required)
224
228
```
@@ -3208,3 +3212,49 @@ Tested on an AEConversion INV500-90 with RS485 interface.
3208
3212
1,030408U64@i14:1000,Batt_EntLadung,kWh,v15,3
3209
3213
#
3210
3214
```
3215
+
3216
+
### HUAWEI R4850G2 Lipo Charger (CANBus)
3217
+
3218
+
??? summary "View script"
3219
+
3220
+
```
3221
+
>D 40
3222
+
IP=192.168.188.117
3223
+
ovolt=45
3224
+
maxc=30
3225
+
cstr=""
3226
+
>B
3227
+
=>sensor53 r
3228
+
>S
3229
+
if chg[ovolt]>0 {
3230
+
; change voltage 41.5 - 58.5
3231
+
cstr="908180FE0801000000"+hx(ovolt*1024)
3232
+
sml(1 3 cstr)
3233
+
}
3234
+
if chg[maxc]>0 {
3235
+
; change max current 0-60A
3236
+
cstr="908180FE0801030000"+hx(maxc*20)
3237
+
sml(1 3 cstr)
3238
+
}
3239
+
>M 1
3240
+
; Huawei R4850G2
3241
+
; params -> 03 = baudrate 125kb + number of receive buffers * 100
0 commit comments