Sniffing RS232 comms between SPH6000 and a Shine-S

Continuing the discussion from ESPHome modbus Growatt ShineWiFi-S:

I thought I’d spin this off as the parent thread is 200 posts, and this is a little niche.

The problem is that when running ESPHome on a ShineWiFi-S with a SPH6000, write instructions to the Inverter don’t seem to ‘stick’ . I’ve made a horrendous cable that sits between with Shine-S and the inverter and allows me to log all the actual comms between the two. This way, if the Shine-S is doing anything magic, I’ll be able to see it.

I’ve had some success! Code (with captured data) is here GitHub - scudderfish/Shine-S-Sniffer: Reading the RS232 comms between an SPH6000 and a ShineWifi-S
Lines that have ‘>’ in them are messages from the Shine-S to the Inverter and ‘<’ is the response. Now I need to sit down with the documentation to figure out what is going on.
Towards the end of the file, I used GitHub - muppet3000/growatt-weather-based-charger: A tool for configuring overnight charging (i.e. during off-peak periods) for Growatt inverters that have storage capacity (batteries) based on the predicted solar generation for the day to poke Growatt to send some write commands into my inverter. I suspect they are included in these lines

2023-03-28 18:00:16.897174 > 01 10 00 2d 00 06 d0 02
2023-03-28 18:00:17.099363 < 01 10 00 2d 00 06 0c 00 17 00 03 00 1c 00 12 00 00 00 00 e8 1c
2023-03-28 18:00:17.802652 > 01 10 04 42 00 13 20 e0
2023-03-28 18:00:18.006217 < 01 10 04 42 00 13 26 00 15 00 64 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1e 04 1e 00 01 00 00 00 00 00 00 00 00 00 00 00 00 46 85
2023-03-28 18:00:18.990596 > 01 04 fa 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 59 00 00 00 00 02 0b 00 3e 00 00 00 e6 00 00 00 00 00 00 00 00 00 00 00 e6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0a 8c 00 00 00 00 00 00 00 00 00 00 0a 8c 00 00 00 0e 00 05 0b 85 28 b4 00 00 00 3a 00 00 0d 24 00 00 00 03 00 00 05 ff 00 00 00 2a 00 00 0a f5 00 00 00 2d 00 00 0b 59 00 00 00 67 00 00 19 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 e8 00 00 00 61 00 00 00 00 00 3e 14 6e ff 10 00 0e 19 00 1e dc 31 10 86 86 00 05 00 2c 00 64 16 30 00 00 00 00 00 00 86 86 00 00 00 00 00 00 41 50 41 50 00 00 0c ca 0c c7 00 01 0e 10 0c c9 0c c8 0c cb 0c c8 0c ca 0c c8 0c c7 0c cb 0c c7 0c ca 0c c9 0c c8 00 00 ca 85
2023-03-28 18:00:19.191993 < 01 04 03 e8 00 7d b0 5b
2023-03-28 18:00:20.476935 > 01 04 fa 00 19 00 00 06 5c 00 00 00 00 04 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 47 00 00 17 19 00 00 00 45 00 00 11 39 00 00 09 c4 00 00 09 c4 00 00 00 33 00 01 00 00 0a 1b 00 01 00 00 0b 38 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 0c ca 0c c6 00 01 00 10 00 04 00 02 00 9d 00 82 00 03 00 01 00 00 00 3e 00 3e 00 00 00 00 00 00 00 00 00 23 00 c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 31
2023-03-28 18:00:20.678152 < 01 04 04 65 00 7d 21 04

I suspect that the above ‘request/response’ pairs are actually listed as ‘response/request’ just to further confuse things.

This is the nasty wiring currently in my loft :slight_smile:

It looks like the SPH6000 ignores the write to 1044

# Write 1 to reg 1044
2023-03-29 12:34:47.093560 > 01 06 04 14 00 01 09 3e
# Response 'I have written 1 to 1044'
2023-03-29 12:34:47.294186 < 01 06 04 14 00 01 09 3e
#Stuff deleted, ten seconds later....
# Please read from reg 1044
2023-03-29 12:34:57.892610 > 01 03 04 14 00 01 c5 3e
# Response '1044 contains the value 0'
2023-03-29 12:34:58.093930 < 01 03 02 00 00 b8 44

I suspect that this behaviour is because grid/battery/load is governed by the later fields with the time windows.