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

Sensor for live feed back to the grid Hey mate I have it all working pretty well but can not find the sensor for live feed back to grid please help #124

Open
keensy opened this issue Dec 17, 2024 · 1 comment

Comments

@keensy
Copy link

keensy commented Dec 17, 2024

No description provided.

@keensy
Copy link
Author

keensy commented Dec 18, 2024

I wanted to set up the energy app but some of the sensors etc didn't meet the purpose so I created these in my configuration.yaml hope this helps someone else

Template Sensors

template:

  • sensor:

    Solar Data - Anonymized Total

    • name: "Total Solar Output"
      unique_id: "total_solar_output"
      unit_of_measurement: "Wh"
      state_class: "measurement"
      device_class: "energy"
      state: >-
      {% set solar_value = states('sensor.gosungrow_virtual_1134569_1_1_1_p24') | float(0) %}
      {{ solar_value if solar_value > 0 else 0 }}

    Power Generated by System

    • name: "System Power Generated"
      unique_id: "system_power_generated"
      unit_of_measurement: "wh"
      state_class: "measurement"
      device_class: "power"
      state: >-
      {% set solar_value = states('sensor.gosungrow_virtual_1134569_1_1_1_p24') | float(0) / 1000 %}
      {{ solar_value | round(2) }}

    Energy Sent Out

    • name: "Exported Energy"
      unique_id: "exported_energy"
      unit_of_measurement: "Wh"
      state_class: "total_increasing"
      device_class: "energy"
      state: >-
      {% set grid_feed_value = states('sensor.gosungrow_virtual_1134569_7_1_1_p8018') | float(0) %}
      {{ abs(grid_feed_value) if grid_feed_value < 0 else 0 }}

    Consumed Energy

    • name: "Energy Used Locally"
      unique_id: "energy_used_locally"
      unit_of_measurement: "Wh"
      state_class: "total_increasing"
      device_class: "energy"
      state: >-
      {% set solar_generated = states('sensor.gosungrow_virtual_1134569_1_1_1_p24') | float(0) %}
      {% set exported = states('sensor.exported_energy') | float(0) %}
      {{ solar_generated - exported if solar_generated >= exported else 0 }}

MQTT Integration for Sharing Data (Optional)

mqtt:
sensor:
- name: "Shared Power Data"
unique_id: "shared_power_data"
state_topic: "system/power/summary"
value_template: >-
{
"generated": "{{ states('sensor.system_power_generated') }}",
"exported": "{{ states('sensor.exported_energy') }}",
"local_use": "{{ states('sensor.energy_used_locally') }}"
}
json_attributes_topic: "system/power/summary"

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

1 participant