01-03-2023, 11:53 PM
Alors pour le QPIGS PV1
Puis le QPIGS PV2
Dans la config.yml de HA :
Pour les jauges c'est sur HACS - frontend - flexible horseshoe
https://github.com/AmoebeLabs/flex-horseshoe-card
Pour la jauge qui ajoute PV1+PV2, il faut créer un template sensor :
pour la puissance cumulée PV1, PV2 et PV totale j'ai créé des utility meter :
Les sensor.consommation ont été créés dans :
paramètres - appareils et services - Entrées - Créer une entrée - intégrale Capteur d'intégrale de Reimann
Amuse toi bien
Code :
[
{
"id": "2ca98cc842fe98dd",
"type": "tab",
"label": "QPIGSPV1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "bb2f093350eaec50",
"type": "inject",
"z": "2ca98cc842fe98dd",
"name": "QPIGSPV1",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "37",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 160,
"wires": [
[
"4eb671e9671bf9b7"
]
]
},
{
"id": "84759e218920555c",
"type": "function",
"z": "2ca98cc842fe98dd",
"name": "TCP Server Adress",
"func": "msg.host = \"192.168.X.XXX\" ;\nmsg.port = \"7777\" ;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 160,
"wires": [
[
"10ebdc89680b12e7",
"98c06370bef5ef18"
]
]
},
{
"id": "10ebdc89680b12e7",
"type": "debug",
"z": "2ca98cc842fe98dd",
"name": "msg",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 690,
"y": 40,
"wires": []
},
{
"id": "98c06370bef5ef18",
"type": "tcp request",
"z": "2ca98cc842fe98dd",
"name": "Onduleur TCIP",
"server": "",
"port": "",
"out": "time",
"ret": "string",
"splitc": "0",
"newline": "",
"trim": false,
"tls": "",
"x": 720,
"y": 160,
"wires": [
[
"7be2375c0d87092b",
"d76a3f354a1061b6"
]
]
},
{
"id": "7be2375c0d87092b",
"type": "debug",
"z": "2ca98cc842fe98dd",
"name": "Onduleur",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 880,
"y": 40,
"wires": []
},
{
"id": "4eb671e9671bf9b7",
"type": "change",
"z": "2ca98cc842fe98dd",
"name": "QPIGS MPPT1",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "[81,80,73,71,83,183,169,13]",
"tot": "bin"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 300,
"y": 160,
"wires": [
[
"84759e218920555c"
]
]
},
{
"id": "dd0269cc9af58291",
"type": "mqtt out",
"z": "2ca98cc842fe98dd",
"name": "MQTT",
"topic": "",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "efc5bdb3115a929b",
"x": 1730,
"y": 40,
"wires": []
},
{
"id": "d76a3f354a1061b6",
"type": "change",
"z": "2ca98cc842fe98dd",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$substringBefore($substringAfter($$.payload, \"(\"),\"��\")",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 940,
"y": 160,
"wires": [
[
"31c2626a7557ccf8"
]
]
},
{
"id": "31c2626a7557ccf8",
"type": "csv",
"z": "2ca98cc842fe98dd",
"name": "",
"sep": " ",
"hdrin": "",
"hdrout": "none",
"multi": "one",
"ret": "\\n",
"temp": "Grid-Voltage,Grid-Frequency,AC-Output-Voltage,AC-Output-Frequency,AC-Output-AppPower,AC-Output-ActivPower,Output-Load-Percent,Bus-Voltage,Battery-Voltage,Battery-Charging-Current,Battery-Capacity,Inverter-Temperature,PV1-Input-Current,PV1-Input-Voltage,Battery-Voltage-SOC,Battery-Discharge-Current,p,q,r,PV1-Charging-Power,t,u,v,w",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 1090,
"y": 160,
"wires": [
[
"33bdcc643ff92f79"
]
]
},
{
"id": "33bdcc643ff92f79",
"type": "split",
"z": "2ca98cc842fe98dd",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 1230,
"y": 160,
"wires": [
[
"5d7d8b5fa42333b4"
]
]
},
{
"id": "5d7d8b5fa42333b4",
"type": "change",
"z": "2ca98cc842fe98dd",
"name": "",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "\"homeassistant/sensor/ElfinEW10/\" & $$.parts.key",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1380,
"y": 160,
"wires": [
[
"2917b89b0a387815",
"dd0269cc9af58291"
]
]
},
{
"id": "2917b89b0a387815",
"type": "debug",
"z": "2ca98cc842fe98dd",
"name": "mqtt node",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1610,
"y": 160,
"wires": []
},
{
"id": "efc5bdb3115a929b",
"type": "mqtt-broker",
"name": "XXXXXXXXX",
"broker": "192.168.X.XXXX",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
Puis le QPIGS PV2
Code :
[
{
"id": "a29a0e1aad8f15cc",
"type": "tab",
"label": "QPIGSPV2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "6317d252fda36dc0",
"type": "tcp request",
"z": "a29a0e1aad8f15cc",
"name": "Onduleur TCIP",
"server": "",
"port": "",
"out": "time",
"ret": "string",
"splitc": "0",
"newline": "",
"trim": false,
"tls": "",
"x": 720,
"y": 160,
"wires": [
[
"7cb907b69c901a01"
]
]
},
{
"id": "8ea6404b0fc57451",
"type": "function",
"z": "a29a0e1aad8f15cc",
"name": "TCP Server Adress",
"func": "msg.host = \"192.168.X.XXX\" ;\nmsg.port = \"7777\" ;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 490,
"y": 160,
"wires": [
[
"6317d252fda36dc0"
]
]
},
{
"id": "347e71af1076ee06",
"type": "change",
"z": "a29a0e1aad8f15cc",
"name": "QPIGS MPPT2",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "[81,80,73,71,83,50,104,45,13]",
"tot": "bin"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 280,
"y": 160,
"wires": [
[
"8ea6404b0fc57451"
]
]
},
{
"id": "dc6a06cd516c1b20",
"type": "inject",
"z": "a29a0e1aad8f15cc",
"name": "QPIGSPV2",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "35",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 110,
"y": 160,
"wires": [
[
"347e71af1076ee06"
]
]
},
{
"id": "7cb907b69c901a01",
"type": "change",
"z": "a29a0e1aad8f15cc",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$substringBefore($substringAfter($$.payload, \"(\"),\"��\")",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 960,
"y": 160,
"wires": [
[
"72dd916b368614b9"
]
]
},
{
"id": "72dd916b368614b9",
"type": "csv",
"z": "a29a0e1aad8f15cc",
"name": "",
"sep": " ",
"hdrin": "",
"hdrout": "none",
"multi": "one",
"ret": "\\n",
"temp": "PV2-Input-Current, PV2-Input-Voltage,PV2-Charging-Power",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 1110,
"y": 160,
"wires": [
[
"5e3aeabd48ec2d5f"
]
]
},
{
"id": "5e3aeabd48ec2d5f",
"type": "split",
"z": "a29a0e1aad8f15cc",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 1250,
"y": 160,
"wires": [
[
"98ce508698d9f0bb"
]
]
},
{
"id": "98ce508698d9f0bb",
"type": "change",
"z": "a29a0e1aad8f15cc",
"name": "",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "\"homeassistant/sensor/ElfinEW10/\" & $$.parts.key",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1400,
"y": 160,
"wires": [
[
"c4b0d4b4ddb136af",
"d7537940938cd039"
]
]
},
{
"id": "d7537940938cd039",
"type": "mqtt out",
"z": "a29a0e1aad8f15cc",
"name": "MQTT",
"topic": "",
"qos": "0",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "efc5bdb3115a929b",
"x": 1750,
"y": 40,
"wires": []
},
{
"id": "c4b0d4b4ddb136af",
"type": "debug",
"z": "a29a0e1aad8f15cc",
"name": "mqtt node",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1630,
"y": 160,
"wires": []
},
{
"id": "efc5bdb3115a929b",
"type": "mqtt-broker",
"name": "XXXXX",
"broker": "192.168.X.XXXX",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthRetain": "false",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closeRetain": "false",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willRetain": "false",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
}
]
Dans la config.yml de HA :
Code :
mqtt:
sensor:
- name: "Grid-Voltage"
state_topic: "homeassistant/sensor/ElfinEW10/Grid-Voltage"
unit_of_measurement: "V"
device_class: voltage
#value_template: '{{ payload }}'
- name: "Inverter-Temperature"
state_topic: "homeassistant/sensor/ElfinEW10/Inverter-Temperature"
unit_of_measurement: "°C"
device_class: temperature
#value_template: '{{ payload }}'
- name: "AC-Output-AppPower"
state_topic: "homeassistant/sensor/ElfinEW10/AC-Output-AppPower"
unit_of_measurement: "VA"
device_class: apparent_power
#value_template: '{{ payload }}'
- name: "Output-Load-Percent"
state_topic: "homeassistant/sensor/ElfinEW10/Output-Load-Percent"
unit_of_measurement: "%"
device_class: battery
#value_template: '{{ payload }}'
- name: "PV1-Input-Current"
state_topic: "homeassistant/sensor/ElfinEW10/PV1-Input-Current"
unit_of_measurement: "A"
device_class: current
#value_template: '{{ payload }}'
- name: "PV2-Input-Current"
state_topic: "homeassistant/sensor/ElfinEW10/PV2-Input-Current"
unit_of_measurement: "A"
device_class: current
#value_template: '{{ payload }}'
- name: "PV2-Input-Voltage"
state_topic: "homeassistant/sensor/ElfinEW10/PV2-Input-Voltage"
unit_of_measurement: "V"
device_class: voltage
#value_template: '{{ payload }}'
- name: "PV2-Charging-Power"
state_topic: "homeassistant/sensor/ElfinEW10/PV2-Charging-Power"
unit_of_measurement: "W"
device_class: power
#value_template: '{{ payload }}'
Pour les jauges c'est sur HACS - frontend - flexible horseshoe
https://github.com/AmoebeLabs/flex-horseshoe-card
Pour la jauge qui ajoute PV1+PV2, il faut créer un template sensor :
Code :
template:
- sensor:
#################################################
##### Onduleur ####
#################################################
- name: "PV Puissance Totale"
unit_of_measurement: "W"
device_class: power
state: >
{{ [ states('sensor.pv2_charging_power'),
states('sensor.onduleur_pv_watt') ]
| map('float') | sum }}
availability: >
{{ not 'unavailable' in
[ states('sensor.pv2_charging_power'),
states('sensor.onduleur_pv_watt') ] }}
pour la puissance cumulée PV1, PV2 et PV totale j'ai créé des utility meter :
Code :
utility_meter:
energie_jour_pv1:
source: sensor.consommation_pv1
cycle: daily
energie_mois_pv1:
source: sensor.consommation_pv1
cycle: monthly
energie_annuelle_pv1:
source: sensor.consommation_pv1
cycle: yearly
energie_jour_pv2:
source: sensor.consommation_pv2
cycle: daily
energie_mois_pv2:
source: sensor.consommation_pv2
cycle: monthly
energie_annuelle_pv2:
source: sensor.consommation_pv2
cycle: yearly
energie_jour_pvtotal:
source: sensor.consommation_pv_totale
cycle: daily
energie_mois_pvtotal:
source: sensor.consommation_pv_totale
cycle: monthly
energie_annuelle_pvtotal:
source: sensor.consommation_pv_totale
cycle: yearly
Les sensor.consommation ont été créés dans :
paramètres - appareils et services - Entrées - Créer une entrée - intégrale Capteur d'intégrale de Reimann
Amuse toi bien