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

Implement newer RTU protocol of Growatt inverters #3315

Merged
merged 5 commits into from Apr 10, 2022
Merged

Implement newer RTU protocol of Growatt inverters #3315

merged 5 commits into from Apr 10, 2022

Conversation

djwlindenaar
Copy link
Contributor

What does this implement/fix?

Newer Growatt inverters use a different set of registers. This commit adds the possibility to select RTU2 protocol as used by those newer inverters. At least the MIC series, MIN series and MAX series.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes esphome/issues#2997

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#1976

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266

Example entry for config.yaml:

# Example config.yaml
sensor:
  - platform: growatt_solar
    update_interval: 10s
    protocol_version: RTU2
    inverter_status:
      name: "Growatt Status Code"
    phase_a:
      voltage:
          name: "Growatt Voltage Phase"
      current:
          name: "Growatt Current Phase"
      active_power:
          name: "Growatt Power Phase"
    pv1:
      voltage:
          name: "Growatt PV1 Voltage"
      current:
          name: "Growatt PV1 Current"
      active_power:
          name: "Growatt PV1 Active Power"
    active_power:
      name: "Growatt Grid Active Power"
    pv_active_power:
      name: "Growatt PV Active Power"
    frequency:
      name: "Growatt Frequency"
    energy_production_day:
      name: "Growatt Today's Generation"
    total_energy_production:
      name: "Growatt Total Energy Production"
      accuracy_decimals: 1
    inverter_module_temp:
      name: "Growatt Inverter Module Temp"

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

Newer growatt inverters use a different set of registers. This commit adds the possibility to select RTU2 protocol as used by those newer inverters. At least the MIC series, MIN se
ries and MAX series.

Default behavior is unchanged, so no breaking change.

Select new protocol by adding to the growatt_solar section:
  protocol_version: RTU2
@project-bot project-bot bot added this to Needs Review in ESPHome Dev Mar 20, 2022
@probot-esphome
Copy link

Hey there @leeuwte, mind taking a look at this pull request as it has been labeled with an integration (growatt_solar) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

Copy link
Member

@jesserockz jesserockz left a comment

Choose a reason for hiding this comment

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

Looks good, just one minor change

esphome/components/growatt_solar/sensor.py Outdated Show resolved Hide resolved
ESPHome Dev automation moved this from Needs Review to In Review Mar 24, 2022
Since there is a default for CONF_PROTOCOL_VERSION, no need to check for existence in the config.

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
@djwlindenaar
Copy link
Contributor Author

Looks good, just one minor change

Good point... Committed.

ESPHome Dev automation moved this from In Review to Reviewer Approved Apr 10, 2022
@jesserockz jesserockz merged commit 5e79a1f into esphome:dev Apr 10, 2022
ESPHome Dev automation moved this from Reviewer Approved to Done Apr 10, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2022
ESPHome Dev automation moved this from Done to In Review Sep 23, 2023
ESPHome Dev automation moved this from In Review to Reviewer Approved Sep 23, 2023
ESPHome Dev automation moved this from Reviewer Approved to Done Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging this pull request may close these issues.

Growatt modbus sensor - incorrect data reading
2 participants