Node will not work

Hello,

i ve here a node which will not work.

Target: Value of (1) > 4 then switch (2) my devices (3) and (4) on…
but nothing happens

[
    {
        "id": "1e52fae11f98d038",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a7eb65255d3cbeeb",
        "type": "comment",
        "z": "1e52fae11f98d038",
        "name": "Solar >4 -> SFA-Pumpe und WP an",
        "info": "",
        "x": 280,
        "y": 200,
        "wires": []
    },
    {
        "id": "df9fe8716d57acfe",
        "type": "api-call-service",
        "z": "1e52fae11f98d038",
        "name": "Pumpe An",
        "server": "259ff3e1.05aa4c",
        "version": 5,
        "debugenabled": false,
        "domain": "switch",
        "service": "turn_on",
        "areaId": [],
        "deviceId": [
            "cd8e65f5f13e4ec636ccd7b537317dad"
        ],
        "entityId": [
            "switch.pool_pumpe"
        ],
        "data": "",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1050,
        "y": 220,
        "wires": [
            []
        ]
    },
    {
        "id": "bb4cbb29334601fc",
        "type": "api-call-service",
        "z": "1e52fae11f98d038",
        "name": "WP heat",
        "server": "259ff3e1.05aa4c",
        "version": 5,
        "debugenabled": true,
        "domain": "climate",
        "service": "set_hvac_mode",
        "areaId": [],
        "deviceId": [
            "279d7b1626e4e2e857548c7a159deb0d"
        ],
        "entityId": [
            "climate.34eae7f5ad56"
        ],
        "data": "{\"hvac_mode\": \"heat\"}",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 1040,
        "y": 320,
        "wires": [
            []
        ]
    },
    {
        "id": "1d4f76236d5251c3",
        "type": "delay",
        "z": "1e52fae11f98d038",
        "name": "",
        "pauseType": "delay",
        "timeout": "15",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 830,
        "y": 320,
        "wires": [
            [
                "bb4cbb29334601fc"
            ]
        ]
    },
    {
        "id": "1a285f1eb0c2b965",
        "type": "server-state-changed",
        "z": "1e52fae11f98d038",
        "name": "PV > 4KW",
        "server": "259ff3e1.05aa4c",
        "version": 5,
        "outputs": 2,
        "exposeAsEntityConfig": "",
        "entityId": "sensor.solar_aktuell",
        "entityIdType": "exact",
        "outputInitially": false,
        "stateType": "num",
        "ifState": "4",
        "ifStateType": "num",
        "ifStateOperator": "gt",
        "outputOnlyOnStateChange": true,
        "for": "30",
        "forType": "num",
        "forUnits": "seconds",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": false,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 200,
        "y": 240,
        "wires": [
            [
                "520aa8846286d6d8"
            ],
            []
        ]
    },
    {
        "id": "520aa8846286d6d8",
        "type": "switch",
        "z": "1e52fae11f98d038",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "on",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "off",
                "vt": "str"
            },
            {
                "t": "jsonata_exp",
                "v": "{\"hvac_mode\": \"heat\"}",
                "vt": "jsonata"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 3,
        "x": 590,
        "y": 240,
        "wires": [
            [
                "df9fe8716d57acfe"
            ],
            [],
            [
                "1d4f76236d5251c3"
            ]
        ]
    },
    {
        "id": "259ff3e1.05aa4c",
        "type": "server",
        "name": "Home Assistant",
        "addon": true
    }
]

Your switch is expecting the output from the value check to be “on”, but it looks like it may be the PV value instead (e.g. 8.238). You could add a Debug node check this.

ok output is the value.

what can i do to get the right output?

image

Your third image is the switch.
Change it from string to numeric and larger than or smaller than.

will not work… terrible

image

In the first node, you’re only sending through the value when it’s greater than 4, but then in the switch you’re only checking for less than 4. They can never both be true, and so nothing will happen.

There are several ways to solve this, but one is just remove the “If State” values in #1. So that it always passes through the value whenever it changes. Then in your switch, you can have checks to handle both “< 4” and “> 4”.

To better help, what is it you are trying to do? Are you just wanting to switch devices 3 and 4 on and off depending on whether the value of PV is > 4?

My Target is:

Is the Value from (1) over 4 then
→ Switch Device 3 to ON
→ Wait 15seconds
→ Switch Device 4 to ON

Device 3 ON : on
Device 4 ON: {“hvac_mode”: “heat”}

Remove the values that is incorrect to start with.
You can’t have it compare a numeric value to string. Things will not work when you do that.

For that logic, I think you should be able to remove the switch altogether
image