A Forum run by Enthusiasts of MidNite Solar

The Open Source software/hardware corner => General info => Topic started by: hilo90mhz on September 04, 2024, 01:26:02 AM

Title: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: hilo90mhz on September 04, 2024, 01:26:02 AM
I have made a simple ESPhome config for monitoring the Midnite Classic :) maybe useful to someone..

https://github.com/clowrey/ESPhome-Midnite-Classic

Cheers
Title: Re: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: ClassicCrazy on September 04, 2024, 12:02:51 PM
Looks nice , thanks for sharing . I will check it out when I have time.
You may also be interested in this , which is what I have been using . It has an android app but also can send the data as mqtt to whatever - I send it to raspberry pi for graphing.
https://github.com/ClassicDIY
Larry
Title: Re: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: hilo90mhz on September 04, 2024, 02:52:51 PM
I did find the https://github.com/ClassicDIY repo and the forum posts here with you guys getting it working :) and used his examples to help figure out how to interface with the system :).

But it is not applicable to me now as once I have the data in Home Assistant via the ESPhome YAML file in my repo - all the data is now in my dashboard on the HA app on my phone and I can have it send me push notifications if there is any abnormal data. Plus also use the data for automations like turning on the water heater when the battery is full.

Home assistant (on RPI or small X86 system like I use) replaces any other need for logging or graphing or notification apps - In the past I used InfluxDB + grafana - but the setup is cumbersome etc.. HA now does long term statistics and has beautiful dashboards :)

Oh and ESPhome could also talk to a MQTT broker if I wanted, but once you use ESPhome you wont need or want MQTT - the direct HA API ESPhome uses is faster and with encryption so I try to use it for everything if possible.

The attached Home Assistant dashboard is from a system that doesn't use the ESPhome Midnite data source yet but it will - that system has a Midnite Classic 150 I just havent installed one of these on it yet.

That dashboard uses Slipx06 amazing power flow card - it can happily use any data sources not only Sunsynk inverter sources like he used.. https://github.com/slipx06/sunsynk-power-flow-card
The graph is using his examples here which can also be used on any data sources like 100% Midnite gear if you wanted https://github.com/slipx06/Sunsynk-Home-Assistant-Dash

"Home Assistant" is really not the best name for it in some ways - I don't even use it for many smart home uses - just data logging and monitoring mainly. I have it installed at 8x off grid sites so far, working perfectly for years. Home Assistant is the second most active open source project on Github - it is huge with 1000s of contributors so constantly improving.


Title: Re: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: ClassicCrazy on September 04, 2024, 09:17:52 PM
I do want to try out Home Assistant - but I haven't spent the time figuring it out. I did get home assistant running with proxmox on an old small pc , and it found all my Tasmota mqtt devices, and my batteries ( Graham had made his pylon to mqtt home assistant ready). It also found Reolink cameras. When winter comes and things slow down I will fire it up and try it out again.
Your Home Assistant Graphics look really nice so looking forward to integrating whatever I can.
Larry
Title: Re: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: Chasetopher77 on November 26, 2024, 07:16:27 PM
Hey Stupid question,

Does this work with "The One"?

They just updated the MidNite Pro app and I cant find anything in there.
I would love to use Home Assistant to monitor our inverter and batteries.
Only issue is that I have very little to no skill in python and am an enthusiast when it come to home assistant.
Title: Re: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: ClassicCrazy on November 27, 2024, 12:46:05 AM
Quote from: Chasetopher77 on November 26, 2024, 07:16:27 PMHey Stupid question,

Does this work with "The One"?

They just updated the MidNite Pro app and I cant find anything in there.
I would love to use Home Assistant to monitor our inverter and batteries.
Only issue is that I have very little to no skill in python and am an enthusiast when it come to home assistant.
The Classics use modbus protocol , not sure what the new all in one uses - it isn't published as far as I can tell. Best bet to monitor it would be if it is the same as some other Chinese made inverter that someone has already made a github project for. Just figure out which company made the Midnite All in One and then do a search on github and maybe you will get lucky.
Larry
Larry
Title: Re: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: Chasetopher77 on December 04, 2024, 05:24:10 PM
Thanks Ill look into that, though I think the all in one is manufactured by MidNite themselves.
Title: Re: Midnite Classic Home Assistant + ESPhome monitoring via MODBUS
Post by: ClassicCrazy on January 26, 2025, 12:17:49 PM
Quote from: hilo90mhz on September 04, 2024, 02:52:51 PMI did find the https://github.com/ClassicDIY repo and the forum posts here with you guys getting it working :) and used his examples to help figure out how to interface with the system :).

But it is not applicable to me now as once I have the data in Home Assistant via the ESPhome YAML file in my repo - all the data is now in my dashboard on the HA app on my phone and I can have it send me push notifications if there is any abnormal data. Plus also use the data for automations like turning on the water heater when the battery is full.

Home assistant (on RPI or small X86 system like I use) replaces any other need for logging or graphing or notification apps - In the past I used InfluxDB + grafana - but the setup is cumbersome etc.. HA now does long term statistics and has beautiful dashboards :)

Oh and ESPhome could also talk to a MQTT broker if I wanted, but once you use ESPhome you wont need or want MQTT - the direct HA API ESPhome uses is faster and with encryption so I try to use it for everything if possible.

The attached Home Assistant dashboard is from a system that doesn't use the ESPhome Midnite data source yet but it will - that system has a Midnite Classic 150 I just havent installed one of these on it yet.

That dashboard uses Slipx06 amazing power flow card - it can happily use any data sources not only Sunsynk inverter sources like he used.. https://github.com/slipx06/sunsynk-power-flow-card
The graph is using his examples here which can also be used on any data sources like 100% Midnite gear if you wanted https://github.com/slipx06/Sunsynk-Home-Assistant-Dash

"Home Assistant" is really not the best name for it in some ways - I don't even use it for many smart home uses - just data logging and monitoring mainly. I have it installed at 8x off grid sites so far, working perfectly for years. Home Assistant is the second most active open source project on Github - it is huge with 1000s of contributors so constantly improving.


I got my Home Assistant . I  don't need any esp involved since Home Assistant can modbus directly to the Classic. ( thanks for Graham for this approach). How did  you make the bottom graphic of the graphs ? I am also using the Sunsyk app to bring in a second controller and inverter, though i haven't made it look quite as nice as you did yet .
Thanks for the ideas.
Larry