Skip to content
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

Incorrect mode of sensor Charger Source Priority #53

Open
VitalyIak opened this issue Jul 30, 2024 · 1 comment
Open

Incorrect mode of sensor Charger Source Priority #53

VitalyIak opened this issue Jul 30, 2024 · 1 comment

Comments

@VitalyIak
Copy link

VitalyIak commented Jul 30, 2024

I have original PorMr POW-HVM6.2M-48V-N
And ESPhome shows Incorrect mode of sensor Charger Source Priority:
Current incorrect mapping:
CSO - utility first (should be solar first)
OSO - solar and utility(should be solar only)
SNU - solar first (should be solar and utility)

Correct mapping (but should be):
CSO - solar first
OSO - solar only
SNU - solar and utility

please fix!
as I understand it's need to fix inverter.yaml

  • platform: modbus_controller
    modbus_controller_id: smg_inverter
    id: charger_source_priority_text
    name: "Charger Source Priority"
    entity_category: diagnostic
    address: 4536
    register_type: holding
    response_size: 2
    raw_encode: HEXBYTES
    lambda: |-
    uint16_t sensorIndex = swapBytes(modbus_controller::word_from_hex_str(x, 0));
    updateUnknownSelect(sensorIndex, id(charger_source_priority_select));
    switch (sensorIndex) {
    case 0: return std::string("Utility first");
    case 1: return std::string("Solar first");
    case 2: return std::string("Solar and Utility");
    case 3: return std::string("Only solar");
    default: return std::string(x);
    }

to

  switch (sensorIndex) {
    case 0: return std::string("Solar first");
    case 1: return std::string("Solar and Utility");
    case 2: return std::string("Only solar");
    default: return std::string(x);
  }

And

  • platform: modbus_controller
    id: charger_source_priority_select
    name: "Charger Source Priority"
    optimistic: true
    skip_updates: ${select_skip_updates}
    force_new_range: true
    entity_category: config
    address: 5017
    value_type: U_WORD
    optionsmap:
    "Utility first": 0
    "Solar first": 1
    "Solar and Utility": 2
    "Only Solar": 3

should be

    optionsmap:
      "Solar first": 0
      "Solar and Utility": 1
      "Only Solar": 2``
@davidebeatrici
Copy link
Contributor

Related: #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants