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

Wiki: typo in config for TeslaStylePowerCard #61

Open
ChristophCaina opened this issue Oct 20, 2021 · 11 comments
Open

Wiki: typo in config for TeslaStylePowerCard #61

ChristophCaina opened this issue Oct 20, 2021 · 11 comments

Comments

@ChristophCaina
Copy link
Contributor

ChristophCaina commented Oct 20, 2021

There's a small issue with the configuration.yaml for the Power Flow...

power_self_consumption:                                            
        friendly_name: "Power - Self Consumption"                               
        unit_of_measurement: "W"           
        # Self consumption of solar generation is inverter output, minus what is being exported to grid                                 
        value_template: "{{ (states('sensor.solaredge_modbus_i1_ac_power') | float)) - states('sensor.power_grid_export') | float}}" 

should be:

power_self_consumption:                                            
        friendly_name: "Power - Self Consumption"                               
        unit_of_measurement: "W"           
        # Self consumption of solar generation is inverter output, minus what is being exported to grid                                 
        value_template: "{{ (states('sensor.solaredge_modbus_i1_ac_power') | float) - (states('sensor.power_grid_export') | float) }}" 

Additionally, the flow is going from "Home" to "Solar" instead of "Solar" to "Home"
grafik

@mpredfearn
Copy link
Contributor

@ChristophCaina sorry I don't have this configuration in order to test it for the docs, I based it on the discussion here #55 (comment) where @LukePrior gave his configuration. It would be most helpful if you could work out what the correct maths is in order to fix the documentation.
Are the other flows, specifically power_grid_export and power_grid_import correct in direction and magnitude?

@ChristophCaina
Copy link
Contributor Author

Hi @mpredfearn : I think, the issue was related to the naming of the sensor.

(states('sensor.solaredge_modbus_i1_ac_power')
should be
(states('sensor.solaredge_modbus_m1_ac_power')

@ChristophCaina
Copy link
Contributor Author

ok, had a look into the pull requests.
It seems that the i1_ac_power came from pullrequest #12 where a change for multiple inverters has been made.
In this case, I expect the i1 as a counter for the inverter...

@WillCodeForCats
Copy link

In a multi-inverter setup you can have all of:

sensor.solaredge_i1_ac_power
sensor.solaredge_i2_ac_power
...
sensor.solaredge_m1_ac_power

If you have multiple inverters, you will want sensor.solaredge_i1_ac_power + sensor.solaredge_i2_ac_power (etc. for however many inverters you have).

@ChristophCaina
Copy link
Contributor Author

ok, that should be highlighted in the Wiki page then.
I think, the wiki should include examples with the most likely setup - which I think is a one-inverter setup... or?

@mpredfearn
Copy link
Contributor

@ChristophCaina yes, most likely - but I don't have such a system to verify the sensors with. If you could post your (working) template sensors then the wiki can be updated.
Note that I don't think
(states('sensor.solaredge_modbus_i1_ac_power')
should be
(states('sensor.solaredge_modbus_m1_ac_power')
As @WillCodeForCats says, the "i1" is there because I am running a branch with multiple inverter support and forgot to remove it from there.

@ChristophCaina
Copy link
Contributor Author

yes, the i1 comes from the inverter.
Since I only have one inverter, I've replaced this with the modbus_ac_power (without inverter-Number) ... and then it worked.

here's my working code...
But note, since my solar-installation does prevent me from importing much energy from the grid during the day, I can only veryfy the flow from production to grid at the moment.

# Power Flow for Tesla Style Power Card
    power_grid_import:                                                    
      friendly_name: "Power - Grid Import"                                    
      unit_of_measurement: "W"    
      # Grid import to loads is negative values of import / export meter
      value_template: "{{ (states('sensor.solaredge_modbus_m1_ac_power') | float | min(0) | abs()) }}"
    power_grid_export:                                                     
      friendly_name: "Power - Grid Export"                                    
      unit_of_measurement: "W"   
      # Grid export is positive values of import / export meter
      value_template: "{{ states('sensor.solaredge_modbus_m1_ac_power') | float | max(0) }}"                                                                                                                                                   
    power_consumption:                                                  
      friendly_name: "Power - Consumption"                                    
      unit_of_measurement: "W"       
      # House consumption is inverter output minus import / export meter flow
      value_template: "{{ (states('sensor.solaredge_modbus_ac_power') | float) - (states('sensor.solaredge_modbus_m1_ac_power') | float) }}"
    power_self_consumption:                                            
      friendly_name: "Power - Self Consumption"                               
      unit_of_measurement: "W"           
      # Self consumption of solar generation is inverter output, minus what is being exported to grid                                 
      value_template: "{{ (states('sensor.solaredge_modbus_ac_power') | float) - (states('sensor.power_grid_export') | float) }}" 

grafik

@ChristophCaina
Copy link
Contributor Author

BUT:
the other question is... do we really need the tesla style power card?
With the energy dashboard, HomeAssistant does come with its own card in a very similar style
grafik

this can be used with type: energy-distribution
and you don't need to care about any math etc... it's just providing the information from the sensors added to the energy dashboard and you can use the card wherever you want.

@mpredfearn
Copy link
Contributor

OK cool thanks @ChristophCaina - wiki page updated with those sensors.

It depends what you want to see. The Tesla style card gives you the instantaneous power - i.e. power flows right now. The energy dashboard gives you the overall energy distribution for the day - both are useful, but they are very different things.

@ChristophCaina
Copy link
Contributor Author

hi @mpredfearn,
I don't know if it is correct to 'copy & paste' my code... I have renamed the integration to solaredge_modbus since I'm also using the cloud integration as well as some custom sensors.
Therefore, I have added the type of the integration (solaredge_api, solaredge_modbus, etc.)

I think, the default is just solaredge - and should probably reflected in the wiki, too...

@mpredfearn
Copy link
Contributor

Yeah I renamed it as well in exactly the same way - all of the other templated sensors are the same style - so it is consistent at least. I'll add a note on the page to reflect that. Possibly "solaredge" is the wong default domain for this integration.

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

3 participants