Solar Dashboard - Decoding the Iconica IC-WIFI protocol (PI30)
The scraper landed on 27 August and the relay two days later. By the evening of 29 August, I had the first raw messages sitting next to the old dashboard's readings of the same moments. The first draft of the field mapping was committed the same evening, based on 26 pairs.
Getting that first draft was rather easy. It took much longer to find out which of the early conclusions were wrong.
What the inverter says
The messages below come from the IC-WIFI module of my Iconica IC-BM2000-24 inverter.
Apart from the firmware poll, each message is a plain-text HTTP request with comma-separated values.
The header carries a fixed WIFI prefix, the serial number of the communication module, a protocol id and the message type.
| Type | What it is | How often |
|---|---|---|
| DT | the readings (voltages, currents, powers, mode, status bits) | about once a minute |
| ST | the communication module starting up | on every reconnect, in pairs |
| SN | a device announcement | rarely |
| RT | the inverter's ratings | rarely |
| ET | events, such as a grid failure | when something happens |
| firmware poll | a request for the firmware manifest | now and then |
I was pleasantly surprised by how simple the vendor's responses are.
Every acknowledgement is just an echo of the first four fields of the request.
The firmware poll is the exception: an empty GET answered with a list of the card's firmware files and their timestamps.
That made it easy for the relay to answer on the vendor's behalf later on.
Here is one complete exchange, a DT message from a sunny late morning and the vendor's reply:
1POST /cmmq/dataCenter HTTP/1.1
2Content-Type: text/plain
3
4WIFI,9800XXXXXXXXXX,30,DT,9263XXXXXXXXXX,B,232.0,49.9,228.0,49.8,0432,0183,021,25.38,000,059,031.2,-,-,-,-,-,0006,00004,10010111,00148,49.9,233.0,49.9,25.38,357,059,-,0433,0181,020,0042,-,-,-,20260830114315
1HTTP/1.1 200 OK
2
3WIFI,9800XXXXXXXXXX,30,DT
The picture below shows the same message laid out by position. Quite a lot of it carries no information at all.
The communication module polls the inverter over RS232 and re-packs the answers, so a fair share of the slots belong to features this single-tracker unit doesn't have. Some of them are empty, some leak copies of other fields, and three are second readings of the AC output taken a moment later.
Lining the two up
To decode a field, I need the raw value and the old dashboard's interpretation of the same message. Pairing them by the time of receipt didn't work well, as it drifts by about a minute.
What worked was the communication module's own clock. Position 40 of a DT message is its local timestamp, and it is exactly what the old dashboard shows as the time of the reading. That clock is not reliable as a wall clock (it carries no time zone), but it works very well as a key for pairing. 226 of the first 228 historical rows paired up to the second.
The historical view was not enough though. It shows 15 columns, while the momentary view returns about 47 values behind the scenes, and each new message overwrites the previous one. So the scraper gained a watch mode, polling the momentary view every 30 seconds, faster than the inverter sends. That was the only way to capture the vendor's decoding of every single message.
Running my own experiments
Waiting for diversity in the data, as I asked the agent to do, can take a long time. Some of it I could provoke myself:
- on 29 August, at 22:30, I cut the grid supply in a controlled way, which confirmed the battery mode, the discharge current and the first events (matching the timeline of the experiment to the second),
- on 30 August I switched the inverter off, which revealed the standby mode and the meaning of one of the status bits,
- on 6 September I changed the charging programme and the inverter charged the battery from the grid for the first time, which showed that the status bits are reported per source.
Early conclusions that turned out wrong
Some early conclusions didn't survive more data:
- the status bits were read one way on 30 August and overturned on 6 September by my charging experiment,
- the charging current turned out to be truncated rather than rounded, which made the solar charging energy come out 16 % too low.
A smaller one was a matter of naming. The protocol document calls position 25 "PV charging power", the old dashboard "PV input power". It is the solar charger's total output, which goes into the battery while the grid carries the load, and partly to the load in battery mode, so the protocol's name is just a little imprecise.
Each of them looked fine with the data I had at the time, so I learnt to read "confirmed" as "not contradicted yet".
When the vendor is wrong
The old dashboard was my reference, but it is not always right. It:
- shows one of the status bits as "AC charging" even when the battery is charging from solar,
- carries what is most likely the heat sink temperature under a key named after PV power,
- shows
--instead of a zero charging current, - turned a grid voltage of
001.0, sent during the outage, into0.0.
In those places my views deliberately disagree with it. For the first three, the verification treats the disagreement as expected rather than as a tolerated error; the outage voltage is the one difference it simply tolerates.
Identical payloads are not duplicates
I had to change one of my original decisions on the very first evening.
I said in the spec that two messages with identical payloads are the same message, so duplicates could be dropped safely. About 90 minutes after the relay went live, it was obvious that this is wrong. Some message types, like the firmware poll, carry so little information that byte-identical payloads repeat as genuinely separate messages.
So every record now gets its own unique id when it arrives, and that id is its identity. A hash of the content is still stored, but only to help with the analysis.
An independent witness
With the field mapping folded into the database views, I needed a way to check that the views decode the messages correctly.
The first round of verification was the tests. The tests' expectations were written by Claude, as were the views, so I wanted an independent cross-check.
This is why I was feeding the old dashboard: it decodes the very same messages independently of my code.
The second round, sd verify views, pairs each real DT message dissected in the view,
with the dashboard's reading of it, using the communication module's clock to the second, and compares every value
both of them have.
Against the live database that was 1200 pairs, at the time.
Where we already knew the old dashboard is wrong, the difference is expected and is a condition to pass.
I also had to make sure the check can actually fail, as a check that always passes is of no use to me.
Earlier that day I had asked Claude to prove another check fails before it passes (as if I was doing TDD),
and this time it didn't need asking: it reviewed sd verify views adversarially before I trusted it.
The review found a few problems, including:
- an empty column counted as agreement, so a field that was never filled in passed every assertion,
- a filter for stale readings also removed every reading with the load or charger off, so the on/off flags were never tested being "off".
After the fixes, Claude introduced eight deliberate mistakes one at a time, such as a wrong scale, a field read one position along and a dropped fixture header, and the check caught every one of them.
What I like about this check is that it ties every decoded field back to an independent source, so a new interpretation of the protocol can be tested against all the history in one go.
What I took from it
What I took from it is that an approximate spec is a good starting point, but it is the real data that decides. If the data doesn't vary enough I can make it vary myself (carefully, it is a live installation). I am now suspicious of anything "confirmed" in just one mode of operation. And since Claude wrote both the views and the tests, I want an independent source to compare against, and I want to see a check fail before I trust it passing.
Once I could trust the dashboard, it started showing me things I wasn't even looking for. The most surprising one was that my battery bank behaves like a fraction of its nameplate capacity. That deserves a post of its own.
Other posts in solar-dash series
- The challenge
- The vision
- Claude setup
- Phased approach
- Learning the protocol
- Managing agentic output
- Reflecting on agentic coding
- Conclusions