sensor: | |
# These should be used in the energy dashboard. | |
- platform: integration | |
source: sensor.shp_circuit_1_power | |
name: SHP Circuit 1 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_2_power | |
name: SHP Circuit 2 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_3_power | |
name: SHP Circuit 3 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_4_power | |
name: SHP Circuit 4 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_5_power | |
name: SHP Circuit 5 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_6_power | |
name: SHP Circuit 6 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_7_power | |
name: SHP Circuit 7 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
method: left | |
- platform: integration | |
source: sensor.shp_circuit_8_power | |
name: SHP Circuit 8 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_9_power | |
name: SHP Circuit 9 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
- platform: integration | |
source: sensor.shp_circuit_10_power | |
name: SHP Circuit 10 Consumed Energy | |
unit_prefix: k | |
round: 3 | |
template: | |
- sensor: | |
- name: "ECOFLOW Smart Home Panel Combined Circuit Power" | |
unit_of_measurement: "kW" | |
device_class: power | |
state_class: measurement | |
state: >- | |
{{ ((states.sensor | |
| selectattr('entity_id', 'search', 'sensor.shp_') | |
| rejectattr('entity_id', 'search', 'delta_pro') | |
| selectattr('entity_id', 'search', '_power$') | |
| map(attribute='state') | map('float') | sum) / 1000) | round(2) | |
}} | |
- select: | |
- name: "SHP Circuit 1 Mode" | |
unique_id: shp_circuit_1_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_1_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_1_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_1_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":0,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":0,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":0,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":0,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 2 Mode" | |
unique_id: shp_circuit_2_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_2_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_2_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_2_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":1,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":1,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":1,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":1,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 3 Mode" | |
unique_id: shp_circuit_3_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_3_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_3_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_3_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":2,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":2,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":2,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":2,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 4 Mode" | |
unique_id: shp_circuit_4_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_4_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_4_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_4_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":3,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":3,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":3,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":3,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 5 Mode" | |
unique_id: shp_circuit_5_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_5_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_5_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_5_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":4,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":4,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":4,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":4,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 6 Mode" | |
unique_id: shp_circuit_6_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_6_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_6_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_6_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":5,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":5,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":5,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":5,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 7 Mode" | |
unique_id: shp_circuit_7_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_7_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_7_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_7_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":6,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":6,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":6,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":6,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 8 Mode" | |
unique_id: shp_circuit_8_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_8_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_8_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_8_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":7,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":7,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":7,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":7,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 9 Mode" | |
unique_id: shp_circuit_9_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_9_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_9_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_9_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":8,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":8,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":8,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":8,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- name: "SHP Circuit 10 Mode" | |
unique_id: shp_circuit_10_mode | |
state: >- | |
{% if is_state('binary_sensor.shp_circuit_10_auto','on') %}Auto | |
{% else %} | |
{% set i = int(states('sensor.shp_circuit_10_state')) %} | |
{% set o = {0:'Grid',1:'Battery',2:'Off'} %} | |
{{ o[i] if i in o.keys() }} | |
{% endif %} | |
options: "{{ ['Auto','Grid','Battery','Off'] }}" | |
icon: >- | |
{% set i = int(states('sensor.shp_circuit_10_state')) %} | |
{% set o = {0:'mdi:home-lightning-bolt-outline',1:'mdi:home-battery-outline',2:'mdi:home-off-outline'} %} | |
{{ o[i] if i in o.keys() }} | |
select_option: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: >- | |
{% set i = option %} | |
{% set p = '{"from":"HA","id":"' %} | |
{% set s = '","moduleType":0,"operateType":"TCP","params":' %} | |
{% set id = 999900000+(range(10000,99999)|random) %} | |
{% set o = { | |
'Auto':'{"sta":0,"ctrlMode":0,"ch":9,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Grid':'{"sta":0,"ctrlMode":1,"ch":9,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Battery':'{"sta":1,"ctrlMode":1,"ch":9,"cmdSet":11,"id":16},"version":"1.0"}', | |
'Off':'{"sta":2,"ctrlMode":1,"ch":9,"cmdSet":11,"id":16},"version":"1.0"}' | |
} | |
%} | |
{% if i in o.keys() %}{{p}}{{id}}{{s}}{{o[i]}}{% endif %} | |
- number: | |
- name: "SHP - Charge Limit" | |
unique_id: shp_charge_limit | |
state: "{{ states('sensor.shp_battery_charge_level') }}" | |
icon: mdi:battery-arrow-up | |
min: "50" | |
max: "100" | |
step: "1" | |
set_value: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"discLower":{{states("number.shp_discharge_limit")}},"forceChargeHigh":{{value}},"cmdSet":11,"id":29},"version":"1.0"}' | |
- name: "SHP - Discharge Limit" | |
unique_id: shp_discharge_limit | |
state: "{{ states('sensor.shp_battery_discharge_level') }}" | |
icon: mdi:battery-arrow-down-outline | |
min: "0" | |
max: "30" | |
step: "1" | |
set_value: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"discLower":{{value}},"forceChargeHigh":{{states("number.shp_charge_limit")}},"cmdSet":11,"id":29},"version":"1.0"}' | |
mqtt: | |
binary_sensor: | |
- name: SHP Grid Available | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: connectivity | |
payload_on: "1" | |
payload_off: "0" | |
value_template: "{{ value_json.params.gridSta if value_json['params']['id'] == 2 else states('sensor.shp_grid_available') }}" | |
- name: SHP Delta Pro 1 Connected | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: connectivity | |
payload_on: "1" | |
payload_off: "0" | |
value_template: "{{ value_json.params.energyInfos[0].stateBean.isConnect if value_json['params']['id'] == 2 else states('sensor.shp_delta_pro_1_connected') }}" | |
- name: SHP Delta Pro 1 Enabled | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: connectivity | |
payload_on: "1" | |
payload_off: "0" | |
value_template: "{{ value_json.params.energyInfos[0].stateBean.isEnable if value_json['params']['id'] == 2 else states('sensor.shp_delta_pro_1_enabled') }}" | |
- name: SHP Delta Pro 2 Connected | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: connectivity | |
payload_on: "1" | |
payload_off: "0" | |
value_template: "{{ value_json.params.energyInfos[1].stateBean.isConnect if value_json['params']['id'] == 2 else states('sensor.shp_delta_pro_2_connected') }}" | |
- name: SHP Delta Pro 2 Enabled | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: connectivity | |
payload_on: "1" | |
payload_off: "0" | |
value_template: "{{ value_json.params.energyInfos[1].stateBean.isEnable if value_json['params']['id'] == 2 else states('sensor.shp_delta_pro_2_enabled') }}" | |
- name: SHP AC1 Grid Charging | |
object_id: shp_ac1_grid_charging | |
unique_id: shp_ac1_grid_charging | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "1" | |
payload_off: "0" | |
qos: 0 | |
value_template: "{{ value_json.params.energyInfos[0].stateBean.isGridCharge if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP AC2 Grid Charging | |
object_id: shp_ac2_grid_charging | |
unique_id: shp_ac2_grid_charging | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "1" | |
payload_off: "0" | |
qos: 0 | |
value_template: "{{ value_json.params.energyInfos[1].stateBean.isGridCharge if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP EPS Enabled | |
object_id: shp_eps_enabled | |
unique_id: shp_eps_enabled | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "1" | |
payload_off: "0" | |
qos: 0 | |
value_template: "{{ value_json.params.eps if value_json['params']['id'] == 25 else this.state }}" | |
# Mode of the circuit/control | |
- name: SHP Circuit 1 Auto | |
object_id: shp_circuit_1_auto | |
unique_id: shp_circuit_1_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[0].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 2 Auto | |
object_id: shp_circuit_2_auto | |
unique_id: shp_circuit_2_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[1].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 3 Auto | |
object_id: shp_circuit_3_auto | |
unique_id: shp_circuit_3_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[2].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 4 Auto | |
object_id: shp_circuit_4_auto | |
unique_id: shp_circuit_4_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[3].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 5 Auto | |
object_id: shp_circuit_5_auto | |
unique_id: shp_circuit_5_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[4].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 6 Auto | |
object_id: shp_circuit_6_auto | |
unique_id: shp_circuit_6_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[5].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 7 Auto | |
object_id: shp_circuit_7_auto | |
unique_id: shp_circuit_7_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[6].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 8 Auto | |
object_id: shp_circuit_8_auto | |
unique_id: shp_circuit_8_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[7].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 9 Auto | |
object_id: shp_circuit_9_auto | |
unique_id: shp_circuit_9_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[8].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 10 Auto | |
object_id: shp_circuit_10_auto | |
unique_id: shp_circuit_10_auto | |
state_topic: "ecoflow/SHP/data" | |
payload_on: "0" | |
payload_off: "1" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[9].ctrlMode if value_json['params']['id'] == 2 else this.state }}" | |
sensor: | |
# Don't use these in the energy dashboard, irregular spikes cause inaccurate readings. | |
- name: SHP Circuit 1 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[0] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_1_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_1_energy', 'last_reset') }}" | |
- name: SHP Circuit 2 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[1] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_2_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_2_energy', 'last_reset') }}" | |
- name: SHP Circuit 3 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[2] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_3_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_3_energy', 'last_reset') }}" | |
- name: SHP Circuit 4 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[3] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_4_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_4_energy', 'last_reset') }}" | |
- name: SHP Circuit 5 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[4] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_5_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_5_energy', 'last_reset') }}" | |
- name: SHP Circuit 6 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[5] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_6_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_6_energy', 'last_reset') }}" | |
- name: SHP Circuit 7 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[6] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_7_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_7_energy', 'last_reset') }}" | |
- name: SHP Circuit 8 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[7] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_8_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_8_energy', 'last_reset') }}" | |
- name: SHP Circuit 9 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[8] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_9_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_9_energy', 'last_reset') }}" | |
- name: SHP Circuit 10 Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[9] | sum | round(0) if value_json['params']['id'] == 48 else states('sensor.shp_circuit_10_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 48 else state_attr('sensor.shp_circuit_10_energy', 'last_reset') }}" | |
# Smart Home Panel Power Demand | |
- name: SHP Circuit 1 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[0].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_1_power') }}" | |
#force_update: true | |
- name: SHP Circuit 2 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[1].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_2_power') }}" | |
#force_update: true | |
- name: SHP Circuit 3 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[2].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_3_power') }}" | |
#force_update: true | |
- name: SHP Circuit 4 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[3].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_4_power') }}" | |
#force_update: true | |
- name: SHP Circuit 5 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[4].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_5_power') }}" | |
#force_update: true | |
- name: SHP Circuit 6 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[5].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_6_power') }}" | |
#force_update: true | |
- name: SHP Circuit 7 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[6].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_7_power') }}" | |
#force_update: true | |
- name: SHP Circuit 8 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[7].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_8_power') }}" | |
#force_update: true | |
- name: SHP Circuit 9 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[8].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_9_power') }}" | |
#force_update: true | |
- name: SHP Circuit 10 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[9].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_circuit_10_power') }}" | |
#force_update: true | |
- name: SHP Delta Pro 1 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[10].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_delta_pro_1_power') }}" | |
json_attributes_topic: "ecoflow/SHP/data" | |
json_attributes_template: "{{ value_json.params.infoList[10] | tojson if value_json['params']['id'] == 96 else (states.sensor.shp_delta_pro_1_power.attributes | tojson) }}" | |
#force_update: true | |
- name: SHP Delta Pro 2 Power | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: power | |
unit_of_measurement: "W" | |
state_class: measurement | |
value_template: "{{ value_json.params.infoList[11].chWatt | round(0) if value_json['params']['id'] == 96 else states('sensor.shp_delta_pro_2_power') }}" | |
json_attributes_topic: "ecoflow/SHP/data" | |
json_attributes_template: "{{ value_json.params.infoList[11] | tojson if value_json['params']['id'] == 96 else (states.sensor.shp_delta_pro_2_power.attributes | tojson) }}" | |
#force_update: true | |
- name: SHP Circuit 1 State | |
object_id: shp_circuit_1_state | |
unique_id: shp_circuit_1_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[0].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 2 State | |
object_id: shp_circuit_2_state | |
unique_id: shp_circuit_2_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[1].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 3 State | |
object_id: shp_circuit_3_state | |
unique_id: shp_circuit_3_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[2].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 4 State | |
object_id: shp_circuit_4_state | |
unique_id: shp_circuit_4_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[3].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 5 State | |
object_id: shp_circuit_5_state | |
unique_id: shp_circuit_5_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[4].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 6 State | |
object_id: shp_circuit_6_state | |
unique_id: shp_circuit_6_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[5].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 7 State | |
object_id: shp_circuit_7_state | |
unique_id: shp_circuit_7_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[6].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 8 State | |
object_id: shp_circuit_8_state | |
unique_id: shp_circuit_8_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[7].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 9 State | |
object_id: shp_circuit_9_state | |
unique_id: shp_circuit_9_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[8].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP Circuit 10 State | |
object_id: shp_circuit_10_state | |
unique_id: shp_circuit_10_state | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
value_template: "{{ value_json.params.loadCmdChCtrlInfos[9].ctrlSta if value_json['params']['id'] == 2 else this.state }}" | |
- name: SHP AC1 Battery Percentage | |
state_topic: "ecoflow/SHP/data" | |
unique_id: shp_ac1_battery_percentage | |
qos: 0 | |
device_class: battery | |
unit_of_measurement: "%" | |
state_class: measurement | |
value_template: "{{ value_json.params.energyInfos[0].batteryPercentage | round(0) if value_json['params']['id'] == 2 else states('sensor.shp_ac1_battery_percentage') }}" | |
availability: | |
- topic: "ecoflow/SHP/data" | |
payload_available: "1" | |
payload_not_available: "0" | |
value_template: "{{ value_json.params.energyInfos[0].stateBean.isEnable if value_json['params']['id'] == 2 else states('sensor.shp_delta_pro_1_enabled') }}" | |
- name: SHP AC2 Battery Percentage | |
state_topic: "ecoflow/SHP/data" | |
unique_id: shp_ac2_battery_percentage | |
qos: 0 | |
device_class: battery | |
unit_of_measurement: "%" | |
state_class: measurement | |
value_template: "{{ value_json.params.energyInfos[1].batteryPercentage | round(0) if value_json['params']['id'] == 2 else states('sensor.shp_ac2_battery_percentage') }}" | |
availability: | |
- topic: "ecoflow/SHP/data" | |
payload_available: "1" | |
payload_not_available: "0" | |
value_template: "{{ value_json.params.energyInfos[1].stateBean.isEnable if value_json['params']['id'] == 2 else states('sensor.shp_delta_pro_2_enabled') }}" | |
- name: SHP Battery Charge Level | |
object_id: shp_battery_charge_level | |
unique_id: shp_battery_charge_level | |
unit_of_measurement: "%" | |
device_class: battery | |
state_class: measurement | |
state_topic: "ecoflow/SHP/data/limits" | |
qos: 0 | |
value_template: "{{ value_json.params.forceChargeHigh if value_json['params']['id'] == 30 else this.state }}" | |
- name: SHP Battery Discharge Level | |
object_id: shp_battery_discharge_level | |
unique_id: shp_battery_discharge_level | |
unit_of_measurement: "%" | |
device_class: battery | |
state_class: measurement | |
state_topic: "ecoflow/SHP/data/limits" | |
qos: 0 | |
value_template: "{{ value_json.params.discLower if value_json['params']['id'] == 30 else this.state }}" | |
- name: SHP Circuit 1 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[0] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_1_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_1_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 2 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[1] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_2_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_2_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 3 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[2] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_3_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_3_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 4 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[3] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_4_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_4_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 5 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[4] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_5_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_5_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 6 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[5] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_6_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_6_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 7 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[6] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_7_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_7_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 8 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[7] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_8_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_8_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 9 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[8] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_9_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_9_battery_energy', 'last_reset') }}" | |
- name: SHP Circuit 10 Battery Energy | |
state_topic: "ecoflow/SHP/data" | |
qos: 0 | |
device_class: energy | |
unit_of_measurement: "Wh" | |
state_class: total | |
value_template: "{{ value_json.params.watth[9] | sum | round(0) if value_json['params']['id'] == 49 else states('sensor.shp_circuit_10_battery_energy') }}" | |
last_reset_value_template: "{{ (as_timestamp(strptime(value_json.params.rtc, '%Y-%m-%d')) | as_datetime()).isoformat() if value_json['params']['id'] == 49 else state_attr('sensor.shp_circuit_10_battery_energy', 'last_reset') }}" | |
switch: | |
- platform: template | |
switches: | |
shp_eps: | |
friendly_name: "SHP EPS" | |
value_template: "{{ states('binary_sensor.shp_eps_enabled') }}" | |
turn_on: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"cmdSet":11,"id":24,"eps":1},"version":"1.0"}' | |
turn_off: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"cmdSet":11,"id":24,"eps":0},"version":"1.0"}' | |
icon_template: >- | |
{% if is_state('binary_sensor.shp_eps_enabled','on') %} | |
mdi:speedometer | |
{% else %} | |
mdi:speedometer-slow | |
{% endif %} | |
shp_pro1_recharge: | |
friendly_name: "SHP AC1 Recharge" | |
value_template: "{{ states('binary_sensor.shp_ac1_grid_charging') }}" | |
turn_on: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"sta":2,"ctrlMode":1,"ch":10,"cmdSet":11,"id":17},"version":"1.0"}' | |
turn_off: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"sta":0,"ctrlMode":0,"ch":10,"cmdSet":11,"id":17},"version":"1.0"}' | |
icon_template: >- | |
{% if is_state('binary_sensor.shp_ac1_grid_charging','on') %} | |
mdi:battery-charging | |
{% else %} | |
mdi:battery | |
{% endif %} | |
shp_pro2_recharge: | |
friendly_name: "SHP AC2 Recharge" | |
value_template: "{{ states('binary_sensor.shp_ac2_grid_charging') }}" | |
turn_on: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"sta":2,"ctrlMode":1,"ch":11,"cmdSet":11,"id":17},"version":"1.0"}' | |
turn_off: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/set | |
payload: '{"from":"HA","id":"{{999900000+(range(10000,99999)|random)}}","moduleType":0,"operateType":"TCP","params":{"sta":0,"ctrlMode":0,"ch":11,"cmdSet":11,"id":17},"version":"1.0"}' | |
icon_template: >- | |
{% if is_state('binary_sensor.shp_ac2_grid_charging','on') %} | |
mdi:battery-charging | |
{% else %} | |
mdi:battery | |
{% endif %} | |
automation: | |
- id: "EF_SHP_Limits" | |
alias: SHP - Limits | |
description: "Re-Publish SHP Charge/Discharge Limits to new Topic" | |
trigger: | |
- platform: mqtt | |
topic: ecoflow/SHP/data | |
payload: "30" | |
value_template: "{{ value_json.params['id'] }}" | |
condition: [] | |
action: | |
- service: mqtt.publish | |
data: | |
topic: ecoflow/SHP/data/limits | |
payload: "{{trigger.payload}}" | |
retain: true | |
mode: single |
Hi there, no worries. Admittedly the information about how to get this all working is very disjointed but the high level tasks are actually pretty new and have changed in the last few weeks.
The above YAML is actually slightly outdated as a result of those changes, so please see this link instead: https://gist.github.com/lwsrbrts/50d6c8168fab3360e8619ec31aad422a
That contains three files. A PowerShell Script, an example mosquitto.conf
file that you will need to modify and some updated YAML.
- Sign up for a developer account at developer.ecoflow.com. This is now a requirement for access to the data.
- Ensure that MQTT is installed and configured on your home assistant instance. See: https://www.youtube.com/watch?v=dqTn-Gk4Qeo
- If you're using Windows, or even if you're not, you'll need to be able to run the PowerShell script (linked above) to obtain some credentials. This script's purpose is to use your "developer" Access Key and Secret Key from the Ecoflow developer portal to retrieve some signed credentials that you can use in the
mosquitto.conf
file to configure the MQTT broker to connect to Ecoflow's own MQTT server and bring the data generated by your Smart Home Panel back to your MQTT server, which then allows you to use the YAML... but we're getting ahead of ourselves. - Once you have the credentials (
certificateAccount
andcertificatePassword
) you'll need to copy those in to the correct places in your copy of themosquitto.conf
file. Look for anything commented or inside curly braces. You'll also need your SHP serial number. - You need to get the
mosquitto.conf
file over to Home Assistant in the appropriate place, the best way to do that is, in my opinion, by installing theSamba share
add-on. Install the add-on and then configure it with a username and password. - Navigate to \HASS\share, (where HASS is the IP address of your HASS server) log on with the username and password configured for Samba share and then create a new folder called
mosquitto
. Copy your modified version of themosquitto.conf
file in there.
- Back in Home Assistant, configure the Mosquitto add-on by adding this to the Customize section. This is important because it tells Mosquitto to use an additional configuration file located in the
mosquitto
folder:
active: true
folder: mosquitto
9. Save and restart the Mosquitto broker then review the logs to see if you can see any errors. Successful connection and startup should look something like this:
10. Now you could use something like MQTT Explorer (Google it) to connect to your Home Assistant's MQTT server and see whether you're getting data populated in the ecoflow/SHP/data
topic. Don't skip this step or assume it's working cos if there's no data coming in, anything after here will achieve nothing.
11. Once you are sure there is data coming in, you need to edit your Home Assistant configuration.yaml
to add the following. You may want to install the Studio Code Server add-on as this makes things easier. This tells Home Assistant to look in the packages
folder for additional YAML configuration to include during its startup:
homeassistant:
packages: !include_dir_named packages
- At the same level as the
configuration.yaml
file, create a folder calledpackages
. Download and place the yaml (from the link!) in to any file ending in.yaml
inside thepackages
folder. Structure should look as follows:
- Restart Home Assistant and check to see if there are suitably named sensors in Home Assistant from within the Developer Tools section.
FYI, the grid and battery usage data is not included in the data that comes from the MQTT connection. I'm currently putting something together that could be used to get that data from the HTTP API instead.
Amazing!!! thanks for getting back to me and i'll patiently await for an update. I have two DP and 2EB connected to my SHP so would be ace to see it on one place :)
Will have a crack at this tonight :)
I second the amazing - this is just what I was looking for! After a few minor issues I got this all working, seems to be reporting data now. The only thing I just had to guess at was the ecoflow endpoint. I just guessed at api.ecoflow.com instead of api-e.ecoflow.com which seemed to work.
Tried the configuration last night with my very limited knowledge of coding but got as far as starting the updated mosquitto config file and starting the broker but got this error....please help :)
2024-09-08 09:50:15: mosquitto version 2.0.18 starting
2024-09-08 09:50:15: Config loaded from /etc/mosquitto/mosquitto.conf.
2024-09-08 09:50:15: Loading plugin: /usr/share/mosquitto/go-auth.so
2024-09-08 09:50:15: ├── Username/password checking enabled.
2024-09-08 09:50:15: ├── TLS-PSK checking enabled.
2024-09-08 09:50:15: └── Extended authentication not enabled.
2024-09-08 09:50:15: Opening ipv4 listen socket on port 1883.
2024-09-08 09:50:15: Opening ipv6 listen socket on port 1883.
2024-09-08 09:50:15: Opening websockets listen socket on port 1884.
2024-09-08 09:50:15: Connecting bridge ecoflow-bridge (mqtt-e.ecoflow.com:1883)
2024-09-08 09:50:15: mosquitto version 2.0.18 running
2024-09-08 09:50:15: Bad socket read/write on client local.{PIETER-SHP-DATA}: A TLS error occurred.
2024-09-08 09:50:15: New connection from ::1:39272 on port 1883.
2024-09-08 09:50:15: Client disconnected due to protocol error.
This is my config lines.
Connection ecoflow-bridge
address mqtt-e.ecoflow.com; port=8883; protocol=mqtts
remote_username {open-xxxxxxxxxxxxxxxxxxxxx}
remote_password {xxxxxxxxxxxxxxxxxxxxx}
cleansession true
remote_clientid {Pieter-SHP-Data}
try_private true
start_type automatic
restart_timeout 30 180
persistence true
bridge_insecure false
bridge_protocol_version mqttv311
bridge_tls_version tlsv1.2
bridge_cafile /etc/ssl/certs/ca-certificates.crt
topic "" in 0 ecoflow/SHP/data /open/{open-xxxxxxxxxxxxxxxxxxxxx}/{xxxxxxxxxxxxxxxxxxxxx}/quota
topic "" both 0 ecoflow/SHP/set /open/{open-xxxxxxxxxxxxxxxxxxxxx}/{xxxxxxxxxxxxxxxxxxxxx}/set
=============================================================================
I assume you've added the curly braces everywhere? Just confirming but there shouldn't be any curly braces in your mosquitto.conf
file at all.
My use of {token}
shows that as something you'd replace with your own data/info/username/password etc. Replace everything, including the curly brackets.
Thank you very much. I corrected the code but still get this - "Bad socket read/write on client local.PIETER-SHP: A TLS error occurred". This is what I have in the line : remote_clientid PIETER-SHP. Does this need to be in a different format or match any details in HA? Do I need certificate enabled in the MQTT broker configuration settings?
Update: After checking your example code above, I can see that you are connecting bridge over 8883 but my broker is trying to connect over 1883. Could you advise on where I need to update this?
2024-09-09 14:36:22: Connecting bridge ecoflow-bridge (mqtt-e.ecoflow.com:1883)
Sorted: missed the port in the config line!!doh!
Any idea on if i can control AC1 or AC2 charging from HA?
You should have switches declared in your YAML. Don't forget that the YAML above is slightly outdated and you need to refer to the YAML in this gist instead: https://gist.github.com/lwsrbrts/50d6c8168fab3360e8619ec31aad422a
The YAML does declare the switches and mine in my dashboard are derived from that, so it should be OK. May be wise to check your HA logs in Settings > System > Logs and see if you have any errors relating to the switches there.
Cheers @lwsrbrts ! Just me being to hasty and after digging through the entities, I found them. I have an old school grid tied solar setup that's isolated from my Smart home panel setup and DP's. Now i can setup automation to charge the batteries through the ac1&2 ports when my Fronius inverter hits 1000w from the solar setup so in essence indirectly charging the batteries from solar :) Thank you very much for all the help and details provided and for a non developer, I could get this all sorted with some YouTube videos and multiple trial and error nights :)
Hey bud. I've recently embarked the Home Assist journey and am hooked but unfortunately my technical and coding abilities does not stretch further than following instructions. I've been all over the internet trying to get info on getting my SHP1 data and info into HA. I found this piece of art but have absolutely no clue on how to implement this in HA. Any chance you could possibly guide a noob on how to get my SHP in HA? Much appreciated!