Here’s the code:
[
{
"id": "d193075c3ba4cccf",
"type": "server-state-changed",
"z": "e00a823001e5e9f9",
"name": "Target Temp",
"server": "e3697f1929e4c1bf",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "input_number.temperature_target",
"entityidfiltertype": "exact",
"outputinitially": true,
"state_type": "num",
"haltifstate": "",
"halt_if_type": "str",
"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": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 110,
"y": 160,
"wires": [
[
"556b7e25434f8d4f"
]
]
},
{
"id": "60fe48034f9b2e83",
"type": "server-state-changed",
"z": "e00a823001e5e9f9",
"name": "Temp Tolerance",
"server": "e3697f1929e4c1bf",
"version": 4,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "input_number.temperature_tolerance",
"entityidfiltertype": "exact",
"outputinitially": true,
"state_type": "num",
"haltifstate": "",
"halt_if_type": "str",
"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": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 120,
"y": 240,
"wires": [
[
"556b7e25434f8d4f"
]
]
},
{
"id": "556b7e25434f8d4f",
"type": "join",
"z": "e00a823001e5e9f9",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": true,
"timeout": "",
"count": "3",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 370,
"y": 240,
"wires": [
[
"110be969afc910cd"
]
]
},
{
"id": "c453f97017829253",
"type": "api-call-service",
"z": "e00a823001e5e9f9",
"name": "",
"server": "e3697f1929e4c1bf",
"version": 5,
"debugenabled": false,
"domain": "switch",
"service": "turn_on",
"areaId": [],
"deviceId": [
"0e3827579840bed5a93e24b9505e88d7"
],
"entityId": [
"switch.solar_fan_socket_socket_1"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 880,
"y": 160,
"wires": [
[
"f67201bd53744e76"
]
]
},
{
"id": "712cf00532ebc528",
"type": "api-call-service",
"z": "e00a823001e5e9f9",
"name": "",
"server": "e3697f1929e4c1bf",
"version": 5,
"debugenabled": false,
"domain": "switch",
"service": "turn_off",
"areaId": [],
"deviceId": [
"0e3827579840bed5a93e24b9505e88d7"
],
"entityId": [
"switch.solar_fan_socket_socket_1"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 880,
"y": 320,
"wires": [
[
"f67201bd53744e76"
]
]
},
{
"id": "f67201bd53744e76",
"type": "debug",
"z": "e00a823001e5e9f9",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 950,
"y": 500,
"wires": []
},
{
"id": "110be969afc910cd",
"type": "function",
"z": "e00a823001e5e9f9",
"name": "function 1",
"func": "if (msg.payload[\"sensor.solis_inverter_temperature\"] > (msg.payload[\"input_number.temperature_target\"] + msg.payload[\"input_number.temperature_tolerance\"])){\n return [msg, null];\n}\nelse if (msg.payload[\"sensor.solis_inverter_temperature\"] < (msg.payload[\"input_number.temperature_target\"] - msg.payload[\"input_number.temperature_tolerance\"])) {\n return [null, msg];\n}",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 520,
"y": 240,
"wires": [
[
"7a2b909d93c2c705"
],
[
"88b19814b1c8035b"
]
]
},
{
"id": "7a2b909d93c2c705",
"type": "api-current-state",
"z": "e00a823001e5e9f9",
"name": "Switch State",
"server": "e3697f1929e4c1bf",
"version": 3,
"outputs": 2,
"halt_if": "off",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "switch.solar_fan_socket_socket_1",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"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": 670,
"y": 200,
"wires": [
[
"c453f97017829253"
],
[]
]
},
{
"id": "88b19814b1c8035b",
"type": "api-current-state",
"z": "e00a823001e5e9f9",
"name": "Switch State",
"server": "e3697f1929e4c1bf",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "switch.solar_fan_socket_socket_1",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"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": 670,
"y": 280,
"wires": [
[
"712cf00532ebc528"
],
[]
]
},
{
"id": "3c2a25f34f18e577",
"type": "server-state-changed",
"z": "e00a823001e5e9f9",
"name": "Solis Internal Temperature",
"server": "e3697f1929e4c1bf",
"version": 4,
"exposeToHomeAssistant": true,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.solis_inverter_temperature",
"entityidfiltertype": "exact",
"outputinitially": true,
"state_type": "str",
"haltifstate": "",
"halt_if_type": "str",
"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": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 150,
"y": 320,
"wires": [
[
"556b7e25434f8d4f",
"f67201bd53744e76"
]
]
},
{
"id": "e3697f1929e4c1bf",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": true,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": true
}
]`Preformatted text`