@boydo any luck creating the sensors in HA again? Still no luck working for me
@boydo I havenât got that bit integrated to HA yet, everything else Iâm feeding in through MQTT at the mo using the below, running stanalone on a separate raspberry pi due to my issues getting the rs485 usb stick with my synology nas. You may well be able to run it as a python script from within HA, certainly worth a go!
Iâve updated it since I first posted and all the control code is commented out at the bottom.
I was playing around with it just now and got it working, no idea what I did wrong the last time
Hereâs the code in case it might help someone
modbus:
- name: hub1
type: serial
baudrate: 9600
bytesize: 8
method: rtu
parity: N
port: /dev/ttyUSB0
stopbits: 1
sensors:
- name: InverterTemp
slave: 1
address: 33093
input_type: input
count: 1
scan_interval: 15
- name: GenerationToday
slave: 1
address: 33035
input_type: input
count: 1
scan_interval: 15
Question I thought that setting precision: 1
is supposed to turn the 338 value into 33.8 but just changes it to 338.0
Whatâs the correct way to fix it inside of the sensor?
sensors:
- name: InverterTemp
slave: 1
address: 33093
unit_of_measurement: °C
input_type: input
count: 1
precision: 1
scan_interval: 15
Yeah looks like you got it
This is mine so far. just trying to recreate what I had and try the mod time of charge again but this time set the âStorage control switch valueâ that might be what I missed last time!
modbus:
- name: solis
type: serial
method: rtu
port: /dev/ttyUSB0
baudrate: 9600
stopbits: 1
bytesize: 8
parity: N
- platform: modbus
scan_interval: 5
registers:
- name: solisinvertertemperature
hub: solis
unit_of_measurement: °C
register: 33093
register_type: input
count: 1
slave: 1
precision: 1
data_type: uint
scale: 0.1
- name: solisbattarysoc
hub: solis
unit_of_measurement: "%"
register: 33139
register_type: input
count: 1
slave: 1
precision: 1
data_type: uint
#scale: 0.1
- name: solisbatterychargecurrentlimitation
hub: solis
unit_of_measurement: A
register: 33143
register_type: input
count: 1
slave: 1
precision: 1
data_type: uint
scale: 0.1
- name: solisbatterydischargecurrentlimitation
hub: solis
unit_of_measurement: A
register: 33144
register_type: input
count: 1
slave: 1
precision: 1
data_type: uint
scale: 0.1
- name: solisbatterycurrent
hub: solis
unit_of_measurement: A
register: 33134
register_type: input
count: 1
slave: 1
precision: 1
data_type: uint
scale: 0.1
- name: solisbatteryvoltage #U16
hub: solis
unit_of_measurement: V
register: 33133
register_type: input
count: 1
slave: 1
precision: 1
data_type: uint
scale: 0.1
- name: solisbatteryminsoc #U16
hub: solis
unit_of_measurement: "%"
register: 33214
register_type: input
count: 1
slave: 1
precision: 1
data_type: uint
#scale: 0.1
- name: Solis Storage control switch value #U16
hub: solis
#unit_of_measurement: "%"
register: 43132
register_type: holding
count: 1
slave: 1
#precision: 1
#data_type: uint
#scale: 0.1
- name: Solis Time-chargeing charge current
hub: solis
unit_of_measurement: "A"
register: 43141
register_type: holding
count: 1
slave: 1
precision: 1
data_type: uint
scale: 0.1
- name: Solis Time-chargeing discharge current
hub: solis
unit_of_measurement: "A"
register: 43142
register_type: holding
count: 1
slave: 1
precision: 1
data_type: uint
scale: 0.1
I use scale e.g.
precision: 1
data_type: uint
scale: 0.1
Thanks, that did the trick.
Since I have hooked up the modbus adapter earlier today, I am seeing the âgenerationâ spike to crazy values:
I have both the wifi logger connected and the usb rs485 adapter together, I think they might trip over each other when reading the data at the same time?
I tried âslave: 2â but it only works with 1.
Any ideas?
How are you connecting for RS485? On my RAI-3K-5G I have to remove the WIFI to get the Modbus connection. Did you open the WIFI module and connect to that?
I think within the config for that sensor you might be able to add a max which might stop those?
Yes soldered new cable onto A/B/GND of that white connector inside, then the cable goes to the HA usb rs485 adapter
If I remove the wifi module then it will no longer log to cloud, Iâd like to keep both, I think someone here did that, maybe @craigcurtin I believe (Craig you wanna help us?)
And that graph is from SolisCloud app so this is the logger itself sending bogus data, not HA sensors
Yeah its a pain not having the wifi but I have developed YouGeneate.co.uk which I am getting data to from HA > emonCMS > YouGenerate portal. This means I have local as well as remote visibility. just need to be able to control it
I went and did it⌠yaaaaaaaaaaâŚ
Was able to create a test automation which allowed me to write an array as belowâŚ
service: modbus.write_register
data:
hub: solis
unit: '1'
address: '43143'
data_template:
value: [00, 00, 0, 0, 21, 26, 21, 30]
Which means that it will discharge between 21:26 to 21:30.
If you try and write each individual registry to set the charge and discharge times the inverter dose not work e.g. the inverter dose not respond to the times set. HOWEVER if you set the times using an array in the example above the inverter acts on the times!
Once you have the times set it is then possible to change the charge and discharge rate to control flow as single registry updates.
As @Markg says you have to also set the âStorage control switch valueâ value to 35 to force charge mode e.g.
service: modbus.write_register
data_template:
hub: solis
unit: '1'
address: '43110'
value: '{{ trigger.to_state.state | int }}'
Thanks @Markg for pointing me in the right direction⌠would buy you a beer sir, if your ever in NI cheers
Amazing! Glad you got it going!
I think this happens if the times overlap, if you set the times overlapping in the array or even on the inverter itself the same happens from what Iâve seen.
I was a little lazy doing this, itâs actually BIT01 that triggers the timed charge mode, so changes between 33 and 35, might be worth keeping an eye on in any future firmware versions as there are a bunch of reserved values in the table. (Appendix VII in this document)
My TTL-RS485 board arrived yesterday so going to start playing with an ESP8266 controlling the inverter this week, itâll be interesting to see what logic you come up with in HA that can be used for that too
How does everyone else display their solar data in HA? Hereâs my attempt at an energy dashboard. I added in the force charge/discharge switch last night as todayâs predicted generation wasnât great, used the scheduler card to control it until I work out the best way to use automations to decide when to charge.
does anybody know if its possible to stop discharge at 30%
and do discharge if power usage is over X watts?
back story, in belgium you will pay more on your bill if your peak usage (watts/15 minutes) is over 2400 watts
Just so you folks knowâŚthereâs a chap on ebay Germany selling a blank plug with instructions on how to make it suitable for rs485 modbus output.
I paid I think 13 euros for the plugâŚand he sends the instructions too.
Just so I am clearâŚwill this allow us to get real-time data into home assistant?
Thanks for posting this. I had to actually 3d-print a connector for mine, but itâs not nearly as solid as this one. Iâve also read a few mentions that this is actually a standard aircraft DIN connector (and Iâve been meaning to go by the local airport and talk to one of the avionics installers, there, to see if this is the case).
They appear very similar to the 4-pin GX connector, Iâve got some here.
I also have the standard solis connector. When I try to connect them, they donât quite fit, but you could possibly force it. Also the threaded sections are completely different sizes.
Also, Iâm doing it the wrong way round here, with a female Solis connector and a male GX, but for this youâre looking to connect a female GX to the male solis connector on the inverter. If I can find one Iâll give it a try.
Hello all,
Looks like some great work here - has helped me out with getting info from my inverter. I also came across another integration by Stephan Joubert (for Solarman inverters, which all seem to use the same data loggers) - which was pretty much plug and play with my Wifi data logging stick. Entered the IP and it managed to pull data out of the inverter! Integrates very nicely with the Home Assistant Energy feature too. Seems that some of the data logging sticks already expose Modbus directly to TCP.
Iâm now looking at what I can do to control the unit too. Having trouble setting the parameter number 43141 and 43412 for Timed Charge and Discharge rates. My inverter is already in timed mode, and has a valid timetable set, but when I send a 0x06 function code with a new value, I get a response which appears to have set it and the next read of that parameter appears to have set it, but the inverter doesnât change its charge rate - any thoughts?
Update: Scratch that - it worked! Seems we can now remotely control these Solis inverters without any additional hardware!
This looks fantastic if it works (have to try tomorrow on my Solis 5G hybrid). @Gadgit83 you mention the control side of things (crossed out): I canât see any code that suggests that GitHub custom component has anything other than sensors (e.g. readonly) - assuming it works for me at all - but are you using another technique to control your inverter?
I want my HA to control when it charges from grid etc