Bridge local MQTT broker to SAJ server #4
Replies: 12 comments 39 replies
-
|
Let me know if the bridging works for you as well. 😉 If you already poisened your dns locally, you can skip the adguard step for dns rewrite. |
Beta Was this translation helpful? Give feedback.
-
That doesn't sound good, will have to try myself to see if it happens as well with the AIO3 module... 😢
Hmm, I'm not seeing all these topics when I sniffed my network with tcpdump... |
Beta Was this translation helpful? Give feedback.
-
|
There is no webserver in my dongle. I'm using one of the integrations which talks to the SAJ server to get its data. Definitely not ideal and it needed tweaking to make it work. Messing around with a modbus hardware intervention was more effort than I wanted to make. mqtt was the middle ground and seemed like a good compromise which I'll try again with. I used wireshark to capture what the dongle was up to - which also got me the credentials I needed to allow the dongle to connect to mosquitto after poisoning the DNS. I was surprised I had to sniff on the actual wifi rather than on the eth adapter where the mqtt server was, after all, the traffic ends up on the eth for the server to see it. I hadn't thought about the possibility of different capacity inverters using different firmwares. But that could explain why nothing I've tried works "out of the box". In which case it'll probably need more time spent on it than I'll have available this weekend. Ugh. |
Beta Was this translation helpful? Give feedback.
-
|
interesting! I like the MQTT approach (if we get it working). I still want to use the SAJ mobile app but also get the real time info from the inverter in Home Assistant. So poisoning the DNS to a local MQTT broker in the LAN and forward the MQTT message to SAJ makes sense to me. |
Beta Was this translation helpful? Give feedback.
-
Not a problem, I'm also running mqtt broker with username/password. You'll just need to add the saj username/password to the list of logins in the mqtt broker config. The dns rewrite can be done in adguard with a single line (replace with your HA ip if you are running the mqtt broker addon in HA, or the IP of your mqtt standalone instance): Scripts don't need to be installed themselves, you can just run them with python. Dutch is fine for me in direct communication. On github I rather keep it in English so everyone can follow. 😉 |
Beta Was this translation helpful? Give feedback.
-
|
Done!I’m looking forward to see how this works. I think is much cleaner than the elfin solution.Do you resend the information to the original broker ? Or do you use it isolated ?El 31 des. 2024, a les 20:22, h3llrais3r ***@***.***> va escriure:
@miquelbotanch Please DM me on ***@***.*** so I can reply.
Replied as well ;)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
And what if they force an update using the broker, and the we loose the magic, because as far as I know, bringing is both ways so, exist the possibility that they force the upgrade and this propagate to our MQTT and then we loose all the magic.Enviat des del meu iPhoneEl 2 gen. 2025, a les 22:14, h3llrais3r ***@***.***> va escriure:
Yes, data is still sent to the original broker. That's why we are bridging it, so you can still use the saj e-solar app. ;)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Good afternoon, @h3llrais3r I'm finally revisiting this after being forced into action by SAJ desupporting the old website. I'm running a mosquitto MQTT broker in a container on the same Pi as HomeAssistant (also in a container). HA has the MQTT integration installed. I've poisoned the DNS, and MQTT requests from the eWifi2 dongle are being captured by mosquitto. I installed the saj_mqtt integration and have 77 sensors in HA from it. So far, so good! The instructions above about how to set up the bridging were rather confusing. So I added the following to my mosquitto.conf and the mosquitto log shows no errors connecting the bridge so I assume data is being propagated, but the SAJ portal at https://fop.saj-electric.com/saj and the new version at https://eop.saj-electric.com/index both show no data since the poisoning went into effect. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
configured everything but the bridge doesn't work |
Beta Was this translation helpful? Give feedback.
-
|
File "/config/custom_components/saj_h1_mqtt/init.py", line 142, in async_setup_entry |
Beta Was this translation helpful? Give feedback.
-
|
two days ago I could see the entities even if they are not available because it keeps giving me this error: |
Beta Was this translation helpful? Give feedback.






Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This post comes from this issue, in particular it has been posted by @h3llrais3r
Ok, I thought the infamous firmware was for the inverter... but it's for the battery I assume?
My inverter is the H1-5K-S2 with firmware 1.202.
For the battery I can see a software version, which seems to be 1.152
Based on https://solar-assistant.io/help/home-assistant/broker-setup
mqtt.saj-solar.comto your mqtt ip address (I'm running the mosquitto addon in HA, so for me it's the HA ip)customize: trueandfolder: mosquittoto mosquitto config/share/mosquitto/saj_mqtt_bridge.confwith following content to bridge saj app topic to still have access to the data from the saj app:addresscontains the real ip ofmqtt.saj-solar.comremote_usernamecontains the username used by saj to connect tomqtt.saj-solar.comremote_passwordcontains the password used by saj to connect tomqtt.saj-solar.comsaj/<serial>/realtime_dataPlus, but other firmwares might be usingsaj/<serial>/realtime_data)With this setup, the app still gets the data, but I don't think remote control is still possible as I'm not bridging the data_transmission topic, so even if it's published on the remote broker, it won't be bridged as it's not part of the bridge topic config.
Only problem I can see now is that the ip address of
mqtt.saj-solar.comcan change and the bridge woudn't work anymore until the ip is updated in the bridge config.If I would be able to change the mqtt server on the aio3 module directly (I know you can change it via the app, but I never tested it yet) and it actually also keeps that value after a reboot, then the adguard dns rewrite could be removed and in the bridge config, I could put
mqtt.saj-solar.comas address instead. Then it should work also when the ip address is changing at saj side..So I still need to check if the mqtt server can be changed and if it's kept after a restart of the aio3 module.
PS: I suppose you know the credentials for saj mqtt? If not, I can share in PM.
Beta Was this translation helpful? Give feedback.
All reactions