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

With the latest HA update the mqtt configuration via "- platform: mqtt" is depreaceated. #1

Open
wants to merge 132 commits into
base: main
Choose a base branch
from

Conversation

perico85
Copy link

**Source:
johanmeijer/grott#259

Set configuration.yaml with this values to read from mqtt messages.**

mqtt:
sensor:

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['epvtotal'] | int / 10 }}"
    unique_id: growatt_generated_energy_total
    device_class: energy
    unit_of_measurement: "kWh"
    state_class: "total_increasing"
    name: Growatt - Generated energy (Total)
    icon: mdi:solar-power

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvtemperature'] | int / 10 }}"
    unique_id: growatt_inverer_temperature
    device_class: temperature
    unit_of_measurement: "°C"
    name: Growatt - Inverter temperature
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvipmtemperature'] | int / 10 }}"
    unique_id: growatt_ipm_temperature
    device_class: temperature
    unit_of_measurement: "°C"
    name: Growatt - IPM temperature
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['device'] }}"
    unique_id: growatt_serial
    name: Growatt - Serial number
    icon: mdi:select-inverse

  • state_topic: energy/growatt

    If you like to have the date in another format, please change "timestamp_custom('%d-%m-%Y')"

    For more information: https://docs.python.org/3/library/time.html#time.strftime

    value_template: "{{ as_timestamp(strptime(value_json['time'], '%Y-%m-%dT%H:%M:%S')) | timestamp_custom('%d-%m-%Y') }}"
    unique_id: growatt_date
    name: Growatt - Date
    icon: mdi:calendar

  • state_topic: energy/growatt

    If you like to have the date in another format, please change "timestamp_custom('%H:%M:%S')"

    For more information: https://docs.python.org/3/library/time.html#time.strftime

    value_template: "{{ as_timestamp(strptime(value_json['time'], '%Y-%m-%dT%H:%M:%S')) | timestamp_custom('%H:%M:%S') }}"
    unique_id: growatt_time
    name: Growatt - Time
    icon: mdi:clock-digital

  • state_topic: energy/growatt
    value_template: >
    {% if (value_json['values']['pvstatus'] | int == 0) %}
    Waiting
    {% elif (value_json['values']['pvstatus'] | int == 1) %}
    Normal
    {% elif (value_json['values']['pvstatus'] | int == 2) %}
    Fault
    {% elif (value_json['values']['pvstatus'] | int == 5) %}
    Generating PV Power
    {% elif (value_json['values']['pvstatus'] | int == 6) %}
    Battery Mode
    {% else %}
    Unknown
    {% endif %}
    unique_id: growatt_status
    name: Growatt - State
    icon: mdi:power-settings
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pv1watt'] | int / 10 }}"
    unique_id: growatt_string1_watt
    device_class: power
    unit_of_measurement: "W"
    name: Growatt - String 1 (Watt)
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pv1voltage'] | int / 10 }}"
    unique_id: growatt_string1_voltage
    device_class: voltage
    unit_of_measurement: "V"
    name: Growatt - String 1 (Voltage)
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pv1current'] | int / 10 }}"
    unique_id: growatt_string1_current
    device_class: current
    unit_of_measurement: "A"
    name: Growatt - String 1 (Current)
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pv2watt'] | int / 10 }}"
    unique_id: growatt_string2_watt
    device_class: power
    unit_of_measurement: "W"
    name: Growatt - String 2 (Watt)
    icon: mdi:solar-power
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pv2voltage'] | int / 10 }}"
    unique_id: growatt_string2_voltage
    device_class: voltage
    unit_of_measurement: "V"
    name: Growatt - String 2 (Voltage)
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pv2current'] | int / 10 }}"
    unique_id: growatt_string2_current
    device_class: current
    unit_of_measurement: "A"
    name: Growatt - String 2 (Current)
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvpowerin'] | int / 10000 }}"
    unique_id: growatt_actual_input_power
    device_class: power
    unit_of_measurement: "kW"
    name: Growatt - Input watt (Actual)
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvpowerout'] | int / 10 }}"
    unique_id: growatt_actual_output_power
    device_class: power
    unit_of_measurement: "W"
    name: Growatt - Output watt (Actual)
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvfrequentie'] | int / 100 }}"
    unique_id: growatt_grid_frequency
    unit_of_measurement: "Hz"
    name: Growatt - Grid frequency
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvgridvoltage'] | int / 10 }}"
    unique_id: growatt_phase_voltage
    device_class: voltage
    unit_of_measurement: "V"
    name: Growatt - Phase voltage
    state_class: "measurement"

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvenergytoday'] | int / 10 }}"
    unique_id: growatt_generated_energy_today
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Generated energy (Today)
    state_class: "measurement"
    icon: mdi:solar-power

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pvenergytotal'] | int / 10 }}"
    unique_id: growatt_generated_energy_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Generated energy (Total)
    state_class: "total_increasing"
    icon: mdi:solar-power

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pactouserr'] | int / 10 }}"
    unique_id: growatt_energy_from_grid_actual
    device_class: energy
    unit_of_measurement: "W"
    name: Growatt - Energy from Grid (Actual)
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pactogridr'] | int / 10 }}"
    unique_id: growatt_energy_to_grid_actual
    device_class: energy
    unit_of_measurement: "W"
    name: Growatt - Energy to Grid (Actual)
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['p1charge1'] | int / 10000 }}"
    unique_id: growatt_energy_to_batteryl
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Energy to Battery (Actual)
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['pdischarge1'] | int / 10000 }}"
    unique_id: growatt_energy_from_batteryl
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Energy from Battery (Actual)
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['plocaloadtot'] | int / 10 }}"
    unique_id: growatt_energy_total_load_actual
    device_class: energy
    unit_of_measurement: "W"
    name: Growatt - Total Enegry Usage (Actual)
    state_class: "total_increasing"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['epv1today'] | int / 10 }}"
    unique_id: growatt_string1_today
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Today Enegry String1
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['epv1total'] | int / 10 }}"
    unique_id: growatt_string1_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Total Enegry String1
    state_class: "total_increasing"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['epv2today'] | int / 10 }}"
    unique_id: growatt_string2_today
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Today Enegry String2
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['epv2total'] | int / 10 }}"
    unique_id: growatt_string2_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Total Enegry String2
    state_class: "total_increasing"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['etouser_tod'] | int / 10 }}"
    unique_id: growatt_energy_grid_today
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Energy from Grid Today
    state_class: "measurement"
    icon: mmdi:transmission-tower-export

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['etouser_tot'] | int / 10 }}"
    unique_id: growatt_energy_grid_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Energy from Grid Total
    state_class: "total_increasing"
    icon: mmdi:transmission-tower-export

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['elocalload_tod'] | int / 10 }}"
    unique_id: growatt_total_energy_lead_today
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Total Enegry Load Today
    state_class: "measurement"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['SOC'] | int }}"
    unique_id: growatt_battery_stetement_of_charge
    device_class: energy
    unit_of_measurement: "%"
    name: Growatt - Battery Charge %
    state_class: "measurement"
    icon: mdi:battery-charging-100

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['elocalload_tot'] | int / 10 }}"
    unique_id: growatt_lifetimeload_consumtion
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Lifetime Load Consumption
    state_class: "total_increasing"
    icon: mdi:waveform

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['vbat'] | int / 10 }}"
    unique_id: growatt_battery_voltage
    device_class: energy
    unit_of_measurement: "V"
    name: Growatt - Battery Voltage
    state_class: "measurement"
    icon: mdi:battery-charging-100

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['edischarge1_tod'] | int / 10 }}"
    unique_id: growatt_discharged_today
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Battery Discharged Today
    state_class: "measurement"
    icon: mdi:battery-charging-wireless-10

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['edischarge1_tot'] | int / 10 }}"
    unique_id: growatt_discharged_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Battery Discharged Total
    state_class: "total_increasing"
    icon: mdi:battery-charging-wireless-10

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['eharge1_tot'] | int / 10 }}"
    unique_id: growatt_charged_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Battery Charged Total
    state_class: "total_increasing"
    icon: mdi:battery-charging-60

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['eharge1_tod'] | int / 10 }}"
    unique_id: growatt_charged_today
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Battery Charged Today
    state_class: "measurement"
    icon: mdi:battery-charging-60

  • state_topic: energy/growatt
    value_template: "{{ value_json['values']['etogrid_tot'] | int / 10 }}"
    unique_id: growatt_energy_to_grid_total
    device_class: energy
    unit_of_measurement: "kWh"
    name: Growatt - Energy to Grid (Total)
    state_class: "total_increasing"
    icon: mdi:battery-charging-60

egguy and others added 30 commits October 8, 2023 23:15
…istant to monitor Growatt inverters with MQTT 0.1.4
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

Successfully merging this pull request may close these issues.

3 participants