added datasheets
This commit is contained in:
442
SmartEVSE-3/integrations/home-assistant/HASS-Node-RED.json
Normal file
442
SmartEVSE-3/integrations/home-assistant/HASS-Node-RED.json
Normal file
@@ -0,0 +1,442 @@
|
||||
[
|
||||
{
|
||||
"id": "fa7895a2ccea5b3f",
|
||||
"type": "tab",
|
||||
"label": "SerKri - EVSE",
|
||||
"disabled": false,
|
||||
"info": "",
|
||||
"env": []
|
||||
},
|
||||
{
|
||||
"id": "17800a49b47fa026",
|
||||
"type": "inject",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"props": [
|
||||
{
|
||||
"p": "payload"
|
||||
},
|
||||
{
|
||||
"p": "topic",
|
||||
"vt": "str"
|
||||
}
|
||||
],
|
||||
"repeat": "5",
|
||||
"crontab": "",
|
||||
"once": false,
|
||||
"onceDelay": "5",
|
||||
"topic": "",
|
||||
"payload": "",
|
||||
"payloadType": "date",
|
||||
"x": 330,
|
||||
"y": 200,
|
||||
"wires": [
|
||||
[
|
||||
"ff1480dbbb7f18c7"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "ff1480dbbb7f18c7",
|
||||
"type": "link call",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"links": [
|
||||
"5862ce2c075744ed"
|
||||
],
|
||||
"timeout": "30",
|
||||
"x": 610,
|
||||
"y": 200,
|
||||
"wires": [
|
||||
[
|
||||
"784e625f0910483a"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "a69e33209285ace0",
|
||||
"type": "function",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "EVSE - Home Battery Charge Calculation",
|
||||
"func": "let battery_charge = msg.battery_charge.state;\nlet battery_charge_last_update = new Date(msg.battery_charge.last_updated);\nlet battery_level = msg.battery_level;\nlet voltage = msg.voltage < 100 ? 230 : msg.voltage;\nlet battery_reserve = msg.battery_reserve * 10;\n\nlet current = new Date();\nlet interval = new Date(current.getTime() - (24 * 3600000));\n\nlet battery_ampere = Math.round(battery_charge / voltage * 10);\nmsg.battery_ampere_original=battery_ampere;\n\nif(battery_charge_last_update.getTime() >= interval.getTime() && battery_level < 100) {\n if(battery_ampere <= battery_reserve) {\n battery_ampere = Math.round( (battery_ampere - battery_reserve) * 0.2);\n } else if (battery_ampere > battery_reserve) {\n battery_ampere -= battery_reserve;\n }\n} else {\n battery_ampere = 0;\n}\n\nmsg.battery_charge = battery_charge;\nmsg.last_update = battery_charge_last_update;\n\nmsg.battery_ampere=battery_ampere;\n\nreturn msg;\n",
|
||||
"outputs": 1,
|
||||
"noerr": 0,
|
||||
"initialize": "",
|
||||
"finalize": "",
|
||||
"libs": [],
|
||||
"x": 480,
|
||||
"y": 320,
|
||||
"wires": [
|
||||
[
|
||||
"1533b6b07d285c0f"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "d6cf6a7d5b14cbf7",
|
||||
"type": "link in",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "EVSE - Home Battery Charge Calculation",
|
||||
"links": [],
|
||||
"x": 255,
|
||||
"y": 320,
|
||||
"wires": [
|
||||
[
|
||||
"a69e33209285ace0"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "c3b957aecca6b782",
|
||||
"type": "comment",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "CALCULATION",
|
||||
"info": "",
|
||||
"x": 320,
|
||||
"y": 270,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "1533b6b07d285c0f",
|
||||
"type": "link out",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"mode": "return",
|
||||
"links": [],
|
||||
"x": 725,
|
||||
"y": 320,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "784e625f0910483a",
|
||||
"type": "link call",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"links": [
|
||||
"d6cf6a7d5b14cbf7"
|
||||
],
|
||||
"timeout": "30",
|
||||
"x": 990,
|
||||
"y": 200,
|
||||
"wires": [
|
||||
[
|
||||
"950b5b90f76bc7d4"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "950b5b90f76bc7d4",
|
||||
"type": "link call",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"links": [
|
||||
"09aa17af8f2e1275"
|
||||
],
|
||||
"timeout": "30",
|
||||
"x": 1350,
|
||||
"y": 200,
|
||||
"wires": [
|
||||
[]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "c2cb7755cbd71b6a",
|
||||
"type": "comment",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "SCHEDULE",
|
||||
"info": "",
|
||||
"x": 310,
|
||||
"y": 140,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "d615e1479edfb12a",
|
||||
"type": "api-current-state",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "Battery Charge/Discharge",
|
||||
"server": "ce8f7f94.ea5ce",
|
||||
"version": 3,
|
||||
"outputs": 1,
|
||||
"halt_if": "",
|
||||
"halt_if_type": "str",
|
||||
"halt_if_compare": "is",
|
||||
"entity_id": "sensor.storage_charge_discharge_power_bt21a0492804",
|
||||
"state_type": "str",
|
||||
"blockInputOverrides": false,
|
||||
"outputProperties": [
|
||||
{
|
||||
"property": "battery_charge",
|
||||
"propertyType": "msg",
|
||||
"value": "",
|
||||
"valueType": "entity"
|
||||
}
|
||||
],
|
||||
"for": "0",
|
||||
"forType": "num",
|
||||
"forUnits": "minutes",
|
||||
"override_topic": false,
|
||||
"state_location": "payload",
|
||||
"override_payload": "msg",
|
||||
"entity_location": "data",
|
||||
"override_data": "msg",
|
||||
"x": 440,
|
||||
"y": 690,
|
||||
"wires": [
|
||||
[
|
||||
"e54b4429805d53aa"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "e54b4429805d53aa",
|
||||
"type": "api-current-state",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "Battery Level",
|
||||
"server": "ce8f7f94.ea5ce",
|
||||
"version": 3,
|
||||
"outputs": 1,
|
||||
"halt_if": "",
|
||||
"halt_if_type": "str",
|
||||
"halt_if_compare": "is",
|
||||
"entity_id": "sensor.solar_battery_level",
|
||||
"state_type": "str",
|
||||
"blockInputOverrides": false,
|
||||
"outputProperties": [
|
||||
{
|
||||
"property": "battery_level",
|
||||
"propertyType": "msg",
|
||||
"value": "",
|
||||
"valueType": "entityState"
|
||||
}
|
||||
],
|
||||
"for": "0",
|
||||
"forType": "num",
|
||||
"forUnits": "minutes",
|
||||
"override_topic": false,
|
||||
"state_location": "payload",
|
||||
"override_payload": "msg",
|
||||
"entity_location": "data",
|
||||
"override_data": "msg",
|
||||
"x": 680,
|
||||
"y": 690,
|
||||
"wires": [
|
||||
[
|
||||
"29cae9661c1b2f0b"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "5862ce2c075744ed",
|
||||
"type": "link in",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "EVSE - Fetch Home Battery Data",
|
||||
"links": [],
|
||||
"x": 255,
|
||||
"y": 690,
|
||||
"wires": [
|
||||
[
|
||||
"d615e1479edfb12a"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fa6dced73a152860",
|
||||
"type": "link out",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"mode": "return",
|
||||
"links": [],
|
||||
"x": 1235,
|
||||
"y": 690,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "29cae9661c1b2f0b",
|
||||
"type": "api-current-state",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "Voltage",
|
||||
"server": "ce8f7f94.ea5ce",
|
||||
"version": 3,
|
||||
"outputs": 1,
|
||||
"halt_if": "",
|
||||
"halt_if_type": "str",
|
||||
"halt_if_compare": "is",
|
||||
"entity_id": "sensor.energy_voltage",
|
||||
"state_type": "str",
|
||||
"blockInputOverrides": false,
|
||||
"outputProperties": [
|
||||
{
|
||||
"property": "voltage",
|
||||
"propertyType": "msg",
|
||||
"value": "",
|
||||
"valueType": "entityState"
|
||||
}
|
||||
],
|
||||
"for": "0",
|
||||
"forType": "num",
|
||||
"forUnits": "minutes",
|
||||
"override_topic": false,
|
||||
"state_location": "payload",
|
||||
"override_payload": "msg",
|
||||
"entity_location": "data",
|
||||
"override_data": "msg",
|
||||
"x": 880,
|
||||
"y": 690,
|
||||
"wires": [
|
||||
[
|
||||
"fdd19243ac817d7a"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fdd19243ac817d7a",
|
||||
"type": "api-current-state",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "Battery Reserve",
|
||||
"server": "ce8f7f94.ea5ce",
|
||||
"version": 3,
|
||||
"outputs": 1,
|
||||
"halt_if": "",
|
||||
"halt_if_type": "str",
|
||||
"halt_if_compare": "is",
|
||||
"entity_id": "input_number.home_battery_reserve",
|
||||
"state_type": "str",
|
||||
"blockInputOverrides": false,
|
||||
"outputProperties": [
|
||||
{
|
||||
"property": "battery_reserve",
|
||||
"propertyType": "msg",
|
||||
"value": "",
|
||||
"valueType": "entityState"
|
||||
}
|
||||
],
|
||||
"for": "0",
|
||||
"forType": "num",
|
||||
"forUnits": "minutes",
|
||||
"override_topic": false,
|
||||
"state_location": "payload",
|
||||
"override_payload": "msg",
|
||||
"entity_location": "data",
|
||||
"override_data": "msg",
|
||||
"x": 1080,
|
||||
"y": 690,
|
||||
"wires": [
|
||||
[
|
||||
"fa6dced73a152860"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "09aa17af8f2e1275",
|
||||
"type": "link in",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "EVSE - Set Home Battery Current",
|
||||
"links": [],
|
||||
"x": 255,
|
||||
"y": 530,
|
||||
"wires": [
|
||||
[
|
||||
"572d40e8e7d6b40d"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1f23fc18269f9a1d",
|
||||
"type": "link out",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"mode": "return",
|
||||
"links": [],
|
||||
"x": 565,
|
||||
"y": 530,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "572d40e8e7d6b40d",
|
||||
"type": "http request",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "",
|
||||
"method": "POST",
|
||||
"ret": "obj",
|
||||
"paytoqs": "ignore",
|
||||
"url": "http://10.0.0.1/currents?battery_current={{battery_ampere}}",
|
||||
"tls": "",
|
||||
"persist": false,
|
||||
"proxy": "",
|
||||
"authType": "",
|
||||
"senderr": true,
|
||||
"credentials": {
|
||||
"user": "",
|
||||
"password": ""
|
||||
},
|
||||
"x": 420,
|
||||
"y": 530,
|
||||
"wires": [
|
||||
[
|
||||
"1f23fc18269f9a1d"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "99331fbb5748fc53",
|
||||
"type": "inject",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "Set Battery Current",
|
||||
"props": [
|
||||
{
|
||||
"p": "payload"
|
||||
},
|
||||
{
|
||||
"p": "topic",
|
||||
"vt": "str"
|
||||
}
|
||||
],
|
||||
"repeat": "",
|
||||
"crontab": "",
|
||||
"once": false,
|
||||
"onceDelay": 0.1,
|
||||
"topic": "",
|
||||
"payload": "",
|
||||
"payloadType": "date",
|
||||
"x": 210,
|
||||
"y": 470,
|
||||
"wires": [
|
||||
[
|
||||
"572d40e8e7d6b40d"
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1278c4ccd68616de",
|
||||
"type": "comment",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "CALL EVSE",
|
||||
"info": "",
|
||||
"x": 310,
|
||||
"y": 420,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "1944f244e90c43ef",
|
||||
"type": "comment",
|
||||
"z": "fa7895a2ccea5b3f",
|
||||
"name": "FETCH DATA FOR CALCULATION",
|
||||
"info": "",
|
||||
"x": 380,
|
||||
"y": 640,
|
||||
"wires": []
|
||||
},
|
||||
{
|
||||
"id": "ce8f7f94.ea5ce",
|
||||
"type": "server",
|
||||
"name": "Home Assistant",
|
||||
"version": 2,
|
||||
"addon": true,
|
||||
"rejectUnauthorizedCerts": true,
|
||||
"ha_boolean": "y|yes|true|on|home|open",
|
||||
"connectionDelay": true,
|
||||
"cacheJson": true,
|
||||
"heartbeat": false,
|
||||
"heartbeatInterval": 30
|
||||
}
|
||||
]
|
||||
148
SmartEVSE-3/integrations/home-assistant/configuration.yaml
Normal file
148
SmartEVSE-3/integrations/home-assistant/configuration.yaml
Normal file
@@ -0,0 +1,148 @@
|
||||
#lines to integrate SmartEVSE with HASS through native rest-API; no NodeRed or MQTT needed.
|
||||
#adapt lines 6,145,146 to the url or ip-address of your SmartEVSE
|
||||
#NOTE: this .yaml is deprecated; it is easier to use the HACS integration, just search for smartevse or look at https://github.com/dingo35/ha-SmartEVSEv3
|
||||
|
||||
sensor:
|
||||
- platform: rest
|
||||
resource: http://SmartEVSE-xxxxx.lan/settings
|
||||
name: smartevse
|
||||
scan_interval: 300
|
||||
timeout: 20
|
||||
json_attributes:
|
||||
- mode
|
||||
# - mode_id
|
||||
- car_connected
|
||||
- evse
|
||||
- settings
|
||||
- ev_meter
|
||||
- mains_meter
|
||||
- phase_currents
|
||||
value_template: "OK"
|
||||
|
||||
template:
|
||||
sensor:
|
||||
- name: "smartevse_mode"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'mode') }}
|
||||
- name: "smartevse_car_connected"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'car_connected') }}
|
||||
- name: "smartevse_temp"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'evse')['temp'] }}
|
||||
device_class: temperature
|
||||
unit_of_measurement: "°C"
|
||||
# - name: "smartevse_connected"
|
||||
# state: >-
|
||||
# {{ state_attr('sensor.smartevse', 'evse')['connected'] }}
|
||||
- name: "smartevse_access"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'evse')['access'] }}
|
||||
# - name: "smartevse_mode2"
|
||||
# state: >-
|
||||
# {{ state_attr('sensor.smartevse', 'evse')['mode'] }}
|
||||
# - name: "smartevse_charge_timer"
|
||||
# state: >-
|
||||
# {{ state_attr('sensor.smartevse', 'evse')['charge_timer'] }}
|
||||
- name: "smartevse_solar_stop_timer"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'evse')['solar_stop_timer'] }}
|
||||
- name: "smartevse_state"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'evse')['state'] }}
|
||||
# - name: "smartevse_state_id"
|
||||
# state: >-
|
||||
# {{ state_attr('sensor.smartevse', 'evse')['state_id'] }}
|
||||
# - name: "smartevse_error"
|
||||
# state: >-
|
||||
# {{ state_attr('sensor.smartevse', 'evse')['error'] }}
|
||||
- name: "smartevse_error_id"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'evse')['error_id'] }}
|
||||
- name: "smartevse_charge_current"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['charge_current'] / 10 }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_override_current"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['override_current'] }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_current_min"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['current_min'] }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_current_max"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['current_max'] }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_current_main"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['current_main'] }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_solar_max_import"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['solar_max_import'] }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_solar_start_current"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['solar_start_current'] }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_solar_stop_time"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'settings')['solar_stop_time'] }}
|
||||
- name: "smartevse_ev_import_active_energy"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'ev_meter')['import_active_energy'] }}
|
||||
unit_of_measurement: "kWh"
|
||||
device_class: energy
|
||||
state_class: total
|
||||
- name: "smartevse_mains_import_active_energy"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'mains_meter')['import_active_energy'] }}
|
||||
unit_of_measurement: "kWh"
|
||||
device_class: energy
|
||||
state_class: total
|
||||
- name: "smartevse_mains_export_active_energy"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'mains_meter')['export_active_energy'] }}
|
||||
unit_of_measurement: "kWh"
|
||||
device_class: energy
|
||||
state_class: total
|
||||
- name: "smartevse_total"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'phase_currents')['TOTAL'] / 10 }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_l1"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'phase_currents')['L1'] / 10 }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_l2"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'phase_currents')['L2'] / 10 }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_l3"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'phase_currents')['L3'] / 10 }}
|
||||
unit_of_measurement: "A"
|
||||
device_class: current
|
||||
- name: "smartevse_last_data_update"
|
||||
state: >-
|
||||
{{ state_attr('sensor.smartevse', 'phase_currents')['last_data_update'] | timestamp_custom ('%Y/%m/%d %H:%M:%S') }}
|
||||
|
||||
switch:
|
||||
- platform: command_line
|
||||
switches:
|
||||
smartevse_mode_switch:
|
||||
command_on: "curl -s -X POST http://SmartEVSE-xxxxx.lan/settings?mode=3 -H 'accept: application/json' -H 'Content-Type: application/json' -d '{}'"
|
||||
command_off: "curl -s -X POST http://SmartEVSE-xxxxx.lan/settings?mode=0 -H 'accept: application/json' -H 'Content-Type: application/json' -d '{}'"
|
||||
value_template: '{{value_json.mode_id == "3"}}'
|
||||
@@ -0,0 +1,164 @@
|
||||
substitutions:
|
||||
device_name: et-sm01
|
||||
human_devicename: DSMR
|
||||
device_description: "espthings.io ET-SM01 DIY P1 module to read your smart meter"
|
||||
pcb_version: "220818-01"
|
||||
url: "http://espthings.io/sm01"
|
||||
|
||||
esphome:
|
||||
name: ${device_name}
|
||||
comment: "${device_description} ${pcb_version}"
|
||||
platform: ESP8266
|
||||
esp8266_restore_from_flash: true
|
||||
board: d1_mini
|
||||
name_add_mac_suffix: false
|
||||
project:
|
||||
name: "espthings.io-ET-SM01"
|
||||
version: "${pcb_version}"
|
||||
|
||||
wifi:
|
||||
networks:
|
||||
- ssid: !secret esphome_wifi_ssid
|
||||
password: !secret esphome_wifi_password
|
||||
|
||||
logger:
|
||||
baud_rate: 0
|
||||
|
||||
api:
|
||||
encryption:
|
||||
key: !secret esphome_api_key
|
||||
|
||||
ota:
|
||||
password: !secret esphome_ota_password
|
||||
|
||||
web_server:
|
||||
port: 80
|
||||
|
||||
uart:
|
||||
baud_rate: 115200
|
||||
rx_pin: D7
|
||||
|
||||
http_request:
|
||||
useragent: esphome/device
|
||||
timeout: 1s
|
||||
|
||||
dsmr:
|
||||
id: dsmr_instance
|
||||
|
||||
sensor:
|
||||
- platform: dsmr
|
||||
energy_delivered_tariff1:
|
||||
name: "$human_devicename - Energy Consumed Tariff 1"
|
||||
state_class: total_increasing
|
||||
energy_delivered_tariff2:
|
||||
name: "$human_devicename - Energy Consumed Tariff 2"
|
||||
state_class: total_increasing
|
||||
energy_returned_tariff1:
|
||||
name: "$human_devicename - Energy Produced Tariff 1"
|
||||
state_class: total_increasing
|
||||
energy_returned_tariff2:
|
||||
name: "$human_devicename - Energy Produced Tariff 2"
|
||||
state_class: total_increasing
|
||||
power_delivered:
|
||||
name: "$human_devicename - Power Consumed"
|
||||
accuracy_decimals: 3
|
||||
power_returned:
|
||||
name: "$human_devicename - Power Produced"
|
||||
accuracy_decimals: 3
|
||||
electricity_failures:
|
||||
name: "$human_devicename - Electricity Failures"
|
||||
icon: mdi:alert
|
||||
electricity_long_failures:
|
||||
name: "$human_devicename - Long Electricity Failures"
|
||||
icon: mdi:alert
|
||||
voltage_l1:
|
||||
name: "$human_devicename - Voltage Phase 1"
|
||||
voltage_l2:
|
||||
name: "$human_devicename - Voltage Phase 2"
|
||||
voltage_l3:
|
||||
name: "$human_devicename - Voltage Phase 3"
|
||||
current_l1:
|
||||
name: "$human_devicename - Current Phase 1"
|
||||
id: currentl1
|
||||
current_l2:
|
||||
name: "$human_devicename - Current Phase 2"
|
||||
id: currentl2
|
||||
current_l3:
|
||||
name: "$human_devicename - Current Phase 3"
|
||||
id: currentl3
|
||||
power_delivered_l1:
|
||||
name: "$human_devicename - Power Consumed Phase 1"
|
||||
accuracy_decimals: 3
|
||||
power_delivered_l2:
|
||||
name: "$human_devicename - Power Consumed Phase 2"
|
||||
accuracy_decimals: 3
|
||||
power_delivered_l3:
|
||||
name: "$human_devicename - Power Consumed Phase 3"
|
||||
accuracy_decimals: 3
|
||||
power_returned_l1:
|
||||
name: "$human_devicename - Power Produced Phase 1"
|
||||
accuracy_decimals: 3
|
||||
id: returnedl1
|
||||
power_returned_l2:
|
||||
name: "$human_devicename - Power Produced Phase 2"
|
||||
accuracy_decimals: 3
|
||||
id: returnedl2
|
||||
power_returned_l3:
|
||||
name: "$human_devicename - Power Produced Phase 3"
|
||||
accuracy_decimals: 3
|
||||
id: returnedl3
|
||||
gas_delivered:
|
||||
name: "$human_devicename - Gas Consumed"
|
||||
state_class: total_increasing
|
||||
gas_delivered_be:
|
||||
name: "$human_devicename - Gas Consumed Belgium"
|
||||
state_class: total_increasing
|
||||
- platform: uptime
|
||||
name: "$human_devicename - Uptime"
|
||||
- platform: wifi_signal
|
||||
name: "$human_devicename - Wi-Fi Signal"
|
||||
update_interval: 60s
|
||||
|
||||
text_sensor:
|
||||
- platform: dsmr
|
||||
identification:
|
||||
name: "$human_devicename - Identification"
|
||||
p1_version:
|
||||
name: "$human_devicename - Version"
|
||||
p1_version_be:
|
||||
name: "$human_devicename - Version Belgium"
|
||||
electricity_tariff:
|
||||
name: "$human_devicename - Tarief"
|
||||
- platform: wifi_info
|
||||
ip_address:
|
||||
name: "$human_devicename - IP Address"
|
||||
ssid:
|
||||
name: "$human_devicename - Wi-Fi SSID"
|
||||
bssid:
|
||||
name: "$human_devicename - Wi-Fi BSSID"
|
||||
- platform: version
|
||||
name: "$human_devicename - ESPHome Version"
|
||||
hide_timestamp: true
|
||||
|
||||
switch:
|
||||
- platform: restart
|
||||
name: "$human_devicename - Restart"
|
||||
|
||||
interval:
|
||||
- interval: 5sec
|
||||
then:
|
||||
- http_request.post:
|
||||
url: !lambda |-
|
||||
std::string url;
|
||||
|
||||
float l1 = id(returnedl1).state > 0 ? - id(currentl1).state : id(currentl1).state;
|
||||
float l2 = id(returnedl2).state > 0 ? - id(currentl2).state : id(currentl2).state;
|
||||
float l3 = id(returnedl3).state > 0 ? - id(currentl3).state : id(currentl3).state;
|
||||
|
||||
url.append("http://192.168.207.121/currents?L1=");
|
||||
url.append(to_string(l1*10));
|
||||
url.append("&L2=");
|
||||
url.append(to_string(l2*10));
|
||||
url.append("&L3=");
|
||||
url.append(to_string(l3*10));
|
||||
return url.c_str();
|
||||
@@ -0,0 +1,44 @@
|
||||
###### Content below should go in automations.yaml
|
||||
###### DO NOT COPY THESE INTO CONFIGURATION.YAML - create the automations in the UI then paste the code below in YAML mode
|
||||
|
||||
alias: .EVSE set MQTT MainsMeter from HA
|
||||
description: ""
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- sensor.meter_active_power_l1
|
||||
for:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 1
|
||||
action:
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
topic: SmartEVSE-XXXXX/Set/MainsMeter
|
||||
payload: |-
|
||||
{{
|
||||
((states('sensor.meter_active_power_l1')|float / states('sensor.on_grid_l1_voltage')|float ) * (-1) * 10 ) | round(0)
|
||||
}}:{{
|
||||
((states('sensor.meter_active_power_l2')|float / states('sensor.on_grid_l2_voltage')|float ) * (-1) * 10 ) | round(0)
|
||||
}}:{{
|
||||
((states('sensor.meter_active_power_l3')|float / states('sensor.on_grid_l3_voltage')|float ) * (-1) * 10 ) | round(0)
|
||||
}}
|
||||
|
||||
## --------------------------------------------------------------
|
||||
|
||||
alias: .EVSE set MQTT HomeBatteryCurrent from HA
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- sensor.battery_current
|
||||
for:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 1
|
||||
action:
|
||||
- service: mqtt.publish
|
||||
data_template:
|
||||
topic: SmartEVSE-XXXXX/Set/HomeBatteryCurrent
|
||||
payload: "{{ (states('sensor.battery_current') | float * 10 * (-1)) | int }}"
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
- id: 'xxxxxxxxxxxxxx'
|
||||
alias: P1toSmartevse
|
||||
description: ''
|
||||
trigger:
|
||||
- platform: time_pattern
|
||||
seconds: /1
|
||||
condition: []
|
||||
action:
|
||||
- service: shell_command.dsmrtosmartevse
|
||||
data: {}
|
||||
mode: single
|
||||
@@ -0,0 +1,38 @@
|
||||
#Data naar SMARTEVSe
|
||||
shell_command:
|
||||
dsmrtosmartevse: 'curl -X POST "http://192.168.x.x/currents?L1={{ states("sensor.nettocurrent_l1") | float*10 }}&L2={{ states("sensor.nettocurrent_l2") | float*10 }}&L3={{ states("sensor.nettocurrent_l3") | float*10 }}" -H "accept: application/json" -H "Content-Type: application/json" -d {}'
|
||||
|
||||
template:
|
||||
- sensor:
|
||||
- name: "nettocurrent_l1"
|
||||
unit_of_measurement: A
|
||||
device_class: current
|
||||
state: >
|
||||
{% set solarl1 = states('sensor.electricity_meter_power_production_phase_l1') | float(0) %}
|
||||
{% set currentl1 = states('sensor.electricity_meter_current_phase_l1') | float(0) %}
|
||||
{{ currentl1 * -1 if solarl1 > 0 else currentl1 }}
|
||||
availability: >
|
||||
{{ states('sensor.electricity_meter_power_production_phase_l1') | is_number and
|
||||
states('sensor.electricity_meter_current_phase_l1') | is_number }}
|
||||
- sensor:
|
||||
- name: "nettocurrent_l2"
|
||||
unit_of_measurement: A
|
||||
device_class: current
|
||||
state: >
|
||||
{% set solarl2 = states('sensor.electricity_meter_power_production_phase_l2') | float(0) %}
|
||||
{% set currentl2 = states('sensor.electricity_meter_current_phase_l2') | float(0) %}
|
||||
{{ currentl2 * -1 if solarl2 > 0 else currentl2 }}
|
||||
availability: >
|
||||
{{ states('sensor.electricity_meter_power_production_phase_l2') | is_number and
|
||||
states('sensor.electricity_meter_current_phase_l2') | is_number }}
|
||||
- sensor:
|
||||
- name: "nettocurrent_l3"
|
||||
unit_of_measurement: A
|
||||
device_class: current
|
||||
state: >
|
||||
{% set solarl3 = states('sensor.electricity_meter_power_production_phase_l3') | float(0) %}
|
||||
{% set currentl3 = states('sensor.electricity_meter_current_phase_l3') | float(0) %}
|
||||
{{ currentl3 * -1 if solarl3 > 0 else currentl3 }}
|
||||
availability: >
|
||||
{{ states('sensor.electricity_meter_power_production_phase_l3') | is_number and
|
||||
states('sensor.electricity_meter_current_phase_l3') | is_number }}
|
||||
Reference in New Issue
Block a user