-
Notifications
You must be signed in to change notification settings - Fork 3
Decoding of Battery Type and Error Code; small fixes; CT Info and Settings #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
d281dd5
9ef7bf7
9332284
4b0b520
8d9232d
b62c00f
d51f8a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -416,13 +416,13 @@ select: | |
uint16_t select_value = uint16_t(value); | ||
|
||
// Debug | ||
esphome::ESP_LOGI("main","Modbus: Write - Advanced_BMS_Err_Stop set to %d" , select_value); | ||
ESP_LOGI("main","Modbus: Write - Advanced_BMS_Err_Stop set to %d" , select_value); | ||
|
||
// Current Value of the Register (all bits) | ||
uint16_t current_value = id(${entities_id_prefix}_Advanced_Register_178).state; | ||
|
||
// Debug | ||
esphome::ESP_LOGI("main","Modbus: Write - Previous Register 178 Value (unmodified) = %d", current_value); | ||
ESP_LOGI("main","Modbus: Write - Previous Register 178 Value (unmodified) = %d", current_value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this Change (just dropping the |
||
|
||
// Declare Variable | ||
uint16_t write_value = 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,18 +10,27 @@ select: | |
"Lead Acid": 0 | ||
"Lithium (BMS)": 1 | ||
|
||
# To be completed | ||
#- platform: modbus_controller | ||
# use_write_multiple: true | ||
# modbus_controller_id: ${modbus_controller_id} | ||
# id: "${entities_id_prefix}_Battery_Lithium_Type" | ||
# name: "${entities_name_prefix}-Battery Lithium Type" | ||
# address: 223 | ||
# bitmask: 0x1 | ||
# value_type: U_WORD | ||
# optionsmap: | ||
# "Pylon (CAN)": 0 | ||
# "": 1 | ||
|
||
- platform: modbus_controller | ||
use_write_multiple: true | ||
modbus_controller_id: ${modbus_controller_id} | ||
id: "${entities_id_prefix}_Battery_Lithium_Type" | ||
name: "${entities_name_prefix}-Battery Lithium Type" | ||
address: 223 | ||
value_type: U_WORD | ||
optionsmap: | ||
"Pylon / Solax / Universal CAN Protocol (CAN)": 0x0000 | ||
"Tianbangda RS485 Modbus": 0x0001 | ||
"KOK Protocol": 0x0002 | ||
"Keith Protocol": 0x0003 | ||
"Topband Protocol": 0x0004 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get |
||
"Pylontech 485 Protocol": 0x0005 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get |
||
"Jelais 485 Protocol": 0x0006 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get |
||
"Sunwoda 485 Protocol": 0x0007 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get |
||
"Xinruineng 485 Protocol": 0x0008 | ||
"Tianbangda 485 Protocol": 0x0009 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I get slightly different over Google Translate |
||
"Shenggao Electric CAN Protocol": 0x000A | ||
|
||
|
||
number: | ||
- platform: modbus_controller | ||
|
@@ -91,7 +100,7 @@ number: | |
id: "${entities_id_prefix}_Battery_capacity" | ||
name: "${entities_name_prefix}-Battery capacity" | ||
address: 102 | ||
KastB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
unit_of_measurement: V | ||
unit_of_measurement: Ah | ||
value_type: U_WORD | ||
multiply: 1.0 | ||
min_value: 0.00 | ||
|
@@ -133,6 +142,7 @@ sensor: | |
value_type: S_WORD | ||
filters: | ||
- multiply: 0.1 | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
skip_updates: 10 | ||
|
@@ -147,6 +157,7 @@ sensor: | |
value_type: S_WORD | ||
filters: | ||
- multiply: 0.1 | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
skip_updates: 5 | ||
|
@@ -185,7 +196,7 @@ sensor: | |
address: 586 | ||
unit_of_measurement: "°C" | ||
accuracy_decimals: 1 | ||
value_type: U_WORD | ||
value_type: S_WORD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This kinda makes Sense, however the Reference Guide indicates |
||
filters: | ||
- offset: -1000 | ||
- multiply: 0.1 | ||
|
@@ -216,7 +227,7 @@ sensor: | |
value_type: U_WORD | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
name: "${entities_name_prefix}-Battery Output Power" | ||
id: "${entities_id_prefix}_Battery_Output_power" | ||
register_type: holding | ||
|
@@ -226,6 +237,7 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-Battery Output Current" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
sensor: | ||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
skip_updates: 2 | ||
name: "${entities_name_prefix}-External CT Active Power L1" | ||
id: "${entities_id_prefix}_External_CT_Active_Power_L1" | ||
|
@@ -11,8 +11,10 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
skip_updates: 2 | ||
name: "${entities_name_prefix}-External CT Active Power L2" | ||
id: "${entities_id_prefix}_External_CT_Active_Power_L2" | ||
|
@@ -23,8 +25,10 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
skip_updates: 2 | ||
name: "${entities_name_prefix}-External CT Active Power L3" | ||
id: "${entities_id_prefix}_External_CT_Active_Power_L3" | ||
|
@@ -35,8 +39,10 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
skip_updates: 2 | ||
name: "${entities_name_prefix}-External CT Active Power Total" | ||
id: "${entities_id_prefix}_External_CT_Active_Power_Total" | ||
|
@@ -47,9 +53,11 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
# External Power Grid - Total Apparent Power | ||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
skip_updates: 2 | ||
name: "${entities_name_prefix}-External CT Apparent Power Total" | ||
id: "${entities_id_prefix}_External_CT_Apparent_Power_Total" | ||
|
@@ -58,4 +66,4 @@ sensor: | |
unit_of_measurement: "VA" | ||
state_class: "measurement" | ||
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the Change ? Did you remove an empty NewLine ? |
||
value_type: S_WORD |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
binary_sensor: | ||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
skip_updates: 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this need a high refresh Rate ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is outdated, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @KastB: I think this was one of your earlier Commits. Most of the Stuff I feel like you implemented the But I think you once again removed it for all of them. I kinda got lost there already. Basically you tried to change to a high Refresh Rate / dual rate Controller, then I guess you saw it didn't work and preferred to change the Modbus Baud Rate to 115200 instead in Advanced Menu ? |
||
name: "${entities_name_prefix}-AC INV Relay" # bit 0 | ||
id: "${entities_id_prefix}_AC_INV_Relay" | ||
|
@@ -18,7 +18,7 @@ binary_sensor: | |
bitmask: 0x2 | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
skip_updates: 2 | ||
name: "${entities_name_prefix}-General - AC Grid Relay" # bit 2 | ||
id: "${entities_id_prefix}_General_AC_Grid_Relay" | ||
|
@@ -27,7 +27,7 @@ binary_sensor: | |
bitmask: 0x4 | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
skip_updates: 2 | ||
name: "${entities_name_prefix}-General - AC Generator Relay" # bit 3 | ||
id: "${entities_id_prefix}_General_AC_Generator_Relay" | ||
|
@@ -36,7 +36,7 @@ binary_sensor: | |
bitmask: 0x8 | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
skip_updates: 2 | ||
name: "${entities_name_prefix}-General - Turn off/on status" | ||
id: "${entities_id_prefix}_General_Turn_off_on_status" | ||
|
@@ -46,6 +46,66 @@ binary_sensor: | |
|
||
sensor: | ||
# New - To be Tested | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove all of these Sensors after you Added them a few Commit earlier ? |
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-General - Active Power Regulation" | ||
id: "${entities_id_prefix}_General_Active_Power_Regulation" | ||
register_type: holding | ||
address: 77 | ||
unit_of_measurement: "%" | ||
value_type: S_WORD | ||
|
||
accuracy_decimals: 1 | ||
filters: | ||
- multiply: 0.1 # Converts value to percentage | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-General - Reactive Power Regulation" | ||
id: "${entities_id_prefix}_General_Reactive_Power_Regulation" | ||
register_type: holding | ||
address: 78 | ||
unit_of_measurement: "%" | ||
value_type: S_WORD | ||
|
||
accuracy_decimals: 1 | ||
filters: | ||
- multiply: 0.1 # Converts value to percentage | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-General - Apparent Power Regulation" | ||
id: "${entities_id_prefix}_General_Apparent_Power_Regulation" | ||
register_type: holding | ||
address: 79 | ||
unit_of_measurement: "" | ||
value_type: S_WORD | ||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-General - Island Protection Enable" | ||
id: "${entities_id_prefix}_General_Island_Protection_Enable" | ||
register_type: holding | ||
address: 83 | ||
unit_of_measurement: "" | ||
value_type: S_WORD | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-General - Grid Check Source" | ||
id: "${entities_id_prefix}_General_Grid_Check_Source" | ||
register_type: holding | ||
address: 344 | ||
unit_of_measurement: "" | ||
value_type: U_WORD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't be easier to have an |
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-General - External Current Clamp Phase" | ||
id: "${entities_id_prefix}_General_External_Current_Clamp_Phase" | ||
register_type: holding | ||
address: 144 | ||
unit_of_measurement: "" | ||
value_type: S_WORD | ||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
name: "${entities_name_prefix}-General - DC Transformer Temperature" | ||
|
@@ -138,3 +198,16 @@ select: | |
"Selling first": 0 | ||
"Zero export to load": 1 | ||
"Zero export to CT": 2 | ||
|
||
|
||
number: | ||
- platform: modbus_controller | ||
use_write_multiple: true | ||
modbus_controller_id: ${modbus_controller_id} | ||
id: "${entities_id_prefix}_General_CT_Ratio" | ||
name: "${entities_name_prefix}-General - CT Ratio" | ||
address: 347 | ||
value_type: U_WORD | ||
multiply: 1.0 | ||
min_value: 100.00 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am Off-Grid so I don't know if this is Correct. Are you sure it's Correct ? According to the Reference Guide, they Provide an Example (?) Value of 30 for 30:1. Why is the |
||
max_value: 10000.00 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ sensor: | |
value_type: S_WORD | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did I get the Data Type wrong ? The Reference Guide didn't specify neither U16 nor S16 and I never tested the Generator, so it could very well be. Did you check your Results ? |
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
name: "${entities_name_prefix}-Generator Power Total" | ||
id: "${entities_id_prefix}_Generator_Power_Total" | ||
register_type: holding | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ sensor: | |
value_type: U_WORD | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
name: "${entities_name_prefix}-Grid Power L1" | ||
id: "${entities_id_prefix}_Grid_Power_L1" | ||
register_type: holding | ||
|
@@ -79,8 +79,10 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
name: "${entities_name_prefix}-Grid Power L2" | ||
id: "${entities_id_prefix}_Grid_Power_L2" | ||
register_type: holding | ||
|
@@ -90,8 +92,10 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
name: "${entities_name_prefix}-Grid Power L3" | ||
id: "${entities_id_prefix}_Grid_Power_L3" | ||
register_type: holding | ||
|
@@ -101,8 +105,10 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
name: "${entities_name_prefix}-Grid Power Total" | ||
id: "${entities_id_prefix}_Grid_Power_Total" | ||
register_type: holding | ||
|
@@ -112,6 +118,8 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id} | ||
skip_updates: 10 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ sensor: | |
value_type: S_WORD | ||
|
||
- platform: modbus_controller | ||
modbus_controller_id: ${modbus_controller_id_hf} | ||
modbus_controller_id: ${modbus_controller_id} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the High Refresh Rate Controller for this Signal ? |
||
skip_updates: 2 | ||
name: "${entities_name_prefix}-Internal CT Power Total " | ||
id: "${entities_id_prefix}_Internal_CT_Power_Total" | ||
|
@@ -80,6 +80,8 @@ sensor: | |
accuracy_decimals: 0 | ||
value_type: S_WORD | ||
|
||
|
||
|
||
# Total Consumption | ||
# Disabled since an entity with this Register is already defined in load.yaml | ||
#- platform: modbus_controller | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this Change (just dropping the
esphome
Namespace ?) ? Were there some breaking Changes in some ESPHome Updates recently ?