Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/advanced_readwrite_select.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Owner

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 ?


// 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);
Copy link
Owner

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 ?


// Declare Variable
uint16_t write_value = 0;
Expand Down
42 changes: 27 additions & 15 deletions modules/battery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get Tuopai Xie over Google Translate instaead of Topband. Unsure if anybody will use it but where did you get your Translation ?

"Pylontech 485 Protocol": 0x0005
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get Paineng 485 Assistant over Google Translate instead of Pylontech 485 Protocol. Can you explain a bit ? Thanks 😃

"Jelais 485 Protocol": 0x0006
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get Jerry's 485 Assistant over Google Translate instead of Jelais 485 Protocol. Can you explain a bit ? Thanks 😃

"Sunwoda 485 Protocol": 0x0007
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get Xinwangda 485 Xie over Google Translate instead of Xinruineng 485 Protocol. Can you explain a bit ? Thanks 😃

"Xinruineng 485 Protocol": 0x0008
"Tianbangda 485 Protocol": 0x0009
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get slightly different over Google Translate Tianbangda 485 Assistant instead of Tianbangda 485 Protocol.

"Shenggao Electric CAN Protocol": 0x000A


number:
- platform: modbus_controller
Expand Down Expand Up @@ -91,7 +100,7 @@ number:
id: "${entities_id_prefix}_Battery_capacity"
name: "${entities_name_prefix}-Battery capacity"
address: 102
unit_of_measurement: V
unit_of_measurement: Ah
value_type: U_WORD
multiply: 1.0
min_value: 0.00
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -185,7 +196,7 @@ sensor:
address: 586
unit_of_measurement: "°C"
accuracy_decimals: 1
value_type: U_WORD
value_type: S_WORD
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kinda makes Sense, however the Reference Guide indicates [0,3000] Range with 0.1°C Resolution. Did you have a Chance to Test it yourself ? I don't have/use an external Temperature Sensor and only have a couple of Sensors in each Battery & BMS (no monitoring of the Battery Temperature by the Deye Inverter).

filters:
- offset: -1000
- multiply: 0.1
Expand Down Expand Up @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand All @@ -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"
Expand Down
20 changes: 14 additions & 6 deletions modules/external.yaml
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}
Copy link
Owner

Choose a reason for hiding this comment

The 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"
Expand All @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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"
Expand All @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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"
Expand All @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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"
Expand All @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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"
Expand All @@ -58,4 +66,4 @@ sensor:
unit_of_measurement: "VA"
state_class: "measurement"
accuracy_decimals: 0
value_type: S_WORD
Copy link
Owner

Choose a reason for hiding this comment

The 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
81 changes: 77 additions & 4 deletions modules/general.yaml
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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need a high refresh Rate ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outdated, right?

Copy link
Owner

Choose a reason for hiding this comment

The 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 modbus_controller_id_hf Controller, then a few Commits later you removed it (and switched back to the modbus_controller_id), but originally I expected that you removed it only for a few Signals.

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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -46,6 +46,66 @@ binary_sensor:

sensor:
# New - To be Tested
Copy link
Owner

Choose a reason for hiding this comment

The 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
Copy link
Owner

Choose a reason for hiding this comment

The 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 Signed ? Did you test this ? The Reference Guide states [0,1200] Range.

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
Copy link
Owner

Choose a reason for hiding this comment

The 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 Signed ? Did you test this ? The Reference Guide states [0,1200] Range.

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
Copy link
Owner

Choose a reason for hiding this comment

The 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 Signed ? Did you test this ? The Reference Guide states [0,1200] Range.


- 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
Copy link
Owner

Choose a reason for hiding this comment

The 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 Signed ? For e.g. the Advanced Options (e.g. BMS_Err_Stop) Address 178 the Type is U_WORD (Unsigned).

- 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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be easier to have an optionsmap here ?


- 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
Copy link
Owner

Choose a reason for hiding this comment

The 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 Signed ? And what exactly does this Parameter do ? We have 3 CTs so they each go on one different Phase here in Denmark ...


- platform: modbus_controller
modbus_controller_id: ${modbus_controller_id}
name: "${entities_name_prefix}-General - DC Transformer Temperature"
Expand Down Expand Up @@ -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
Copy link
Owner

Choose a reason for hiding this comment

The 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 min_value set to 100 here ? Isn't that a bit too high ?

max_value: 10000.00
2 changes: 1 addition & 1 deletion modules/generator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ sensor:
value_type: S_WORD
Copy link
Owner

Choose a reason for hiding this comment

The 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}
Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand Down
16 changes: 12 additions & 4 deletions modules/grid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand All @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand All @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand All @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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
Expand All @@ -112,6 +118,8 @@ sensor:
accuracy_decimals: 0
value_type: S_WORD



- platform: modbus_controller
modbus_controller_id: ${modbus_controller_id}
skip_updates: 10
Expand Down
4 changes: 3 additions & 1 deletion modules/internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Copy link
Owner

Choose a reason for hiding this comment

The 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"
Expand All @@ -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
Expand Down
Loading