Yes someone provided code for a template sensor to return 0/1Thanks! I found kosmik's fix for the battery and frequency issues. Is there anything for the grid status?
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Yes someone provided code for a template sensor to return 0/1Thanks! I found kosmik's fix for the battery and frequency issues. Is there anything for the grid status?
Got to the same place as you but even after looking back at the previous posts can't for the life of me figure this out. Mind sharing your card config? My HA knowledge ain't the bestLooking very nice indeed! Thank you @Slip
Couple of sensor equivalents I couldn't find on the Deye (solarman):
And then grid_status_194 returns "On-grid"
- batdischargeday_71
- batchargeday_70
- inverter_load_freq_192
View attachment 1522649
I got a template translation sensor for that one, can post code if you like. Same for the inverter status.Thanks! I found kosmik's fix for the battery and frequency issues. Is there anything for the grid status?
sensors:
sunsynkcard_gridstatus:
friendly_name: Gridstatus
value_template: |
{% if is_state('sensor.solarman_grid_connected_status', 'On-Grid') %}
1
{% else %}
0
{% endif %}
sunsynkcard_inverterstatus:
friendly_name: InverterStatus
value_template: |
{% if is_state('sensor.solarman_running_status', 'Stand-by') %}
0
{% elif is_state('sensor.solarman_running_status', 'Self-Checking') %}
1
{% elif is_state('sensor.solarman_running_status', 'Normal') %}
2
{% elif is_state('sensor.solarman_running_status', 'Fault') %}
4
{% endif %}
type: custom:sunsynk-power-flow-card
cardstyle: full
panel_mode: 'no'
inverter:
modern: 'yes'
colour: '#959595'
battery:
energy: 11000
shutdown_soc: 20
invert_power: 'no'
colour: pink
show_daily: 'yes'
solar:
show_solar: 'yes'
colour: orange
show_daily: 'yes'
load:
colour: '#5fb6ad'
show_daily: 'yes'
show_aux: 'no'
grid:
colour: '#5490c2'
show_daily: 'yes'
no_grid_colour: red
entities:
use_timer_248: 'no'
priority_load_243: 'no'
batchargeday_70: sensor.solarman_daily_battery_charge
batdischargeday_71: sensor.solarman_daily_battery_discharge
loadday_84: sensor.solarman_daily_load_consumption
gridday_76: sensor.solarman_daily_energy_bought
solarday_108: sensor.solarman_daily_production
inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
inverter_load_freq_192: sensor.solarman_load_frequency
inverter_out_164: sensor.solarman_current_l1
inverter_out_175: sensor.solarman_inverter_l1_power
inverter_load_grid_169: sensor.solarman_internal_ct_l1_power
pv2_power_187: sensor.solarman_pv2_power
pv1_power_186: sensor.solarman_pv1_power
battery_voltage_183: sensor.solarman_battery_voltage
battery_soc_184: sensor.solarman_battery_soc
battery_out_190: sensor.solarman_battery_power
ess_power: sensor.solarman_total_load_power
grid_external_power_172: sensor.solarman_external_ct_l1_power
pv1_v_109: sensor.solarman_pv1_voltage
pv1_i_110: sensor.solarman_pv1_current
pv2_v_111: sensor.solarman_pv2_voltage
pv2_i_112: sensor.solarman_pv2_current
grid_status_194: sensor.sunsynkcard_gridstatus
inverter_status_59: sensor.sunsynkcard_inverterstatus
aux_power_166: 'no'
I see Kosmik has shared his. Did you manage to come right?Got to the same place as you but even after looking back at the previous posts can't for the life of me figure this out. Mind sharing your card config? My HA knowledge ain't the best
@Slip great work on this!
Thanks for this. Is there a reason you're not using running_status as is?I got a template translation sensor for that one, can post code if you like. Same for the inverter status.
Here
YAML:sensors: sunsynkcard_gridstatus: friendly_name: Gridstatus value_template: | {% if is_state('sensor.solarman_grid_connected_status', 'On-Grid') %} 1 {% else %} 0 {% endif %} sunsynkcard_inverterstatus: friendly_name: InverterStatus value_template: | {% if is_state('sensor.solarman_running_status', 'Stand-by') %} 0 {% elif is_state('sensor.solarman_running_status', 'Self-Checking') %} 1 {% elif is_state('sensor.solarman_running_status', 'Normal') %} 2 {% elif is_state('sensor.solarman_running_status', 'Fault') %} 4 {% endif %}
My settings for the card using solarman
YAML:type: custom:sunsynk-power-flow-card cardstyle: full panel_mode: 'no' inverter: modern: 'yes' colour: '#959595' battery: energy: 11000 shutdown_soc: 20 invert_power: 'no' colour: pink show_daily: 'yes' solar: show_solar: 'yes' colour: orange show_daily: 'yes' load: colour: '#5fb6ad' show_daily: 'yes' show_aux: 'no' grid: colour: '#5490c2' show_daily: 'yes' no_grid_colour: red entities: use_timer_248: 'no' priority_load_243: 'no' batchargeday_70: sensor.solarman_daily_battery_charge batdischargeday_71: sensor.solarman_daily_battery_discharge loadday_84: sensor.solarman_daily_load_consumption gridday_76: sensor.solarman_daily_energy_bought solarday_108: sensor.solarman_daily_production inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1 inverter_load_freq_192: sensor.solarman_load_frequency inverter_out_164: sensor.solarman_current_l1 inverter_out_175: sensor.solarman_inverter_l1_power inverter_load_grid_169: sensor.solarman_internal_ct_l1_power pv2_power_187: sensor.solarman_pv2_power pv1_power_186: sensor.solarman_pv1_power battery_voltage_183: sensor.solarman_battery_voltage battery_soc_184: sensor.solarman_battery_soc battery_out_190: sensor.solarman_battery_power ess_power: sensor.solarman_total_load_power grid_external_power_172: sensor.solarman_external_ct_l1_power pv1_v_109: sensor.solarman_pv1_voltage pv1_i_110: sensor.solarman_pv1_current pv2_v_111: sensor.solarman_pv2_voltage pv2_i_112: sensor.solarman_pv2_current grid_status_194: sensor.sunsynkcard_gridstatus inverter_status_59: sensor.sunsynkcard_inverterstatus aux_power_166: 'no'
Thanks for sharing. Just a heads up that this wont work for the latest version of the card. There have been changes to the attributes used under grid as well as the essential and non-essential sensorsI got a template translation sensor for that one, can post code if you like. Same for the inverter status.
Here
YAML:sensors: sunsynkcard_gridstatus: friendly_name: Gridstatus value_template: | {% if is_state('sensor.solarman_grid_connected_status', 'On-Grid') %} 1 {% else %} 0 {% endif %} sunsynkcard_inverterstatus: friendly_name: InverterStatus value_template: | {% if is_state('sensor.solarman_running_status', 'Stand-by') %} 0 {% elif is_state('sensor.solarman_running_status', 'Self-Checking') %} 1 {% elif is_state('sensor.solarman_running_status', 'Normal') %} 2 {% elif is_state('sensor.solarman_running_status', 'Fault') %} 4 {% endif %}
My settings for the card using solarman
YAML:type: custom:sunsynk-power-flow-card cardstyle: full panel_mode: 'no' inverter: modern: 'yes' colour: '#959595' battery: energy: 11000 shutdown_soc: 20 invert_power: 'no' colour: pink show_daily: 'yes' solar: show_solar: 'yes' colour: orange show_daily: 'yes' load: colour: '#5fb6ad' show_daily: 'yes' show_aux: 'no' grid: colour: '#5490c2' show_daily: 'yes' no_grid_colour: red entities: use_timer_248: 'no' priority_load_243: 'no' batchargeday_70: sensor.solarman_daily_battery_charge batdischargeday_71: sensor.solarman_daily_battery_discharge loadday_84: sensor.solarman_daily_load_consumption gridday_76: sensor.solarman_daily_energy_bought solarday_108: sensor.solarman_daily_production inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1 inverter_load_freq_192: sensor.solarman_load_frequency inverter_out_164: sensor.solarman_current_l1 inverter_out_175: sensor.solarman_inverter_l1_power inverter_load_grid_169: sensor.solarman_internal_ct_l1_power pv2_power_187: sensor.solarman_pv2_power pv1_power_186: sensor.solarman_pv1_power battery_voltage_183: sensor.solarman_battery_voltage battery_soc_184: sensor.solarman_battery_soc battery_out_190: sensor.solarman_battery_power ess_power: sensor.solarman_total_load_power grid_external_power_172: sensor.solarman_external_ct_l1_power pv1_v_109: sensor.solarman_pv1_voltage pv1_i_110: sensor.solarman_pv1_current pv2_v_111: sensor.solarman_pv2_voltage pv2_i_112: sensor.solarman_pv2_current grid_status_194: sensor.sunsynkcard_gridstatus inverter_status_59: sensor.sunsynkcard_inverterstatus aux_power_166: 'no'
which yaml? You need to either edit the deye_hybrid.yaml in the custom controls directory or copy that one and dump its contents in a new one called custom_parameters.yaml and add the sensors. Don't forget to change the integration to then read from that config.I updated my yaml with your changes and rebooted but it's still not
I see Kosmik has shared his. Did you manage to come right?
Sorry, that was a posting error. Been posting on my phone and when I switched to the laptop there was some residual text I missed. Oops. Everything is working great this sidewhich yaml? You need to either edit the deye_hybrid.yaml in the custom controls directory or copy that one and dump its contents in a new one called custom_parameters.yaml and add the sensors. Don't forget to change the integration to then read from that config.
This is my custom one until they complete the PR.
Had to save as txt extension for the forum but obviously use yaml. Needs to be located in /custom_components/solarman/inverter_definitions
Here's my current config which is working on 1.4.2. I did need to define sensor.sunsynkcard_gridstatus as per @Kosmik's earlier posts.Thanks for sharing. Just a heads up that this wont work for the latest version of the card. There have been changes to the attributes used under grid as well as the essential and non-essential sensors
type: custom:sunsynk-power-flow-card
cardstyle: lite
panel_mode: 'no'
inverter:
modern: 'yes'
colour: '#959595'
battery:
energy: 9600
shutdown_soc: 10
invert_power: 'no'
colour: pink
show_daily: 'yes'
solar:
show_solar: 'yes'
colour: orange
show_daily: 'yes'
mppts: two
load:
colour: '#5fb6ad'
show_daily: 'yes'
show_aux: 'no'
invert_aux: 'no'
grid:
colour: '#5490c2'
no_grid_colour: '#a40013'
show_daily_buy: 'yes'
show_daily_sell: 'yes'
show_nonessential: 'no'
entities:
use_timer_248: 'no'
priority_load_243: 'no'
batchargeday_70: sensor.solarman_daily_battery_charge
batdischargeday_71: sensor.solarman_daily_battery_discharge
loadday_84: sensor.solarman_daily_load_consumption
grid_buy_day_76: sensor.solarman_daily_energy_bought
grid_sell_day_77: sensor.solarman_daily_energy_sold
solarday_108: sensor.solarman_daily_production
inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
inverter_load_freq_192: sensor.solarman_load_frequency
inverter_out_164: sensor.solarman_current_l1
inverter_out_175: sensor.solarman_inverter_l2_power
inverter_load_grid_169: sensor.solarman_load_l1_power
pv1_power_186: sensor.solarman_pv1_power
pv2_power_187: sensor.solarman_pv2_power
pv3_power_188: sensor.pv3_power
pv4_power_189: sensor.pv4_power
battery_voltage_183: sensor.solarman_battery_voltage
battery_soc_184: sensor.solarman_battery_soc
battery_out_190: sensor.solarman_battery_power
essential_power: sensor.solarman_total_load_power
nonessential_power: none
grid_external_power_172: sensor.solarman_total_grid_power
pv1_v_109: sensor.solarman_pv1_voltage
pv1_i_110: sensor.solarman_pv1_current
pv2_v_111: sensor.solarman_pv2_voltage
pv2_i_112: sensor.solarman_pv2_current
pv3_v_113: sensor.dc3_voltage
pv3_i_114: sensor.dc3_current
pv4_v_115: sensor.dc4_voltage
pv4_i_116: sensor.dc4_current
grid_status_194: sensor.sunsynkcard_gridstatus
inverter_status_59: sensor.solarman_running_status
aux_power_166: sensor.aux_output_power
inverter_load_grid_169: sensor.solarman_load_l1_power
inverter_out_175: sensor.solarman_inverter_l2_power
inverter_load_grid_169: sensor.solarman_total_load_power
inverter_out_175: sensor.solarman_total_power
Ok, I've updated as follows:I would suggest you change
toYAML:inverter_load_grid_169: sensor.solarman_load_l1_power inverter_out_175: sensor.solarman_inverter_l2_power
YAML:inverter_load_grid_169: sensor.solarman_total_load_power inverter_out_175: sensor.solarman_total_power
I'd like to add this to the github and template sensors once confirmed working.
type: custom:sunsynk-power-flow-card
cardstyle: lite
panel_mode: 'no'
inverter:
modern: 'yes'
colour: '#959595'
battery:
energy: 9600
shutdown_soc: 10
invert_power: 'no'
colour: pink
show_daily: 'yes'
solar:
show_solar: 'yes'
colour: orange
show_daily: 'yes'
mppts: two
load:
colour: '#5fb6ad'
show_daily: 'yes'
show_aux: 'no'
invert_aux: 'no'
grid:
colour: '#5490c2'
no_grid_colour: '#a40013'
show_daily_buy: 'yes'
show_daily_sell: 'yes'
show_nonessential: 'no'
entities:
use_timer_248: 'no'
priority_load_243: 'no'
batchargeday_70: sensor.solarman_daily_battery_charge
batdischargeday_71: sensor.solarman_daily_battery_discharge
loadday_84: sensor.solarman_daily_load_consumption
grid_buy_day_76: sensor.solarman_daily_energy_bought
grid_sell_day_77: sensor.solarman_daily_energy_sold
solarday_108: sensor.solarman_daily_production
inverter_grid_voltage_154: sensor.solarman_grid_voltage_l1
inverter_load_freq_192: sensor.solarman_load_frequency
inverter_out_164: sensor.solarman_current_l1
inverter_out_175: sensor.solarman_total_power
inverter_load_grid_169: sensor.solarman_total_load_power
pv1_power_186: sensor.solarman_pv1_power
pv2_power_187: sensor.solarman_pv2_power
pv3_power_188: sensor.pv3_power
pv4_power_189: sensor.pv4_power
battery_voltage_183: sensor.solarman_battery_voltage
battery_soc_184: sensor.solarman_battery_soc
battery_out_190: sensor.solarman_battery_power
essential_power: sensor.solarman_total_load_power
nonessential_power: none
grid_external_power_172: sensor.solarman_total_grid_power
pv1_v_109: sensor.solarman_pv1_voltage
pv1_i_110: sensor.solarman_pv1_current
pv2_v_111: sensor.solarman_pv2_voltage
pv2_i_112: sensor.solarman_pv2_current
pv3_v_113: sensor.dc3_voltage
pv3_i_114: sensor.dc3_current
pv4_v_115: sensor.dc4_voltage
pv4_i_116: sensor.dc4_current
grid_status_194: sensor.sunsynkcard_gridstatus
inverter_status_59: sensor.solarman_running_status
aux_power_166: sensor.aux_output_power

show_solar: 'no'
Will see if I can make that smarterA small idea that would help people with smaller setups (Like mine, where i dont have solar at all).
In a scenario where i set:it should not complain about missing attributes for anything solar related (Such as mppts, show_daily, pv*_*. I had a ton on breaking configs for something i dont needCode:show_solar: 'no'
Might also make sense when their are entities that are straight "display" entities and not used in calculations to make these optional too. So instead of having to put a entity value of "none", rather allow me to leave the entity out completely. Would allow for future changes where you add entities to be non-breaking changes
All working and turns out I just wasn't reading properly. Thank you!I see Kosmik has shared his. Did you manage to come right?