jacauc / sunsynkesphome Goto Github PK
View Code? Open in Web Editor NEWSunsynk Modbus ESPHome code
Home Page: https://powerforum.co.za/topic/8646-my-sunsynk-8kw-data-collection-setup/
Sunsynk Modbus ESPHome code
Home Page: https://powerforum.co.za/topic/8646-my-sunsynk-8kw-data-collection-setup/
I don't think this is a binary sesnor, but rather one that returns different values with different meanings.
This is my code for it.
- platform: modbus_controller # 244 Settings Energy Management Model
modbus_controller_id: sunsynk
name: "Energy management model"
id: sunsynk_energy_model
register_type: holding
address: 244
raw_encode: HEXBYTES
lambda: |-
uint16_t value = modbus_controller::word_from_hex_str(x, 0);
switch (value) {
case 0: return std::string("Selling First");
case 1: return std::string("Zero Export and Limit to Load Only");
case 2: return std::string("Zero Export");
default: return std::string("Unknown");
}
return x;
Hi
What do we need between the esp32 tx rx ports and the sunsynk rs485 port ?
Would that be a 3.3v rs232 to rs485 adapter ?
Possible to please elaborate and do you have a link of the hardware ?
Really appreciate it
Thanks for publishing this. I've been using your config to update mine.
The grid frequency sensor can have the device class set to "frequency". You may need to change the unit of measurement to "Hz" instead of "hz".
I'm facing a poor performance getting data from the registers. Can you please explain the settings below and how they influence the behavior of the modbus connection?
I have continously "CRC Check failed" and "Duplicate modbus command" messages
modbus_update_interval: "5s"
settings_skipped_updates: "10"
query_throttle: "50ms"
May help with defining the state
return hass.states["sensor.overall_state"].state == "0" ? "blue" :
"transparent"
selector: '#standby'
type: fill
Most of the energy total values sit over two registers. Your current config isn't reading these values correctly.
To read these correctly the value_type configuration parameter needs to be set to U_DWORD_R, i.e. by adding the line:
value_type: U_DWORD_R
Note that your lamda filter on this totals also needs to be corrected. It doesn't need to handle the negative values.
There is one parameter (Grid Import Total) where the values aren't on consecutive registers - 78 and 80. I don't know how to configure this & would need to read up in more detail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.