警告:打破配置更改
您必須再次定義流!
如果不定義每個流,則不會顯示任何線路,請仔細閱讀使用部分(可以單擊氣泡,但這是可選的)
這是用於太陽能安裝的家庭輔助卡。它提供了特斯拉風格的圖形,可以看到能量流((k)w)。

我試圖使其盡可能通用,目前有6個帶有4個主要圖標和2個額外電器的氣泡。四個主要圖標值由來自和它們的流量的總和控制:
這兩個可選的電器可以是房屋中的任何消費者,它們都附在房屋上。這兩個是由他們的消費直接控制的。意味著未完成流量總和。
單擊時可以將氣泡/圖標配置為具有實體,但是數字是根據流量計算的。您可以在氣泡的頂部顯示額外的實體文本/值。
有7個主要流和2個電器流。主要流量是:
您至少需要一個,暫時固定了主氣泡的放置。有些將從一個氣泡中提取值,並將值增加為另一個氣泡。例如:
電池_TO_HOUSE將從電池氣泡/圖標中提取,並添加到房屋氣泡/圖標中。
可單擊的實體可以通過這些實體進行配置,但是可選的:
該卡是根據Bessarabov動畫消費卡的卡開始的,再次感謝您的工作。然後重寫完全將樣闆卡作為起點,但使用打字稿。我還從電動輪卡中藉了一些想法,可悲的是還沒有我想要的那麼多;)
在流量和可單擊的實體上,每個氣泡都可以在頂部具有額外的價值。為了定義您需要在任何論文實體中添加傳感器的人:
我總是將電池電流充電作為電池_EXTRA_ENTITY。在這種情況下,電池圖標也會隨充電而變化。
目前,我沒有最低配置,但是某些組合可能沒有意義。我建議使用您想要的氣泡以及與您正在使用的氣泡相關的流量。這些示例的左側是固定的,用自己的傳感器更改右側。沒有必要的實體,儘管如果您遺漏了一些組合,則您的配置可能會顯示出奇怪的結果。傳感器可以稱為您想要的任何東西,它們是瓦特或千瓦的Power -termeter傳感器(選擇所有人,它將從中創建KW)。所有傳感器都需要是正值
一個簡單的組合示例:
type : ' custom:tesla-style-solar-power-card '
grid_consumption_entity : sensor.grid_consumption
house_consumption_entity : sensor.house_consumption
grid_to_house_entity : sensor.grid_consumption這將使您擁有兩個可單擊的氣泡,並且從網格到房屋的流量將決定圖標下方的值。
type : ' custom:tesla-style-solar-power-card '
name : My Flows
# 7 flows between bubbles
grid_to_house_entity : sensor.grid_consumption
grid_to_battery_entity : sensor.grid_battery_charge
generation_to_grid_entity : sensor.grid_feed_in
generation_to_battery_entity : sensor.battery_charging
generation_to_house_entity : sensor.solar_consumption
battery_to_house_entity : sensor.battery_consumption
battery_to_grid_entity : sensor.battery_to_grid
# extra values to show as text above icons
battery_extra_entity : sensor.battery_charge
house_extra_entity : sensor.current_temperature
generation_extra_entity : sensor.percent_cloud_coverage
grid_extra_entity : sensor.monthly_feed_in
# optional appliances with consumption and extra values
appliance1_consumption_entity : sensor.car_consumption
appliance1_extra_entity : sensor.car_battery_state_of_charge
appliance2_consumption_entity : sensor.heating_consumption
appliance2_extra_entity : sensor.heating_operation
# optional 4 main bubble icons for clickable entities
grid_entity : sensor.grid_consumption
house_entity : sensor.house_consumption
generation_entity : sensor.solar_yield
battery_entity : sensor.battery_consumption如果將電池氣泡的額外實體定義為具有充電狀態的額外實體,則圖標將被動態地替換為該實體的值,並覆蓋上面的圖標定義。
有一些更改行為的配置變量:標題:
name : ' My Tesla Power Card! '一個強制W(瓦)而不是kW,將其設置為1以使用它:
show_w_not_kw : 1一個為移動點設定不同速度的人,正常速度因子為0.04,因此首先保持接近該數字,0.2確實很快:
speed_factor : 0.03一個是將W轉換為kW的閾值(下面的示例將從5000 W到千瓦):
threshold_in_k : 5threshold_in_k與show_w_not_kw不兼容,後者將覆蓋threshold_in_k
一個可以隱藏不活躍的行,請確保在隱藏行之前,請確保所有內容都可以正常工作:
hide_inactive_lines : 1一個可以為電源線添加差距,就像HA的能量面板這樣做的方式:
show_gap : true一個可以根據最高流量為房屋泡泡著色:
change_house_bubble_color_with_flow : 1一個不顯示移動圓而,而是一個能量流digramm(流動較高時較厚的線):
energy_flow_diagramm : 1有一個因素使線更厚的因素,具體取決於您的流量正常,它是2:
energy_flow_diagramm_line_factor : 2您可以從房屋價值中減去設備值而不會影響線路流量:
house_without_appliances_values : 1然後有6個圖標配置變量:
grid_icon : ' mdi:transmission-tower '
generation_icon : ' mdi:solar-panel-large '
house_icon : ' mdi:home '
battery_icon : ' mdi:battery '
appliance1_icon : ' mdi:car-sports '
appliance2_icon : ' mdi:car-sports '請記住,如果您缺少Solar_Compumption和Grid_feed_in之類的太陽能產量,或者如果您缺少諸如home_conmaption之類的另一個,則可以創建模板傳感器。一些逆變器具有正值和負值,在這裡所有傳感器都必須是正值,因此創建模板傳感器,例如:
battery_consumption :
value_template : ' {% set batter_cons = sensor.powerwall_battery_now | int %}
{% if batter_cons > 0 %}
{{ batter_cons | int }}
{% else %}
0
{% endif %} '
device_class : power
unit_of_measurement : W為了將此卡與Tesla PowerWall集成一起使用,您將需要首先創建一些其他傳感器。該卡期望一個在屏幕上顯示的每行正值值的實體。但是,特斯拉的PowerWall集成會產生傳感器,這些傳感器取決於是否從中消耗或進食該特定儀表。
幸運的是,通過添加一些模板傳感器可以很容易地修復,您需要添加的模板傳感器如下所示。請注意,這些傳感器假設由Tesla PowerWall Integration創建的每個實體的默認名稱,如果您更改了實體的名稱,則需要相應地調整配置:
# Templates for Actual Powerflow transfer charts (APF - Actual PowerFlow)
#
# For the math to add up a new Real House Load must be calculated and used, witch includes
# the inverter consumption and excludes rounding errors and corrects inaccurate power readings.
#
# It never made sense that inbound power sometimes does not equal outbound power. This fixes it!
#
# Developed by AviadorLP modified for powerwall by purcell-lab
# Correctly sets battery2grid & grid2battery flows
#
template :
- sensor :
# grid sensor must be negative when importing and positive when exporting
- name : APF Grid Entity
device_class : power
state_class : measurement
unit_of_measurement : W
state : " {{ (0 - states('sensor.powerwall_site_now')|float(0)*1000)|int(0) }} "
# sensor must always be 0 or positive (i think they always are)
- name : APF House Entity
device_class : power
state_class : measurement
unit_of_measurement : W
state : " {{ (states('sensor.powerwall_load_now')|float(0)*1000)|int(0) }} "
# sensor must always be 0 or positive (i think they always are)
- name : APF Generation Entity
device_class : power
state_class : measurement
unit_of_measurement : W
state : " {{ (states('sensor.powerwall_solar_now')|float(0)*1000)|int(0) }} "
# battery sensor must be positive when charging and negative when discharging
- name : APF Battery Entity
device_class : power
state_class : measurement
unit_of_measurement : W
state : " {{ (0 - states('sensor.powerwall_battery_now')|float(0)*1000)|int(0) }} "
# Required to reduce code later on
- name : APF Grid Import
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_grid_entity')|int(default=0) < 0 %}
{{ states('sensor.apf_grid_entity')|int(default=0)|abs }}
{% else %}
0
{% endif %}
# Inverter consumption and power losses due to Inverter transfers and power conversions (AC/DC)
# excludes rounding errors made worst by the fact that some inverters round all sensors readings to INT
# Occasionally this might be negative probably due to cumulative errors in not so accurate power readings.
- name : APF Inverter Power Consumption
device_class : power
state_class : measurement
unit_of_measurement : W
state : " {{ states('sensor.apf_generation_entity')|int(default=0) - states('sensor.apf_battery_entity')|int(default=0) - states('sensor.apf_house_entity')|int(default=0) - states('sensor.apf_grid_entity')|int(default=0) }} "
# Real House Load Includes Inverter consumption and transfer conversions and losses and rounding errors.
# It never made sense that inbound power sometimes does not equal outbound power. This fixes it!
- name : APF Real House Load
device_class : power
state_class : measurement
unit_of_measurement : W
state : " {{ states('sensor.apf_house_entity')|int(default=0) + states('sensor.apf_inverter_power_consumption')|int(default=0) }} "
icon : mdi:home-lightning-bolt
- name : APF Grid2House
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_grid_import')|int(default=0) > states('sensor.apf_real_house_load')|int(default=0) %}
{{ states('sensor.apf_real_house_load')|int(default=0) }}
{% else %}
{{ states('sensor.apf_grid_import')|int(default=0) }}
{% endif %}
- name : APF Grid2Batt
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_grid_import')|int(default=0) > states('sensor.apf_real_house_load')|int(default=0) %}
{{ states('sensor.apf_grid_import')|int(default=0) - states('sensor.apf_real_house_load')|int(default=0) }}
{% else %}
0
{% endif %}
- name : APF Batt2House
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_battery_entity')|int(default=0) < 0 %}
{% if states('sensor.apf_battery_entity')|int(default=0)|abs > states('sensor.apf_real_house_load')|int(default=0) %}
{{ states('sensor.apf_real_house_load')|int(default=0) }}
{% else %}
{{ states('sensor.apf_battery_entity')|int(default=0)|abs }}
{% endif %}
{% else %}
0
{% endif %}
# This might be called house to grid, and can happen in rare circumstances,
# like when the inverter is not able to do a precise adjustment of power fast enough
# or when you want to force a discharge of the battery or something...
# But it only happens with battery or other power generator users.
- name : APF Batt2Grid
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_battery_entity')|int(default=0) < 0 %}
{% if states('sensor.apf_battery_entity')|int(default=0)|abs > states('sensor.apf_real_house_load')|int(default=0) %}
{{ states('sensor.apf_battery_entity')|int(default=0)|abs - states('sensor.apf_real_house_load')|int(default=0) }}
{% else %}
0
{% endif %}
{% else %}
0
{% endif %}
- name : APF Solar2Grid
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_grid_entity')|int(default=0) > states('sensor.apf_batt2grid')|int(default=0) %}
{{ states('sensor.apf_grid_entity')|int(default=0) - states('sensor.apf_batt2grid')|int(default=0) }}
{% else %}
0
{% endif %}
- name : APF Solar2House
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_generation_entity')|int(default=0) > 0 and states('sensor.apf_real_house_load')|int(default=0) > states('sensor.apf_batt2house')|int(default=0) + states('sensor.apf_grid_import')|int(default=0) %}
{% if states('sensor.apf_generation_entity')|int(default=0) > states('sensor.apf_real_house_load')|int(default=0) - states('sensor.apf_batt2house')|int(default=0) - states('sensor.apf_grid2house')|int(default=0) %}
{{ states('sensor.apf_real_house_load')|int(default=0) - states('sensor.apf_batt2house')|int(default=0) - states('sensor.apf_grid2house')|int(default=0) }}
{% else %}
{{ states('sensor.apf_generation_entity')|int(default=0) }}
{% endif %}
{% else %}
0
{% endif %}
- name : APF Solar2Batt
device_class : power
state_class : measurement
unit_of_measurement : W
state : >
{% if states('sensor.apf_generation_entity')|int(default=0) > 0 and states('sensor.apf_battery_entity')|int(default=0) > 0 %}
{% if states('sensor.apf_battery_entity')|int(default=0) > states('sensor.apf_grid2batt')|int(default=0) %}
{% if states('sensor.apf_generation_entity')|int(default=0) - states('sensor.apf_solar2house')|int(default=0) > states('sensor.apf_battery_entity')|int(default=0) - states('sensor.apf_grid2batt')|int(default=0) %}
{{ states('sensor.apf_battery_entity')|int(default=0) - states('sensor.apf_grid2batt')|int(default=0) }}
{% else %}
{{ states('sensor.apf_generation_entity')|int(default=0) - states('sensor.apf_solar2house')|int(default=0) - states('sensor.apf_solar2grid')|int(default=0) }}
{% endif %}
{% else %}
0
{% endif %}
{% else %}
0
{% endif %}包含這些傳感器後,您可以像這樣配置卡:
type : ' custom:tesla-style-solar-power-card '
grid_entity : sensor.apf_grid_entity
house_entity : sensor.apf_real_house_load
generation_entity : sensor.apf_generation_entity
battery_entity : sensor.apf_battery_entity
grid_to_house_entity : sensor.apf_grid2house
grid_to_battery_entity : sensor.apf_grid2batt
generation_to_grid_entity : sensor.apf_solar2grid
generation_to_battery_entity : sensor.apf_solar2batt
generation_to_house_entity : sensor.apf_solar2house
battery_to_house_entity : sensor.apf_batt2house
battery_to_grid_entity : sensor.apf_batt2grid
battery_extra_entity : sensor.powerwall_charge V0.9 V0.92 VBETA1.1。
歡迎拉動請求。對於重大更改,請先開設一個問題,以討論您想更改的內容。
Apache許可證v 2.0