That is what we need. Good hex values
Standard modbus in esphome cannot read that.
Maybe only with tasmota.
Because ther is no modbus request. Only responses.
And you need to skip header.
Tasmota scripting is something like this:
1,01040aUUuuUUuu@i4:1,Active Power Import ,W,Power,0
1,01040axxxxxxxxUUuuUUuu@i4:1,Active Power Export ,W,Active Power Export,0
1,01040axxxxxxxxxxxxxxxxUUuu@i4:1000,Power Factor ,φ,Factor,3
But my devices have active request.
So script is something different
Is this even still modbus?
I think the easiest way is just use the uart bus component in esphome and do the parsing (which isn’t too complicated) in a lambda.
My problem is that I still can’t get any serial communication to show up in esphome.
Change TX with RX in esphome. Should blink RX led.
TX - TX
RX - RX
A - A
B - B
Anyway, I am still not reade all topic. Sorry if i am said something wrong
The RX led is blinking.
But to be sure I test everything with TX and RX normally and swapped.
No worries, i’m gratefull for all the help you’ve provided so far.
On that note another question that popped to my mind. I assumed the logic level of the inverters A and B pin would be 5V. Is this correct or could it also be 12V? If so i’ve probably fried my rs485 module (possibly even the RX and TX pins on my ESP32)…
Ttl rs485 should filter voltage in A/B.
“The RS485 driver manufacturers give a voltage range for VCM of -7 to 12 V”
In TX/RX is always 3.3-5v
You can try gpio 18/19 in esp32.
I only tested this gpios.
Gpio 1/3 will conflit with logger in esp32.
If RX blink you are receiving data.
But you cannot use modbus component.
Modbus component is “active requests”.
Maybe serial component
Hi,
have been trying out all kinds of things over the last few days. All kinds of configurations, pins, different ESP boards, different RS485 to TTL boards.
I’m not using the esphome modbus component, but instead just using the UART debugger.
But there is absolutely nothing. At this point I’m really thinking the COM-port of the inverter is broken, or it just isn’t sending any data. Is there a way to find out if there is any communication directly on the A/B lines? Unfortunately I don’t have an osciloscope.
Oh man! You are not going to believe this!
Turns out the inverter goes in some kind of deep sleep over night (when there is no PV generation).
Even the Comms are disabled during this time. I’ve been testing all the time in the late evenings. Tried it out yesterday during the day and it worked instantly. It probably was working the entire time!
I want to thank @nikito7 for the very helpfull suggestions, which without those I would probably have given up a while ago. I learned a lot of RS485/Modbus basics through your help. So thanks, man!
Now i’ll start working on parsing the data and get it passed to some sensors.
At the end I’ll do a summary writeup, so that people in futere won’t have to go through this entire (chaotic) thread, where I make a lot of silly mistakes .
Yeah, i’m currently working on it. Making good progress!
I will post here as soon as i’m finished!
Probably later this week.
I’ve done something similar with my Delta Solivia inverter, where I’m also just sniffing existing packages between my Solivia Gateway and the inverter.
I made an ESPHome modbus custom component for this.
You could take a peek at my solution if you wan’t some input
Regards
Henning
Hi Henning.
Thanks for your input!
That’s the exact same way I’ve gone about doing it. I found it by accident in another thread on this forum. And why reinvent the wheel
I’ve got it working so far, just have to map all the values to esphome sensors. The foxess inverter is giving out some not needed datastreams, which I will have to filter out as well. But that should be easy.
You’re welcome
Just no need for you to be banging your head and try to reinvent the wheel - again.
I did that, for quite a few days, until I managed to put together a working solution
Yep. I also search for a specific 6 bytes response in the uart buffer and delete first byte if there’s not a match and loop. When there’s a match, i wait until buffer is filled and parses the package.
I have currently solved this with Elfin-EW11 within Node-RED…
I understand that this is probably not the most rational way, but it works…
Function node, for example, for generate power: return { payload: msg.payload.readInt16BE(11)/1000 }; // 11 is the buffer byte number offset
TCP in node:
Switch node for filtering messages:
Entity node:
Could someone perhaps explain to me how I have to set up the EW11 or what I have to set there?
I’ve got everything setup and working via ESPHome.
I uploaded the code including a description how to setup on github.
@assembly , thanks for your work.
however, I’m trying to setup it and failing. Basically, the difference with your setup is that I power it from USB and don’t connect 12V/GND from inverter, so not using buck converter. The led on rs485 adapter is always on and not getting any data. I’ve tried to comment out custom component and leave debug only, nothing comes in. P.s. inverter is running Any hint would help.
Thanks!
Hi Giedrius,
have you tried swapping RX and TX? This can be done in the YAML, no need to change any wires around.
I think (but i’m not sure) it is necesary that your circuit and the inverter have a common ground. So even if you power your circuit by an external USB power supply, you should still connect the pin 5 from the inverter to the ground of your circuit. If you have a buck converter lying around i would just try powering it from the 12V from the inverter. In my oppinion that’s the neatest solution.
Are you using the same rs485 adapter as in my opening post? If so, it’s normal that the led is on all the time. This module doesn’t have any visual confirmation that data is being send.
@assembly Amazing! Works like charm on T series G3 with esp8266 and software serial on pins 4 and 5, dc-dc power from invertor’s 12V. So nice instructions to build hardware, did not even need to dig for install manual. Thank you very much! Finally can live without foxess cloud!