Comments (16)
Hi @PhillyGilly
I picked up this from Ebay UK - from a seller called Puretek.
They seem to be reasonably generic - the only gotcha being the silkscreen for the RS485 cables is marked back to front - so if it doesn’t work - swap the cables.
XY-017 3.3v 5v 12v RS485 TO TTL RS485 SP3485 RS-485 Breakout For Arduino RPi
https://www.ebay.co.uk/itm/274273632839
The Arduino seems more than cabable of relaying 1 second resolution across 10-12 attributes + even storing data locally to an SD (which I’ve not debugged as yet). Certainly plenty of oomph to integrate an MQTT library and post there.
I thought about home assistant - nothing wrong with it; but went this route for a few reasons:
- The challenge - a little bit of coding
- Arduino is slim - no O/S
- Raspberry Pi is/was short on supply
- Minimal software hardware stack - no cloud, less to break etc.
I’ve also found a thing called a Arduino Wemos D1 - which is a perfect client too this and can display simple red/amber/green lights + operate an external relay depending on solar availability.
I’m sure you could well do this with home assistant etc - I guess at the end of the day I preferred debugging a few hundred lines of code than configuration files :)
Regards;
from solar.
Hello @RichardL64. Thanks for the helpful reply.
I got the Puretek part thanks and am waiting on delivery of 50(!) sockets from China.
I like to do Fritzing sketches for all my Arduino projects and it it's any use here is one for this project (although I may have the TX to RX wrong bearing in mind your comment about the screen printing.)
My Solis inverter is a six month fix to non-availability of GivEnergy G2 kit, and it's there working away without either a dongle or meter/CT which I don't want to buy. So my only option to get data is to work locally with the RS485. As I've got HA up and running (RPi4 with SSD) with a lot of my energy consumption data it suits me best to get the inverter data in there too.
The coding approach I used for my Arduino energy meter was to use the MQTT pubsub.h then; 1. on initialisation publish a json file containing the HA auto-discovery data, and 2. periodically publish the json data to be read by HA. It looks like I can merge this approach into your code.
However before I get on with it, I am wondering about whether or not it will actually work without a meter/CT. So I think I'll probably knock up an exact copy of your project and If it doesn't produce the data I need, decide if I just use my Arduino MQTT energy or have fun adding the ADS115 adc as well as the MQTT. Happy days!
Cheers.
from solar.
from solar.
Hi Richard. I just got delivery from Alibaba of the plugs. When I tested the +5V on my inverter its dead. I'm assuming that's because it goes to sleep when there is no PV? Is that your experience? I'm not sure how I feel about my nano33 rebooting multiple times per day. Cheers. Phil
from solar.
from solar.
Hi @RichardL64 . I tested my inverter with a voltmeter across the pins (Blue: pin4 = 1.6v, Yellow: pin3 = 3.2v) and it definitely powers the RS485 down if the sun isn't shining so I'll probably keep the nano USB powered for the time being.
I also finally got delivery from China of the Exceedconn plugs and sockets. (I have put the remainder on sale on eBay http://ebay.co.uk/itm/195464332269 although I don't expect to make money on it, somebody else might want/need these parts).
Before attempting any serious coding, I got the example ModbusRTUClientKitchenSink sketch from the IDE, cut out all the calls apart from requestFrom, and compiled it to the nano. It runs and returns 1 to ModbusRTUClient.begin(9600), but the requestFrom fails with an error "Connection timeout" whatever register address used and for both combinations of AB inputs. I'm really scratching my head, but there's no point in going any further until I can get the underlying comms working. I have ordered a USB/RS485 plug to test the comms directly from my laptop. But meanwhile, any ideas however basic would be appreciated. TIA.
from solar.
from solar.
Agreed, the display is also off when not generating. I will re-check the 5V line tonight, but when I "commissioned" it, I worked in the evening to minimise DC risks. After it was all set up, I closed the MCB and turned on the AC isolator and nothing happened. I was convinced I'd made a mistake, but the next morning when I tried again it was working. I guess that Standard Stick is designed to power down and then power up?
from solar.
It's a configurable option in the Advanced settings. 24H Switch. Default is Disabled, but if you Enable it the inverter doesn't go to sleep.
from solar.
from solar.
It looks like enabling the inverter gets it to draw 60 W when the inverter isn't generating (that's the drop off in the raw purple line). It could be a bit less as my Arduino CT doesn't know about the power factor, but I can't match it exactly to the smart meter out put as both are on 10sec samples but not aligned.
So enabling the inverter overnight could use up to 1kWh which is the opposite of what I want to achieve.
I'll get the basic 485 working next week and then devise a strategy to deal with the inverter going to sleep...
from solar.
I had the rx-tx wires crossed. Here is my revised Fritzing sketch.
The example is running although I am having to offset the address by one, which I don't know if you are doing.
from solar.
from solar.
Hi @RichardL64, I thought I'd give you a quick update:
- Up and running!
- In the end my code isn't that similar to yours, because:
a) I'm not a very good coder, and b) the arduino just posts out the modbus data by mqtt as soon as it reads it, so there isn't any need to hold it locally. I just keep it in global variables. - If your interested I can share it with you via Github. I haven't really tried to make the functions efficient as I don't need to, so I'm not going to hold it up as an example of how to do it.
- My inverter S6 uses different modbus addresses from your hybrid inverter. So if I want to know what is at address 3000, I have to interrogate address 2999. This is what I meant by offsetting the address.
- I solved the "inverter asleep at night" problem by working on the idea that if the modbus stopped communicating it meant the inverter had powered down. When that is detected "dynamic" values are set to 0 and "integrated" values are set to their last known value. That seems to placate my Home Assistant.
- As the arduino is in my loft next to the inverter which is five flights of stairs up from my office, so I use OTA and don't bother with any serial print for error traps. If I do want to know what's happening, I publish a mqtt message.
- I still need to work out how to write into the modbus time registers as I need to synchronise times so that "daily" values are for the same 24hrs. I have no idea how to take the time values as strings and convert the right bits into unsigned-16 but I'm sure that somebody somewhere has cracked it already.
Cheers and thank you!
from solar.
from solar.
Here is my first attempt at a repository
https://github.com/PhillyGilly/SolarisS6ArduinoMqtt
I am going to have to work on formatting my reade.md and adding pictures.
OTA is part of #include <ArduinoOTA.h>
It's really simple and works well on the IDE v2.
from solar.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from solar.