Go to Settings/ Devices and Services in HA
add modbus to Home Assistant
Then add this to your HA config ( change to your classic IP adress )
modbus:
- name: modbus_hub
type: tcp
host: 192.168.1.1 # your classic ip address
port: 502
sensors:
- name: "Classic Battery Voltage"
unique_id: "classic_batt_v_main"
address: 4114
input_type: holding
unit_of_measurement: "V"
scale: 0.1
precision: 1
- name: "Classic Input Voltage"
unique_id: "classic_pv_v_main"
address: 4115
input_type: holding
unit_of_measurement: "V"
scale: 0.1
precision: 1
- name: "Classic Battery Current"
unique_id: "classic_batt_amps_main"
address: 4370
input_type: holding
unit_of_measurement: "A"
scale: 0.1
precision: 1
- name: "Classic Power Output"
unique_id: "classic_watts_main"
address: 4118
input_type: holding
unit_of_measurement: "W"
- name: "Classic Energy Today"
unique_id: "classic_kwh_today_main"
address: 4117
input_type: holding
unit_of_measurement: "kWh"
scale: 0.1
- name: "Classic Battery Charge State"
unique_id: "classic_state_raw"
address: 4119
input_type: holding
- name: "Classic Reason For Resting Code"
unique_id: "classic_resting_raw"
address: 4274
input_type: holding
Larry
Thanks for posting this. I have wondered how this is done
If it can help, I just finished a Home Assistant custom component that can read pretty much all the Midnite Classic's registers and more and create corresponding sensors/entities in Home Assistant that can be used to control and chart stuff and feed the nice Sunsync power flow chart.
The custom component is in GitHub at https://github.com/qcda1/ha_midnite_classic
At installation, the user can select the values he want to be created as entities in HA from a total of 54 from which 11 are selected by default. The sampling period can be specified from 30s to 1 hour. The Classic must be on the same LAN than HA and a host name should be configured as this will be the name of the equipment in HA.
Here is a sample installation picture:
(https://github.com/qcda1/ha_midnite_classic/blob/main/ha_midnite_classic.png)
Regards,
Daniel.
Quote from: qcda1 on March 30, 2026, 05:28:40 PMIf it can help, I just finished a Home Assistant custom component that can read pretty much all the Midnite Classic's registers and more and create corresponding sensors/entities in Home Assistant that can be used to control and chart stuff and feed the nice Sunsync power flow chart.
The custom component is in GitHub at https://github.com/qcda1/ha_midnite_classic
At installation, the user can select the values he want to be created as entities in HA from a total of 54 from which 11 are selected by default. The sampling period can be specified from 30s to 1 hour. The Classic must be on the same LAN than HA and a host name should be configured as this will be the name of the equipment in HA.
Here is a sample installation picture:
(https://github.com/qcda1/ha_midnite_classic/blob/main/ha_midnite_classic.png)
Regards,
Daniel.
did you build write commands in that to be able to change setting or do something like force bulk or float , etc ?
Your project looks good though I haven't tried it because what I have above in first post is working for me now.
Larry
Sorry for the delay. Since I'm new to writing code as HACS integrations, I concentrated on the easy stuff. I'm now looking at the ability to write on some Classic's registers. Just need to figure out which ones I should start with. I also need to consider extra validation/safety to make sure no garbage ends up in the registers.
BTW, any preferences in the registers you would like me to start with?
Daniel.
Quote from: qcda1 on April 07, 2026, 03:04:12 PMSorry for the delay. Since I'm new to writing code as HACS integrations, I concentrated on the easy stuff. I'm now looking at the ability to write on some Classic's registers. Just need to figure out which ones I should start with. I also need to consider extra validation/safety to make sure no garbage ends up in the registers.
BTW, any preferences in the registers you would like me to start with?
Daniel.
Now that I think about it , maybe just easier to use the Midnite Local Status app to write changes. But keep in mind that there is only one modbus ip to Classic at a time. So if anyone wanted to use the Local status app when your monitoring is running it won't connect . Graham of Classic DIY on github had his monitoring app have a delay in there somehow so if the Local Status app was turned, it could butt in and get the connection. Otherwise if your app had an easy way to disable that would work.
But if you want to experiment with writing maybe start with something like Absorb Time or Float voltage - things that wouldnt mess up a battery too much if they goofed up. What would be really nice is if you could put limits in so that it wouldn't be able to write a value that was way off.
One of these days I will try your app - just a matter of time cause I have too many projects going now!
Larry
Hello. Just for your info. I'm about to push a new release that will allow the user to remotely update some operational registers from Home Assistant.
I'm in final testing and it works fine. Here is how it look in "develop" branch:https://github.com/qcda1/ha_midnite_classic/tree/develop
BTW, I'm testing in parallel of my acquisition program that fetch data every minute. I could get a few second delay but no read failure.I ran the HA updates at 10 second interval without any issue other than a feeling of performance impact on Home Assistant page refreshes.
New release with update capabilities available.
https://github.com/qcda1/ha_midnite_classic
Quote from: qcda1 on April 14, 2026, 04:25:16 PMNew release with update capabilities available.
https://github.com/qcda1/ha_midnite_classic
Fantastic ! I removed my old style of getting the Classic data from Home Assistant. Then I followed your instructions for installed this via Hacs and it all worked !
My next task was to clean up the old entities I had in HA which I know how to do now. My new trick is to use the google Gemini AI add on in VScode and had it find all the old entity names in various templates and automation that I had , and substitute in the new entity names. That sure saves a lot of work on my part.
My old brain appreciates this help.
This is a great Home Assistant HACS add on . I especially like the ability now to change settings though I haven't had time to try those yet ( and confirm them).
I wish I had an extra Hawkes Bay to send you to make an add on for that ( and for Rosie's too) .
But at least the python code that I made is getting the data into Home Assistant .
Maybe I will ask AI sometime to see if it can make a HACs integration in the style that you did but that sounds like a winter project for me.
Thanks for this great Classic to HA addition.
Larry
You're very welcomed! Glad it makes sense for you. For your other Midnite devices, do you know where to get the communication specifications? I understand the Rosie inverter/charger uses the CANBUS protocol... I'll ask AI. Maybe we can do something.
Quote from: qcda1 on April 17, 2026, 02:05:50 PMYou're very welcomed! Glad it makes sense for you. For your other Midnite devices, do you know where to get the communication specifications? I understand the Rosie inverter/charger uses the CANBUS protocol... I'll ask AI. Maybe we can do something.
My project is on github - already have it talking to the Hawkes Bay and Little Rosie on canbus.
https://github.com/larduino/hawkesbay-can2mqtt
Larry