Bonjour,
Voila, je vous présente le contexte.
J’ai une installation photovoltaïque enphase, et je souhaite réaliser (la forme n’est pas encore arrêtée) un objet connecté style un cube sur lequel, 3 led (là aussi, rien d’arrêté) pour avoir d’un coup d’œil l’efficience énergétique à l’instant « t » ce qui permettrai de guider les utilisateurs pour utiliser des appareils énergivore sans faire de pic de consommation. Je sais que cela fonctionne au moment et que bien entendu, une fois ce consommateur en fonction, l’efficience sera mauvaise voir négative. Mais il faut bien commencer par quelque chose.
Pour le moment je ne suis pas bien avancé, je relève la puissance apparente soutirée sur le réseau, la production instantanée. et là déjà un bug: Les node state.
Ici, le but est de comparer 2 valeurs. Malheureusement, elles n’arrivent pas en même temps et surtout la nuit, je n’ai pas de production. Si il n’y avait que la journée, je ferais un hold. mais la nuit, c’est 0 que je dois avoir.
Je donne le code. Si quelqu’un à une idée, je vous remercie, Nico
[
{
"id": "447d35f376f14e06",
"type": "group",
"z": "817328624afeff83",
"style": {
"stroke": "#999999",
"stroke-opacity": "1",
"fill": "none",
"fill-opacity": "1",
"label": true,
"label-position": "nw",
"color": "#a4a4a4"
},
"nodes": [
"921746cb7fb0dd74",
"f35547ea16b96c26",
"7031d1583fe46950",
"f43423ca919ac7d7",
"a560ba5f9e3b4ebe",
"f7a40989bad7cdf3",
"858c27c6bb47e083",
"f64e14de8fa1b778",
"67855fd337d2286b",
"32b8a7a56985957e",
"bde68dbdccec9634",
"75ac4e26ea7a39d0",
"aca052c9da7bbe7a",
"9bd0337d80c3bff3"
],
"x": 474,
"y": 1819,
"w": 1152,
"h": 302
},
{
"id": "921746cb7fb0dd74",
"type": "server-state-changed",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "Prod-inst",
"server": "9bf5a907952a79de",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.envoy_122132004662_current_power_production",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "num",
"haltifstate": "",
"halt_if_type": "num",
"halt_if_compare": "is",
"outputs": 1,
"output_only_on_state_change": false,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "Prod_Inst",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "Prod_Inst",
"valueType": "num"
}
],
"x": 560,
"y": 2020,
"wires": [
[
"32b8a7a56985957e",
"67855fd337d2286b",
"9bd0337d80c3bff3"
]
]
},
{
"id": "f35547ea16b96c26",
"type": "switch",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "nnull"
},
{
"t": "null"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1090,
"y": 1920,
"wires": [
[
"f7a40989bad7cdf3"
],
[
"f43423ca919ac7d7"
]
]
},
{
"id": "7031d1583fe46950",
"type": "switch",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "null"
},
{
"t": "nnull"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1090,
"y": 2020,
"wires": [
[
"a560ba5f9e3b4ebe"
],
[
"858c27c6bb47e083"
]
]
},
{
"id": "f43423ca919ac7d7",
"type": "change",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 1940,
"wires": [
[
"f7a40989bad7cdf3"
]
]
},
{
"id": "a560ba5f9e3b4ebe",
"type": "change",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 2000,
"wires": [
[
"858c27c6bb47e083"
]
]
},
{
"id": "f7a40989bad7cdf3",
"type": "debug",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "Conso_Inst",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1510,
"y": 1860,
"wires": []
},
{
"id": "858c27c6bb47e083",
"type": "debug",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "Prod_Inst",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1500,
"y": 2080,
"wires": []
},
{
"id": "f64e14de8fa1b778",
"type": "server-state-changed",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "Enedis PAPP",
"server": "9bf5a907952a79de",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.lixee_zlinky_tic_apparent_power",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "num",
"haltifstate": "",
"halt_if_type": "num",
"halt_if_compare": "is",
"outputs": 1,
"output_only_on_state_change": true,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "Conso_Inst",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "topic",
"propertyType": "msg",
"value": "Conso_Inst",
"valueType": "num"
}
],
"x": 570,
"y": 1920,
"wires": [
[
"67855fd337d2286b",
"32b8a7a56985957e",
"aca052c9da7bbe7a"
]
]
},
{
"id": "67855fd337d2286b",
"type": "function",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "function 1",
"func": "msg.payload = msg.Conso_Inst\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 830,
"y": 1920,
"wires": [
[
"f35547ea16b96c26",
"bde68dbdccec9634"
]
]
},
{
"id": "32b8a7a56985957e",
"type": "function",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "function 2",
"func": "msg.payload = msg.Prod_Inst\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 830,
"y": 2020,
"wires": [
[
"7031d1583fe46950",
"75ac4e26ea7a39d0"
]
]
},
{
"id": "bde68dbdccec9634",
"type": "debug",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "debug 54",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 1860,
"wires": []
},
{
"id": "75ac4e26ea7a39d0",
"type": "debug",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "debug 55",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1010,
"y": 2080,
"wires": []
},
{
"id": "aca052c9da7bbe7a",
"type": "debug",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "debug 56",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "Conso_Inst",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 1860,
"wires": []
},
{
"id": "9bd0337d80c3bff3",
"type": "debug",
"z": "817328624afeff83",
"g": "447d35f376f14e06",
"name": "debug 57",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "Prod_Inst",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 2080,
"wires": []
},
{
"id": "9bf5a907952a79de",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": false
}
]