News:

To visit MidNite Solar click this link www.midnitesolar.com

Main Menu

Recent posts

#21
part two video of the Little Rosie canbus wiring and software development
https://youtu.be/4lQMH0lgGTE

Larry
#22
The Rosie / Re: Rosie in South America Guy...
Last post by ClassicCrazy - December 28, 2025, 03:10:27 PM
Quote from: mahendra on December 28, 2025, 01:55:18 PMSome new errors from Rosie .
Had to shutdown.s
eems like powerflo battery no.2 again causing issues.

All updates are just before the recent 19 December 2025.

Will update and to most recent and check.

Rebooting didn't resolve.

Why don't you just go to open loop charging ? Unplug the canbus cable and put in the Absorb, absorb time, and Float .  It works pretty good .
Larry
Larry
#23
The Rosie / Re: Rosie in South America Guy...
Last post by mahendra - December 28, 2025, 01:55:18 PM
Some new errors from Rosie .
Had to shutdown.s
eems like powerflo battery no.2 again causing issues.

All updates are just before the recent 19 December 2025.

Will update and to most recent and check.

Rebooting didn't resolve.
#24
Midnite Combox / Another combox idea ? Sort of ...
Last post by ClassicCrazy - December 28, 2025, 12:39:35 PM
I asked the Google Gemini AI about an idea I had for coordinating different controllers together. Here is my question and the answer.
question  to AI
With AI help I just developed the can2mqtt_hbay.py software running on a pi5 . This is to monitor the Hawkes Bay and Little Rosie via canbus.  But my system also has a Midnite Classic controller and a Victron 450/100 controller.  They are all being monitored by Home Assistant. The Hawkes Bay via canbus, the Midnite Classic via modbus IP, and the Victron via Victron BLE bluetooth integration.  I also have a Victron Smart Shunt which I use as point of truth  SOC for 8 different lifepo4 batteries . 
Sometimes the different controllers don't sync with each other very well . Midnite has a mode for different Classic Controllers called Follow Me so that all the controllers would follow the lead controller in going to Float . Do you think it would be too difficult to try to use Home Assistant or a python code running on raspberry pi to try to get all the different controllers on my system to be more in sync with each other in something of the same way that the Classic Follow Me worked ?


Answer
That is a fantastic project. You've essentially built a "polyglot" power system where every component speaks a different language (CANbus, Modbus TCP, and BLE).

Syncing these is definitely possible and, honestly, a very common evolution for advanced DIY power systems. Since you already have the can2mqtt bridge running on a Pi 5 and everything reporting to Home Assistant (HA), you have the perfect foundation to build a "Virtual Master Controller."

Here is how you can approach replicating the "Follow Me" logic.
The Concept: "Virtual Follow Me"

In the Midnite world, "Follow Me" works by controllers sharing their state (Bulk, Absorb, Float) over a network cable. To replicate this, you will use Home Assistant as the "Brain" and your Python scripts or HA Automations as the "Coordination Layer."
1. The Source of Truth

Since you have a Victron Smart Shunt, you already have the most important piece of data: the State of Charge (SOC) and the Net Amps.

    The Problem: The Midnite and Victron MPPTs calculate their own internal logic based on battery voltage, which can sag or spike depending on the load, leading to one controller dropping to Float while the other is still hammering away in Bulk.

    The Solution: Use the Smart Shunt's SOC or Voltage as the trigger to force the other controllers into specific modes.

2. Implementation Strategies
Option A: Home Assistant Automations (Easiest)

Since all data is already in HA, you can create an automation that monitors your "Lead" device.

    Logic: When the Victron 450/100 (or the Shunt) hits a certain voltage/SOC, HA sends a Modbus command to the Midnite Classic and a CANbus message (via your script) to the Hawkes Bay to switch to Float.

    Pros: Low code; easy to tweak UI sliders for setpoints.

Option B: A Dedicated Python "Sync" Script (Most Robust)

Since you are already comfortable with Python on the Pi 5, you could write a coordination script that:

    Subscribes to the MQTT topics from your can2mqtt_hbay.py.

    Polls the Midnite via Modbus.

    Acts as the "Grand Orchestrator."

Technical Challenges to Consider
1. Modbus/CANbus Write Access

Monitoring is easy; controlling requires knowing the specific registers.

    Midnite Classic: You'll need to write to the "Charge State" registers via Modbus TCP to force a transition.

    Victron: The BLE integration is often "read-only." To control the Victron 450/100, you might eventually need a VE.Direct to USB cable or a GX device (like a Cerbo) to allow HA to "push" settings back to it.

2. The "Ping-Pong" Effect

If two controllers have slightly different Float voltages (e.g., 54.0V vs 54.2V), the one with the higher setting will carry the entire house load while the other stays idle. To truly "sync" them, you don't just want them in the same mode; you want them calibrated to the exact same Voltage Reference.
3. Safety First

Always ensure your hardware-level "Over-Voltage Protection" is set slightly higher than your software-controlled limits. If the Pi 5 crashes or the Wi-Fi drops, the controllers should fall back to their internal safe settings.
Is it too difficult?

No. Given that you've already mastered CANbus on a Pi 5, you have already cleared the hardest technical hurdle.

The most elegant way forward: Use Node-RED (available as a Home Assistant Add-on). It allows you to draw the logic flow: If Shunt SOC > 99% AND Net Amps < 10A, then Send "Go to Float" to Midnite (Modbus) and Hawkes Bay (MQTT).

Would you like me to help you find the specific Modbus registers for the Midnite Classic to force it into Float mode?

Not right now - I am going to be hooking up a raspberry pi running Victrons Venus OS to the Victron 450/100  and will see how that goes since that should give me some control capability of the Victron controller ( I think ).

Moving to Venus OS on a Raspberry Pi is a smart move. It transforms the Victron 450/100 from a standalone device into a network-aware component that can act as a "System Master."

The Victron 450/100 is a powerful unit (VE.Can and VE.Direct), and once it's under Venus OS control, you'll gain DVCC (Distributed Voltage and Current Control) capabilities.
Why Venus OS changes the game for your "Sync" problem:

    DVCC (Distributed Voltage and Current Control): This is Victron's version of "Follow Me." When enabled, the Venus OS takes the "Point of Truth" (your Smart Shunt) and broadcasts the charge voltage and limit to all connected Victron controllers. They will then charge as a single, synchronized unit.

    Modbus TCP Gateway: Venus OS has a built-in Modbus TCP server. This means Home Assistant can easily "talk" to the Victron controller through the Pi running Venus OS, rather than trying to struggle with BLE.

    MQTT Integration: Venus OS publishes everything to its own MQTT broker. You can bridge this to your existing Home Assistant broker, allowing your Hawkes Bay and Victron units to share the same data stream.

Your "Hybrid" Follow Me Strategy

Once you have the Victron side synchronized via Venus OS + Smart Shunt, you can use the data from Venus OS to "command" the Midnite Classic and the Hawkes Bay:
Component   Sync Strategy
Victron 450/100   Handled automatically by Venus OS DVCC (using Shunt as lead).
Midnite Classic   Use a Home Assistant automation to read the Charge State from Venus OS (via MQTT) and write the corresponding state to the Midnite via Modbus IP.
Hawkes Bay   Use your can2mqtt_hbay.py script. Have HA send a command to your script when the Victron enters "Float," then have your script push the CANbus message to the Hawkes Bay.
Potential "Follow Me" Logic to Script

In Home Assistant, you can create a "Master State" sensor.

    If Victron State = Float

    Then set Midnite Register 4102 (Charge State) to Float.

    Then send MQTT topic: hbay/command/state payload: FLOAT.

Next Step: Once you have Venus OS up and running, would you like the Python logic for a "Bridge" script that listens to the Victron state and automatically updates the Midnite/Hawkes Bay?

end of AI chat

This is just an idea I had and thought I would bounce it off of AI to see what it thought. There are also some github projects out there that use esp32 to get lithium battery canbus data and then be able to repackage it with the flexibility and parameters we want, and then send that to controller in closed loop to start and stop charging . That might be another approach to tweaking mulitple controllers to play nicely together.
Larry

#25
Rosie is now supported on my project along with the Hawkes Bay .
https://github.com/larduino/hawkesbay-can2mqtt
The graphic below is just a test one from Home Assistant and they can be made however you want them.
Larry
#26
Quote from: bigbillsd on December 25, 2025, 05:05:07 PMThanks!   I decided to try using AI to create a batch file to transcode my OTA tvshows from mpg to mp4 using an h.265 codec and the results were amazing.  In seconds it did what took me literally weeks of trial and error, and it worked first try. I am glad I am not an IT worker anymore as I see high paying careers going the way of the horse and buggy.   
I just spent a couple days updating the project - take a look if you want .
https://github.com/larduino/hawkesbay-can2mqtt
 I tried to clean up the github page too.
I also think about what it must be like for a programmer looking at AI. You still have to steer the AI in the right direction and know a bit of what to ask it to do.
But it explains everything it does in detail without ever calling you names for not getting it - haha!
#27
Thanks!   I decided to try using AI to create a batch file to transcode my OTA tvshows from mpg to mp4 using an h.265 codec and the results were amazing.  In seconds it did what took me literally weeks of trial and error, and it worked first try. I am glad I am not an IT worker anymore as I see high paying careers going the way of the horse and buggy.   
#28
Little Rosie(MNLR4548RE and MNLR3648M) / Re: Little Rosie first impress...
Last post by Saggys - December 23, 2025, 08:06:48 PM
Wow, that's impressive. I am happy with just knowing the SOC of the batteries at the end of the day. I am
so behind on data collection.
#29
Quote from: bigbillsd on December 23, 2025, 11:57:56 AMI would love to hear how you are using AI to write programs!   I was a programmer back in the 90's (yes eons ago)  and now I just write a few simple batch commands as I don't really want to go down that rabbit hole again.  I really loved to write code but I found I would stay up all night to get it right..  over and over...  ;)  -Bill



You just go on chatgpt or google gemini AI and ask it what you want to do . Give it as much information as you can . Then you have to check what it does , feed it back errors , and guide it along so it doesn't try to do stuff too complicated sometimes.  So takes some time, but no way I could write all the code.
I thought I had canbus noise causing errors and chatgpt was suggesting maybe the end resistors weren't on or in wrong part of loop, etc.I checked everything. The errors were some really large numbers that were showing up in the data.
Next day I switched to Google Gemini AI and it spotted the issue right away - it was the canbus not sending a number and then the calculation went ahead and posted the crazy high value.
It redid all the chatgpt code and I think made it better. It had it's own issues to chase down and correct. Like when the data was coming in the numbers were fluctuation all over the place so it put in throttling and smoothing stuff in the code.
I didn't give it the full canbus data document at first because when I did that with chatgpt it ended really slowing down responses and timed me out later cause I reached the daily free limit.
I then used gemini ai and didn't want to bog it down but I wasn't giving it the correct canbus stuff it needed. At the end of the day , I finally gave it the canbus document and it just read it quick and  then spit out the correct code that we had tried to figure out all day. I told it I didn't give it the document at first because of my chatgpt experience and it said how it is a different model ai that can take in all those documents no problem .
So you live and learn .
But even with AI I stayed up real late some nights too !
I am just the coach and tester.I just got Rosie data going - will post the updated code to github soon.
here is the mqtt data that is posting so far.
hawkesbay
whizbang
amps = -1.2
battery
power = 0.0
voltage = 54.3
current = 0.0
charge_stage = Resting
state = {"battery": {"voltage": 54.3, "current": 0.0, "power": 0.0, "charge_stage": "Resting"}, "rosie": {"voltage": 119.9, "load_watts": 29.7, "fet_temp_f": 81.5, "transformer_temp_f": 82.8, "frequency": 59.99, "batt_temp_f": 71.1}, "whizbang": {"amps": -1.2}, "pv": {}, "daily": {"kwh_today": 5.4}, "timestamp": "2025-12-23T21:57:41.955084+00:00"}
pv
voltage = 346.5
watts = 0.0
daily
kwh_today = 5.4
rosie
voltage = 119.9
load_watts = 30.4
frequency = 59.99
batt_temp = 71.1
fet_temp = 81.5
transformer_temp = 82.8

Here is what it told me about the wrong big number value
That large number 6553.5 is a classic digital "null" or "high-impedance" value. In hex, that is 0xFFFF.

When the Hawkes Bay goes into "Resting" mode at night, it effectively disconnects the PV input. Instead of sending 0, the register returns all ones (0xFFFF). Because our script divides by 10, we get 65535/10=6553.5.

so to solve that it put a filter in there to not show anything above 600

I like that it explains every step so you can learn
Larry
 
#30
I would love to hear how you are using AI to write programs!   I was a programmer back in the 90's (yes eons ago)  and now I just write a few simple batch commands as I don't really want to go down that rabbit hole again.  I really loved to write code but I found I would stay up all night to get it right..  over and over...  ;)  -Bill