CJNE / ha-myenergi

Home Assistant integration for MyEnergi devices
MIT License
143 stars 32 forks source link

Diverted power in watts to EDDI #376

Open waltonbp opened 1 year ago

waltonbp commented 1 year ago

I have the EDDI HACs working in HA (thanks it work great) but I can't find any real time entity for "diverted power in watts"

This is needed to for display in grid cards to show the flow of power (the daily accumlative energy is kwh is avaialble)

This diverted power appears in the EDDI App and device display screen but not in the HACS HA ?

Could it be added ?

I found this in the MyEnergi-App-Api on GitHub

{ "eddi": [{ "bsm": 1, // Boost Mode - 1 if boosting "che": 1 // total kWh tranferred this session (today?) "cmt": 254, // Command Timer - counts 1 - 10 when command sent, then 254 - success, 253 - failure, 255 - never received any commands "dat": "07-06-2019", //date "div": 928, //Diversion amount Watts *** MISSING ** "dst": 1 //Daylight Savings Time enabled "ectp1": -7, //physical CT connection 1 value "ectp2": 6, //physical CT connection 2 value "ectt1": "Grid", //CT 1 name "ectt2": "Generation", //CT 2 name "frq": 50.07, //Supply Frequency "fwv": 1234, //firmware version "gen": 2054, //Generated Watts "grd": 969, //Current Watts from Grid (negative if sending to grid) "hno": 1, // Currently active heater (1/2) "ht1": "Tank 1", //Heater 1 name "ht2": "Tank 2", //Heater 2 name "pha": 3, //phase number or number of phases? "pri": 2, //priority "r1a": 1, // Have never seen this ? "r2a": 1, // Have never seen this ? "r2b": 1, // Have never seen this ? "rbt": 3600, // If boosting, the remaining boost time in of seconds "sno": 10088888, //Changed Eddi Serial Number "sta": 3, //Status 1=Paused, 3=Diverting, 4=Boost, 5=Max Temp Reached, 6=Stopped "tim": "07:28:45", //time "tp": 50, //temperature probe 1 (50 C) "tp2": -1, //temperature probe 2 "vol": 2395, //Voltage out (divide by 10) }] }

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

G6EJD commented 1 year ago

You’ll need to ask MyEnergi why they only issue Watt-hours rather than Watts as that value is not in the API !

Why would you want instantaneous power when energy is measured in the time domain of whr?

waltonbp commented 1 year ago

I want to add the EDDI power to grid .......EDDI is energy accumulation for the day not actual power flow - get the picture !!

[image: image.png]

On Tue, 6 Jun 2023 at 15:55, G6EJD @.***> wrote:

You’ll need to ask MyEnergi why they only issue Watt-hours rather than Watts as that value is not in the API !

Why would you want instantaneous power when energy is measured in the time domain of whr?

— Reply to this email directly, view it on GitHub https://github.com/CJNE/ha-myenergi/issues/376#issuecomment-1578922447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI2IXPVITGU3WCLJFDPJPJLXJ5AFXANCNFSM6AAAAAAY4JQP3Y . You are receiving this because you authored the thread.Message ID: @.***>

G6EJD commented 1 year ago

But the information is not provided by the API !

fanfarestreak commented 1 year ago

I've got a dashboard that tells me where the watts are going at that moment image I get this by using the grid CT outputs, is this what you are looking for? My feed for eddi comes from entity "myenergi eddi-[eddi serial no.] Internal Load CT1" image

LeiChat commented 1 year ago

EDIT: the _internal_load_ct1 is the Watts being diverted AND/OR boosted, it's not purely a measurement of energy being used by the eddi from the grid. So, if you were boosting while excess PV generation (below the eddi's demand) was available the energy flow stuff in HA wouldn't be able to represent the split of energy source.

I'm using mushroom template cards for zappi and eddi that show various primary/secondary text depending on what they are doing. Like @fanfarestreak, I use the _internal_load_ct1 entity value to show the amount of energy the eddi is actively diverting/boosting. In the screenshot below, it's the zappi that's currently diverting.

I use the card_mod (available through HACS) to inject CSS animation to pulse the icon when the zappi or eddi are active.

image

type: custom:mushroom-template-card
primary: >-
  eddi : {% if states('sensor.myenergi_eddi_URN_status') == "Diverting" or
  states('sensor.myenergi_eddi_URN_status') == "Boosting" %} {{
  states('sensor.myenergi_eddi_URN_status') }} {{
  (states('sensor.myenergi_eddi_URN_internal_load_ct1') | int / 1000) |
  round(1) }} kW {% else %} {{ states('sensor.myenergi_eddi_URN_status') }}
  {% endif %}
secondary: >-
  Tank {{ states('sensor.myenergi_eddi_URN_temp_tank_1') }}°C {{+
  '          ' }} Outlet {{ states('sensor.myenergi_eddi_URN_temp_none')
  }}°C
icon: >-
  {% if states('sensor.myenergi_eddi_URN_temp_tank_1') | int > 39
  %}mdi:thermometer-high{% elif
  states('sensor.myenergi_eddi_URN_temp_tank_1') | int > 30
  %}mdi:thermometer{% else %}mdi:thermometer-low{% endif %}
entity: sensor.myenergi_eddi_URN_temp_none
icon_color: >-
  {% if states('sensor.myenergi_eddi_URN_temp_tank_1') | int > 39 %}green{%
  elif states('sensor.myenergi_eddi_URN_temp_tank_1') | int > 30 %}amber{%
  else %}red{% endif %}
layout: horizontal
tap_action:
  action: more-info
fill_container: true
multiline_secondary: true
card_mod:
  style: |
    mushroom-shape-icon {
        {{ '--icon-animation: pulse 3s linear infinite;' if is_state('sensor.myenergi_eddi_URN_status', 'Diverting') }}
        {{ '--icon-animation: pulse 3s linear infinite;' if is_state('sensor.myenergi_eddi_URN_status', 'Boosting') }}
      }