Mark the above code was that from an automation? how are you running that code, is it from HA?
update: sorry just realized that you where using python to run that. I am not 100% on how you run that. I did see that you can run python scripts as services is that what you did? If not is it possible to run yours as a service as per following link? Python Scripts - Home Assistant (home-assistant.io)
@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.
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?
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 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
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
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.
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.
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!