mirror of
https://github.com/nekorevend/esphome-emporia-vue-utility.git
synced 2026-01-08 04:30:38 -07:00
Tools
During my investigation, I wanted to see the claimed wattage that corresponds to a given payload, but in an automated way. Since Emporia lets you export CSV data, I made a quick and dirty script to match up the *1SEC.csv file to the data I sniffed over UART.
emporia_sniff_parsing.py
This script was crafted to deal with the firmware V7's payload, but you can adjust it to parse other kinds of payloads.
How to run
python3 .\emporia_sniff_parsing.py --sniffed_data capture_from_MGM111.txt --emporia_csv emporia_export_1SEC.csv
What it expects
capture_from_MGM111.txt should have contents like this:
"2023-12-08 09:05:11",2401722C18480100000025877D16090000010000251A14970000000103002201000002030022E803000004002AA704000D"2023-12-08 09:05:41",2401722C18490100000025907D16090000010000251A14970000000103002201000002030022E803000004002A8F04000D"2023-12-08 09:06:11",2401722C184A01000000259A7D16090000010000251A14970000000103002201000002030022E803000004002AA304000D"2023-12-08 09:06:41",2401722C184B0100000025A37D16090000010000251A14970000000103002201000002030022E803000004002A5404000D"2023-12-08 09:07:11",2401722C184C0100000025AC7D16090000010000251A14970000000103002201000002030022E803000004002A8E04000D"2023-12-08 09:07:41",2401722C184D0100000025B77D16090000010000251A14970000000103002201000002030022E803000004002AD104000D
This was a format returned by Realterm, but you can adjust the code to match the format of your sniffed data.
emporia_export_1SEC.csv should have contents like this:
12/08/2023 08:55:40,1.3850
12/08/2023 08:55:41,1.3850
12/08/2023 08:55:42,1.3850
12/08/2023 08:55:43,1.3850
12/08/2023 08:55:44,1.3850
12/08/2023 08:55:45,1.3850
12/08/2023 08:55:46,1.4140
12/08/2023 08:55:47,1.4140
12/08/2023 08:55:48,1.4140
What to expect
Hex3: C90600 Calculated W: 1737 Pairing: [('1.6560', '2401722C18210100000025A97B16090000010000251A14970000000103002201000002030022E803000004002AC906000D')]
Hex3: 780600 Calculated W: 1656 Pairing: [('1.6790', '2401722C18230100000025C67B16090000010000251A14970000000103002201000002030022E803000004002A7806000D')]
Hex3: 8F0600 Calculated W: 1679 Pairing: [('1.6820', '2401722C18250100000025E07B16090000010000251A14970000000103002201000002030022E803000004002A8F06000D')]
Hex3: 7F0600 Calculated W: 1663 Pairing: [('1.6370', '2401722C18290100000025197C16090000010000251A14970000000103002201000002030022E803000004002A7F06000D')]
Hex3: 650600 Calculated W: 1637 Pairing: [('1.5340', '2401722C182B0100000025347C16090000010000251A14970000000103002201000002030022E803000004002A6506000D')]
Hex3: FE0500 Calculated W: 1534 Pairing: [('1.5260', '2401722C182D01000000254F7C16090000010000251A14970000000103002201000002030022E803000004002AFE05000D')]
Hex3: F60500 Calculated W: 1526 Pairing: [('1.5820', '2401722C182F0100000025697C16090000010000251A14970000000103002201000002030022E803000004002AF605000D')]
Hex3: 2E0600 Calculated W: 1582 Pairing: [('1.4740', '2401722C18310100000025827C16090000010000251A14970000000103002201000002030022E803000004002A2E06000D')]
Hex3: C20500 Calculated W: 1474 Pairing: [('1.3850', '2401722C183301000000259B7C16090000010000251A14970000000103002201000002030022E803000004002AC205000D')]
Hex3: 690500 Calculated W: 1385 Pairing: [('1.4140', '2401722C18350100000025B47C16090000010000251A14970000000103002201000002030022E803000004002A6905000D')]