Heckie75 / voltcraft-sem-6000

Full-featured shell script in order to control wall mount smart energy meter Voltcraft SEM-6000
MIT License
94 stars 22 forks source link

Total Power always zero #2

Closed OscarvanDijk closed 4 years ago

OscarvanDijk commented 4 years ago

Hoi, I like the work done on the script t decode the data. Who I compare the information in the Mobile app with the Status command in the script, I see that the total energy is always 0. ( Also in the examples you show) I have decoded the hex stringiest and see that the location where you read the Total is also 0.

I think we need to look at a different place for the total power used.

Heckie75 commented 4 years ago

Hi,

thanks for you feedback.

Actually I think that the code is current. Please send me you output of the following:

Step 1:

~$ sem-6000 L --debug --status --print
[                 ][LE]> connect FC:69:47:06:CB:C6
Attempting to connect to FC:69:47:06:CB:C6
Connection successful
[FC:69:47:06:CB:C6][LE]> char-write-req 2b 0f0c170000000000000000000018ffff
Characteristic value was written successfully
Notification handle = 0x002e value: 0f 06 17 00 00 00 00 18 ff ff
[FC:69:47:06:CB:C6][LE]> char-write-req 2b 0f050400000005ffff
Characteristic value was written successfully
Notification handle = 0x002e value: 0f 11 04 00 00 00 00 00 e9 00 00 00 00 00 00 00 00 00 ee
[FC:69:47:06:CB:C6][LE]>        Status:
          Power:             off
          Voltage:           233 VAC
          Ampere:            0.0 A
          Watts:             0.0 W
          Frequency:         0 Hz
          Power factor:      n/a
          Total consumption: 0.0 kWh

Step 2:

$ sem-6000 L --debug --data year --print
[                 ][LE]> connect FC:69:47:06:CB:C6
Attempting to connect to FC:69:47:06:CB:C6
Connection successful
[FC:69:47:06:CB:C6][LE]> char-write-req 2b 0f0c170000000000000000000018ffff
Characteristic value was written successfully
Notification handle = 0x002e value: 0f 06 17 00 00 00 00 18 ff ff
[FC:69:47:06:CB:C6][LE]> char-write-req 2b 0f050c0000000dffff
Characteristic value was written successfully
Notification handle = 0x002e value: 0f 33 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Notification handle = 0x002e value: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Notification handle = 0x002e value: 00 00 00 00 00 00 00 00 00 00 00 00 0d ff ff
[FC:69:47:06:CB:C6][LE]> 2019-03        0
2019-04 0
2019-05 0
2019-06 0
2019-07 0
2019-08 0
2019-09 0
2019-10 0
2019-11 0
2019-12 0
2020-01 0
2020-02 0

And then tell me what the expected result is according the app.

Heckie75 commented 4 years ago

Ok, I guess that the app displays the sum of all measurements per month. My socket displays 0.007 kWh

$ sem-6000 L --data year --print
2019-03 0
2019-04 0
2019-05 0
2019-06 0
2019-07 0
2019-08 0
2019-09 3 <-- 3 Wh
2019-10 4 <-- 4 Wh
2019-11 0
2019-12 0
2020-01 0
2020-02 0

The sum is 7Wh.

Probably the 4 bytes of the capture measurement command are not meant for total consumption. That was my assumption since all other information, that is diplayed in the main screen, is returned by the capture measurement command and there were 4 bytes left.

OscarvanDijk commented 4 years ago

Thanks, I verified your suggestion. This seems correct.