Yes it is serial protocol.
So it should be possible, it would be very nice to use ESPHome and ESP32 for this, but i have no idea where to start.
If someone has any idea, i would appreciate very much.
Yes it is serial protocol.
So it should be possible, it would be very nice to use ESPHome and ESP32 for this, but i have no idea where to start.
If someone has any idea, i would appreciate very much.
Try dropping a pull request on the esphome GitHub. That code is not old, probably being worked out by Otto. If a few of us pr it, maybe it’ll happen sooner rather than later.
I have a similar request and dug around a bit. I’ve found mentions of modbus on the changelogs of ESPHome (https://github.com/esphome/esphome/pull/789 and https://github.com/esphome/esphome/pull/806) and theres a modbus folder in the components folder, as @JISARG already found out (https://github.com/esphome/esphome/tree/dev/esphome/components/modbus).
Maybe the SPI Component is the correct one? https://esphome.io/components/spi.html
Is someone able to clarify?
The pzem sensors, which are supported in esphome, use modbus. Maybe look at that code for inspiration?
I think I’m looking for pretty much the same thing but I’d like to communicate from Hass.io through ESP Home to my Car charger (rs485) to control the power draw.
Modbus code is in esphome - as you point out. However it is not a component. It is a base for other components, pzem is an example.
Nothing to do with SPI afact.
You’ll need a rs-485-ttl adapter. And details of the communication the car charger uses. Do you have some documentation?
Someone has done a great job reverse engineerin that in the TWS Manager project https://github.com/cdragon/TWCManager it should cointain all information necessary. However I’m not capable of utilizing that information to get going.
That does not use modbus. See https://github.com/cdragon/TWCManager/issues/5
However the protocol does seem to be well documented in the heavily commented python code. Beyond that, pkease start another thread as it is off topic here
But is possibile from esphome read direcly rs485 modbus example from Sdm230 modbus reader?
Modbus code is in esphome - as you point out. However it is not a component. It is a base for other components, pzem is an example.
Nothing to do with SPI afaict.
sorry @nickrout but I did not understand what you mean, explain in practice how can I configure esphome and which 2 gpio should I use to connect it to my rs458 modbus sdm230 counter
I have said it numerous times in this thread. Look at the esphome pzem code, it uses the modbus library.
I’ll make it simpler:
Use the search box to search for modbus.
"
@jiisaa and @wifi75
Did you make any progress in this?
I would love to read my energy meter with an esp32, maybe even all of my 4 energy meter with one esp32.
There are now more uart components in HA, eg Custom UART Device — ESPHome and example here Custom UART Text Sensor — ESPHome
You can read easily up to 32 devices using Arduino MKR WiFi 1010 with MKR 485 shield. Use Arduino libraries for the Shield and PubSub library for MQTT.
Read holding registers and publish value to the corresponding topic.
Then just make MQTT Sensor in HA and subscribe.
I’m using it to read from pH and EC sensors through modbus. Works perfect.
Full modbus
Examples
Do you have more i fo about these snesors? Type name price?
Esphome support generic modbus now