TeslaSolarCharger icon indicating copy to clipboard operation
TeslaSolarCharger copied to clipboard

Addon for RCT solar components

Open Executer1982 opened this issue 2 years ago • 27 comments

RCT power converters don't have a REST API either, but there are already projects to work with that vendor-specific protocol, e.g. https://github.com/svalouch/python-rctclient

Is it possible to integrate this as an addon similar to your SMA-Addon?

Executer1982 avatar May 01 '22 09:05 Executer1982

Possible - yes. But as I only have SMA I can not developer such extensions. I would recommend something like home asisstant, which should have a rest API (but I have no experience with it). And as I see in your link, the repository is used by a home assistant extension.

pkuehnel avatar May 01 '22 14:05 pkuehnel

@Executer1982 Does RCT power have a modbus interface?

pkuehnel avatar Jul 22 '22 00:07 pkuehnel

As far as I know, it communicates via Modbus with the current sensor.

the protocoll itself seems to be some ModbusRTU(?), but I'm not into that :/ (see https://www.photovoltaikforum.com/thread/145688-rct-power-wechselrichter-auslesen/)

Executer1982 avatar Jul 22 '22 06:07 Executer1982

ModbusRTU means not over a Ethernet connection, which is not possible with TeslaSolarCharger. If you could get any documentation or something like that about ModbusTCP it would be possible as the modbusPlugin released with v2.2.0 is generic and can be used for all inverters.

pkuehnel avatar Jul 24 '22 22:07 pkuehnel

Hey, i've the following documentation for RCT Inverters. Got it from the RCT Iobroker Adapter developer (https://github.com/aruttkamp/ioBroker.rct/blob/main/README.md). Nearly every value can be read and logged. Unfortunatly I have no idea how it works.

https://rctclient.readthedocs.io/en/latest/inverter_registry.html#

most Important values for car charging:

  • Power Values p_ac_load_sum -> houshold energy

  • p_ac_grid_sum_lp -> grid load (positive) -> grid feed (negative)

  • p_acc_lp -> battery charge (negative)/discharge (positive)

  • Battery Values:

  • soc -> actual SOC

  • soc_target -> SOC Target

But there is a problem while using Teslas UMC. It's only one phase charging (max 32A). RCT PowerSensor has only 3 phase detection and shows wrong values while charging with one phase. I think its because of missing detection at ground phase. Charging power is around double as high as shown inside Tesla app (32A*230V=7kW app compared to 14kW at RCT Power app) Tested it for exact 60min and it charges exactly 7kW at my house energymeter, same like in tesla app.

If you need someone for testing, feel free to contact.

I would love to test Tesla SolarCharger, because I dont plan any wallbox. Teslas UMC is 100% ok for me (-> charging 70% at work for the last 25k km)

soulfire89 avatar Apr 23 '23 18:04 soulfire89

Sorry I missed your comment.

Why do you need that RCT power meter. Just use your smart Home meter.

The values you need is:

  • grid Power (+ and -)
  • battery power (+ and -)
  • battery soc

that's it.

Can you maybe just use Iobroker or Homeassistant as Middleware, when you don't know how to connect TSC to your smart meter / home battery?

pkuehnel avatar Apr 25 '23 18:04 pkuehnel

Hey, no problem... I've no possibility to read my smart home meter and battery values come from RCT inverter software. But I'll try to set up a script at iobroker which sends the needed values to an XML Path like described in your documentation. I'm totally new to this topic, but it should work somehow.

soulfire89 avatar Apr 25 '23 18:04 soulfire89

Are you German? If yes search for Homeassistant in this thread: https://tff-forum.de/t/teslasolarcharger-laden-nach-pv-ueberschuss-mit-beliebiger-wallbox/170369?u=mane123

I have no idea if anyone is using iobroker.

solaranzeige.de would also work with TeslaSolarCharger (but no idea of it works with RTC solar).

pkuehnel avatar Apr 25 '23 19:04 pkuehnel

yes, I'm german. I've found something to read iobroker values with http request via RESTful API (e.g. http://ipaddress:8087/getPlainValue/soc -> 80.7)

i just have to find out how two send it as list like you described for http://192.168.xxx.xxx/measurements.xml

Or is there a solution to define a single http-address for every needed value (grid power, battery power, soc) by its own?

soulfire89 avatar Apr 25 '23 19:04 soulfire89

Yes you can define URLs for every value by its own. You just could also use JSON or XML but that is optional.

pkuehnel avatar Apr 25 '23 19:04 pkuehnel

docker compose content is then without any plugin, just the stock one or? I'll try my best tomorrow. Thanks for your help until now.

soulfire89 avatar Apr 25 '23 19:04 soulfire89

yep, without any Plugin...

pkuehnel avatar Apr 25 '23 19:04 pkuehnel

couldn't wait until tomorrow :) everything worked fine so far. input values were ok, now waiting for the sun and the first test tomorrow!

thanks a lot for your help!

soulfire89 avatar Apr 25 '23 20:04 soulfire89

@soulfire89 Is everything working? If yes, could you share a link to the add-on you are using? Thanks.

pkuehnel avatar May 01 '23 15:05 pkuehnel

Yes it's working great. My Setup is a Synology 920+ with docker package installed.

  1. Running ioBroker inside docker
  2. Adapter RCT to collect Inverter Data https://github.com/aruttkamp/ioBroker.rct/
  3. RESTful API adapter to send datapoints via REST as an output of iobroker https://github.com/ioBroker/ioBroker.simple-api/
  4. Use these links in your TSC BaseConfiguration as inputs (e.g. http://ip-adresse:port/getPlainValue/rct.0.g_sync.p_ac_grid_sum_lp

I've another feature request for RCT or perhaps for other manucaturers, too. I don't know if other manufacturer have the same Home Battery strategy, but RCT uses inteligent battery charging in combination with forecast. Battery SOC will be limited to 35 or 75 until fully charged (97%) depending on the DC Inputpower and the forecast. Do you think it will be possible to set these thresholds inside TSC as a variable Home Battery minimum SOC with REST link?

soulfire89 avatar May 01 '23 17:05 soulfire89

I would be very interested in an RCT addon for teslasolarcharger too. We got a rct solar installation with a RCT Power Storage DC10 last year, I added it to homeassistant via the hacs integration, which did work fine.

Is there anything I can help you with for developing this addon @pkuehnel ?

peterge1998 avatar Apr 11 '24 09:04 peterge1998

Hello @peterge1998, as mentioned above, there should be the same solution like on iobroker with a RestApi integration. I'm using this solution since May 23 and it works great.

soulfire89 avatar Apr 11 '24 10:04 soulfire89

@peterge1998 How do you get the values from RCT? For everything like Modbus, REST, MQTT, there shouldn't be any issues. The plugins are only needed for inverters, batteries,... with very special APIs. E.g. Solax, see method in line 54 https://github.com/pkuehnel/TeslaSolarCharger/blob/master/Plugins.Solax/Services/SolaxApiService.cs

pkuehnel avatar Apr 11 '24 11:04 pkuehnel

@soulfire89 Thats acutually a good idea, getting them from hassio could work. I need to research which entities I need to use, but it should be doable since the integration provides quite a few battery & grid values: image About 80 entities in total.

@pkuehnel The integration uses the inverter's API:

peterge@thinkpadt14s:~$ curl --http0.9 http://10.0.1.54:8899/ --output -
PGO��I�z˰!����U��4b�Dy�����IHk�l/�1{xD�贖�O��C�B5*�!�����S�*��A�34S�j��E�:�7��bf!Pn:���
                                                                                       H�ZH��aHF^	����&�F<,I��UזI�
...

Thank you guys, I will look into it when I order the M3, but I guess might need a little more help with it then 😬

peterge1998 avatar Apr 11 '24 13:04 peterge1998

Looks like a normal REST API call, what is the result? And why are so many not displayable chars in your message?

If you have no different you can use my referral ;-) https://ts.la/patrick63887

pkuehnel avatar Apr 11 '24 17:04 pkuehnel

Idk, its binary. rctclients documentation says its their proprietary "RCT Power Serial Communication Protocol". The same shows up when opening http://10.0.1.54:8899/ in browser: image

But I am able to use rctclient for the inverters registry:

peterge@thinkpadt14s:~$ rctclient read-value --host 10.0.1.54 --name battery.soc
0.2678643465042114

I want to order a M3 2022 RWD from tesla used cars (EAP 🤗), not brand new, so I cant use your referral...

peterge1998 avatar Apr 11 '24 19:04 peterge1998

Ah, ok, I see — looks like it's not that easy to decode. The easiest way for you is if you have any Converter that can export the data via MQTT or REST. But best would be if you can decode the values in C# (or tell me exactly how to decode them and provide me access to your inverter, so I can implement it).

pkuehnel avatar Apr 12 '24 08:04 pkuehnel

Another idea - yesterday when I was setting up rctclient, I saw that the tool comes with a simulator. I did not try it yet, but this paragraph in the docs just sounds like it could help out with the access problem:

To aid in developing tools or this module itself, a simulator offers an easy way to safely test code without interfacing with real hardware and potentially causing problems. The simulator can be run by using the subcommand simulator of the CLI.

peterge1998 avatar Apr 12 '24 11:04 peterge1998

I am unable to set up the inverter power, because the S0 is missing in the home assistant integration. How are u solving this @soulfire89 ? Or do you have no power input on S0 in you installation?

This is what I did set up:

TSC variable RCT Power App Home Assistant entity
image Plus InverterPower image sensor.rct_power_storage_generator_a_power
image Plus InverterPower image sensor.rct_power_storage_generator_b_power
image Plus InverterPower image missing in home assistant :(

I was able to find HomeBatterySoc, HomeBatteryPower and GridPower. I am just unable to set up my InverterPower. Any ideas?

image

peterge1998 avatar Aug 30 '24 10:08 peterge1998

Hey, I'm not using home assistant. Taking the RCT Inverter Values with iobroker and sending them via RestAPI to TSC.

Here is the RCT documentation: https://rctclient.readthedocs.io/en/latest/inverter_registry.html#battery

soulfire89 avatar Aug 30 '24 10:08 soulfire89

The value that I need would be this one: image

I guess I need to figure out how I can get this into home assistant first...

peterge1998 avatar Aug 30 '24 10:08 peterge1998

Just write a request to the home assistant adapter developer ;)

soulfire89 avatar Aug 30 '24 10:08 soulfire89