Classic data on Home Assistant

Started by ClassicCrazy, March 01, 2026, 11:58:16 AM

Previous topic - Next topic

ClassicCrazy

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
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

J4501

Thanks for posting this. I have wondered how this is done

qcda1

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:


Regards,

Daniel.
1,2kW on tracker, 1,4kW fixed, 2xMidnite Classic150, Magnum MS4448PAE, 4xMapleLeaf + 1 RUiXU 48VDC/100Ah LiFePO4 and Kohler 14RCA with homegrown monitoring/alerting system + HA.

ClassicCrazy

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:


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
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP

qcda1

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.
1,2kW on tracker, 1,4kW fixed, 2xMidnite Classic150, Magnum MS4448PAE, 4xMapleLeaf + 1 RUiXU 48VDC/100Ah LiFePO4 and Kohler 14RCA with homegrown monitoring/alerting system + HA.

ClassicCrazy

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
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal 24v pack , Outback 3524 inverter
 5s 135w Kyocero , 3s3p 270w Kyocera   Classic 150 ,8s2p  Kyocera 225w to Hawkes Bay Jakiper 48v 20kwh  ,Gobel 16 kwh  lifepo4 Outback VFX 3648  8s2p 380w Rec pv EG4 6000XP