muppet3000 / homeassistant-grott

Home Assistant Integration for Grott - MQTT
MIT License
73 stars 17 forks source link

How to keep my old data #68

Closed zjean closed 6 months ago

zjean commented 10 months ago

Hi I am currrently using the Growatt Home assistant integration for Growatt. Which isn't working for a few months now. I decided to go the Grott docker route, together with this HACS plugin.

However, I would like to keep the data that I have gathered in the recent years, so my energy dashboard is working again.

I found this file, but the sensor names used here don't line up with the sensors created by my Growatt integration.

I have these (serial number / name redacted). Can you guide me to the correct template sensors to get the new data from grott and this integration into these current sensors?

sensor.<lowercase_serial>_ac_frequency
sensor.<lowercase_serial>_energy_today
sensor.<lowercase_serial>_input_1_amperage
sensor.<lowercase_serial>_input_1_voltage
sensor.<lowercase_serial>_input_1_wattage
sensor.<lowercase_serial>_input_2_amperage
sensor.<lowercase_serial>_input_2_voltage
sensor.<lowercase_serial>_input_2_wattage
sensor.<lowercase_serial>_input_3_amperage
sensor.<lowercase_serial>_input_3_voltage
sensor.<lowercase_serial>_input_3_wattage
sensor.<lowercase_serial>_intelligent_power_management_temperature
sensor.<lowercase_serial>_internal_wattage
sensor.<lowercase_serial>_lifetime_energy_output
sensor.<lowercase_serial>_output_power
sensor.<lowercase_serial>_reactive_amperage
sensor.<lowercase_serial>_reactive_voltage
sensor.<lowercase_serial>_reactive_wattage
sensor.<lowercase_serial>_temperature

sensor.pr<number>_<my_name>_total_energy_today
sensor.pr<number>_<my_name>_total_lifetime_energy_output
sensor.pr<number>_<my_name>_total_maximum_power
sensor.pr<number>_<my_name>_total_money_lifetime
sensor.pr<number>_<my_name>_total_output_power
sensor.pr<number>_<my_name>_total_total_money_today
muppet3000 commented 10 months ago

This is obviously dependent on a case-by-base basis, however, it should work something like this:

  - sensor:
    - name: <DEVICE_ID-UPPER_CASE> Solar energy today
      unique_id: <DEVICE_ID-LOWER_CASE>_solar_energy_today
      device_class: 'energy'
      unit_of_measurement: 'kWh'
      state_class: 'total'
      icon: 'mdi:solar-power'
      state: >
        {{ states('sensor.<DEVICE_ID-LOWER_CASE>_pv_all_energy_today_calculated') }}

The name' is the human readable name that the Growatt integration used to be called The unique_id is the REALLY IMPORTANT one to get right, it must match the unique_id that the Growatt sensor used to be called, this is what Home Assistant uses under the hood to keep track of the historic values The device class depends on what type e.g. energy or power The unit_of_measurement is pretty self explanatory The state_class depends on whether the value resets nightly or not, if it is an 'all time' value then set it to total if it reset every day e.g. something with "today" in the name then it should be total_increasing. The state template should be used to point at the new sensor that provides the value you want.

I hope that helps.

typxxi commented 6 months ago

I guess that this topic should be closed after such help mentioned above without any reaction. Otherwise the list would become endless over time with all the LOST topics opened and forgotten.

He got a same day reply and I guess also solution - and he did nothing, not reply nor even a thank you , therefore I gave a thumbs up for a same day reply.

Therefore I am wondering what all the other topics might be cause I wanted to read here about real issues first before I set my grott system up. But I think I might short that and simply start with setting up and then looking for the integration later now that I have 5 or 7 growatt inverters running.

muppet3000 commented 6 months ago

Yeah I'll close this one, I was waiting for a response that never came.