Node-Red efficience electrique

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
    }
]

Salut,

Comparer 2 valeurs si elles ne proviennent pas de la même source à la même fréquence ca va donner effectivement pas mal de pics et d’inconsistances.

Je conseillerais de revoir un peu la logique, des flux avec 2 points de départ c’est toujours chiant à gérer.
Pourquoi pas uniquement suive le changement d’état d’une des 2 valeurs et de lire la suivante dans un noeud « current state » juste après. Comme ça tu n’as plus à dupliquer les logiques.

Bonjour, c’est effectivement ce que j’ai fait et finalement le résultat est là.
Merci @AlexHass

Voila le résultat. Il ne me reste plus qu’à intégrer les heures creuse.

image

[
    {
        "id": "e79aca76d27d0bea",
        "type": "group",
        "z": "817328624afeff83",
        "name": "Efficience energetique",
        "style": {
            "fill": "#bfbfbf",
            "fill-opacity": "0.92",
            "label": true,
            "color": "#000000"
        },
        "nodes": [
            "dd1468d249c5165e",
            "ff63bb5bfdd527a2",
            "94d81f6beb9e4c09",
            "28e52ccfb394b790",
            "60e3e76e2b6d4db6",
            "1528defc8675b728",
            "ba6669e7890d1d55",
            "67ed367df6e6f568",
            "4240bc3f5bcf2b82",
            "7f2ab11f3ec788ad",
            "d0edc491ad61425a",
            "f872114a8a49926f",
            "13180193f803d160",
            "01ad2931770da9bb",
            "7afcb939df38b6f6",
            "b624c5a4df7503c1",
            "6de2a2c4f8343310",
            "93db7cf5b1c375c1",
            "4c3f0439165b2d6f",
            "bf10457478eeba7b",
            "b6942beb80770e53",
            "845eb1b3d0a68f4c",
            "9dcf48353a60af08",
            "3b87ab1a34bf761c",
            "f48a6b9cee7ddf3c",
            "b891f46d5f6f4f82",
            "6991f51f966fe4d3",
            "450576b9628a911a",
            "063ed7f2e137096a",
            "3be956564e5f35ba",
            "aaa4959c7b58d85f",
            "0e25e9deda485ea6",
            "ec4be22578c542f5",
            "85ab6f25d07152d5"
        ],
        "x": 34,
        "y": 39,
        "w": 1732,
        "h": 942
    },
    {
        "id": "dd1468d249c5165e",
        "type": "switch",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "",
        "property": "Conso_Inst",
        "propertyType": "msg",
        "rules": [
            {
                "t": "lt",
                "v": "301",
                "vt": "num"
            },
            {
                "t": "btwn",
                "v": "301",
                "vt": "num",
                "v2": "600",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "601",
                "vt": "num",
                "v2": "900",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "901",
                "vt": "num",
                "v2": "1200",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "1201",
                "vt": "num",
                "v2": "1500",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "1501",
                "vt": "num",
                "v2": "1800",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "1801",
                "vt": "num",
                "v2": "2100",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "2101",
                "vt": "num",
                "v2": "2400",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "2401",
                "vt": "num",
                "v2": "2700",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "2701",
                "vt": "num",
                "v2": "3000",
                "v2t": "num"
            },
            {
                "t": "gt",
                "v": "3000",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 11,
        "x": 470,
        "y": 280,
        "wires": [
            [
                "94d81f6beb9e4c09"
            ],
            [
                "28e52ccfb394b790"
            ],
            [
                "60e3e76e2b6d4db6"
            ],
            [
                "1528defc8675b728"
            ],
            [
                "ba6669e7890d1d55"
            ],
            [
                "67ed367df6e6f568"
            ],
            [
                "4240bc3f5bcf2b82"
            ],
            [
                "7f2ab11f3ec788ad"
            ],
            [
                "d0edc491ad61425a"
            ],
            [
                "f872114a8a49926f"
            ],
            [
                "13180193f803d160"
            ]
        ]
    },
    {
        "id": "ff63bb5bfdd527a2",
        "type": "switch",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "",
        "property": "Prod-Inst",
        "propertyType": "msg",
        "rules": [
            {
                "t": "lt",
                "v": "250",
                "vt": "num"
            },
            {
                "t": "btwn",
                "v": "251",
                "vt": "num",
                "v2": "500",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "501",
                "vt": "num",
                "v2": "750",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "751",
                "vt": "num",
                "v2": "1000",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "1001",
                "vt": "num",
                "v2": "1250",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "1251",
                "vt": "num",
                "v2": "1500",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "1501",
                "vt": "num",
                "v2": "1750",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "1751",
                "vt": "num",
                "v2": "2000",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "2001",
                "vt": "num",
                "v2": "2250",
                "v2t": "num"
            },
            {
                "t": "btwn",
                "v": "2251",
                "vt": "num",
                "v2": "2500",
                "v2t": "num"
            },
            {
                "t": "gt",
                "v": "2500",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 11,
        "x": 470,
        "y": 740,
        "wires": [
            [
                "01ad2931770da9bb"
            ],
            [
                "7afcb939df38b6f6"
            ],
            [
                "b624c5a4df7503c1"
            ],
            [
                "6de2a2c4f8343310"
            ],
            [
                "93db7cf5b1c375c1"
            ],
            [
                "4c3f0439165b2d6f"
            ],
            [
                "bf10457478eeba7b"
            ],
            [
                "b6942beb80770e53"
            ],
            [
                "845eb1b3d0a68f4c"
            ],
            [
                "9dcf48353a60af08"
            ],
            [
                "3b87ab1a34bf761c"
            ]
        ]
    },
    {
        "id": "94d81f6beb9e4c09",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": ">301w 100%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "100",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 80,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "28e52ccfb394b790",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "310-600w 90%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "90",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 120,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "60e3e76e2b6d4db6",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "601-900w 80%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "80",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 160,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "1528defc8675b728",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "901-1200w 70%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "70",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 200,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "ba6669e7890d1d55",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "1201-1500w 60%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "60",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 240,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "67ed367df6e6f568",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "1501-1800w 50%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "50",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 280,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "4240bc3f5bcf2b82",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "1801-2100w 40%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "40",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 320,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "7f2ab11f3ec788ad",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "2101-2400w 30%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "30",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 360,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "d0edc491ad61425a",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "2401-2700w 20%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "20",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 400,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "f872114a8a49926f",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "2701-3000w 10%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "10",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 440,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "13180193f803d160",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": ">3000w 00%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 480,
        "wires": [
            [
                "f48a6b9cee7ddf3c",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "01ad2931770da9bb",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "< 250w 00%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 710,
        "y": 540,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "7afcb939df38b6f6",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "250-500w 10%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "10",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 580,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "b624c5a4df7503c1",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "501-750w 20%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "20",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 620,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "6de2a2c4f8343310",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "751-1000w 30%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "30",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 660,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "93db7cf5b1c375c1",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "10011250w 40%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "40",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 700,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "4c3f0439165b2d6f",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "1251-1500w 50%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "50",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 740,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "bf10457478eeba7b",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "1501-1750w 60%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "60",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 780,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "b6942beb80770e53",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "1751-2000w 70%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "70",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 820,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "845eb1b3d0a68f4c",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "2001-2250w 80%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "80",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 860,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "9dcf48353a60af08",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "2251-2500w 90%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "90",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 900,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "3b87ab1a34bf761c",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": ">2500w 100%",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "100",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 940,
        "wires": [
            [
                "b891f46d5f6f4f82",
                "6991f51f966fe4d3"
            ]
        ]
    },
    {
        "id": "f48a6b9cee7ddf3c",
        "type": "debug",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "% Conso-Inst",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1290,
        "y": 280,
        "wires": []
    },
    {
        "id": "b891f46d5f6f4f82",
        "type": "debug",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "% Prod-Inst",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1290,
        "y": 720,
        "wires": []
    },
    {
        "id": "6991f51f966fe4d3",
        "type": "join",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "effi%",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 1160,
        "y": 520,
        "wires": [
            [
                "063ed7f2e137096a"
            ]
        ]
    },
    {
        "id": "450576b9628a911a",
        "type": "debug",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "Eficience en %",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1640,
        "y": 440,
        "wires": []
    },
    {
        "id": "063ed7f2e137096a",
        "type": "change",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "$sum(payload)",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "($sum(payload)) / 2",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1380,
        "y": 520,
        "wires": [
            [
                "450576b9628a911a",
                "85ab6f25d07152d5"
            ]
        ]
    },
    {
        "id": "3be956564e5f35ba",
        "type": "server-state-changed",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "Conso-inst",
        "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": "str",
        "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": "Conso_Inst",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "Conso_Inst",
                "valueType": "num"
            }
        ],
        "x": 120,
        "y": 500,
        "wires": [
            [
                "dd1468d249c5165e",
                "aaa4959c7b58d85f",
                "ec4be22578c542f5"
            ]
        ]
    },
    {
        "id": "aaa4959c7b58d85f",
        "type": "api-current-state",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "Prod-Inst",
        "server": "9bf5a907952a79de",
        "version": 3,
        "outputs": 1,
        "halt_if": "",
        "halt_if_type": "num",
        "halt_if_compare": "is",
        "entity_id": "sensor.envoy_122132004662_current_power_production",
        "state_type": "num",
        "blockInputOverrides": false,
        "outputProperties": [
            {
                "property": "Prod-Inst",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "Prod-Inst",
                "valueType": "num"
            }
        ],
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "override_topic": false,
        "state_location": "payload",
        "override_payload": "msg",
        "entity_location": "data",
        "override_data": "msg",
        "x": 280,
        "y": 540,
        "wires": [
            [
                "ff63bb5bfdd527a2",
                "0e25e9deda485ea6"
            ]
        ]
    },
    {
        "id": "0e25e9deda485ea6",
        "type": "debug",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "Prod-Inst reel",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "Prod-Inst",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 460,
        "y": 540,
        "wires": []
    },
    {
        "id": "ec4be22578c542f5",
        "type": "debug",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "Conso-Inst reel",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "Conso_Inst",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 460,
        "y": 500,
        "wires": []
    },
    {
        "id": "85ab6f25d07152d5",
        "type": "api-call-service",
        "z": "817328624afeff83",
        "g": "e79aca76d27d0bea",
        "name": "RetourEfficience",
        "server": "9bf5a907952a79de",
        "version": 5,
        "debugenabled": false,
        "domain": "input_number",
        "service": "set_value",
        "areaId": [],
        "deviceId": [],
        "entityId": [
            "input_number.efficience_energetique"
        ],
        "data": "{\"value\": msg.payload}",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1650,
        "y": 520,
        "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
    }
]