As both entities are at msg.data.new_state.state
and your logic is or
as in either of these will turn on /off. No need to join the messages.
This could just be as simple as the example below.
strike that I just saw the and in the lower statement.
Here is an updated version using a join. It uses the msg.payload.data.entity_id
to join the messages. In the example they are sensor.t81_ac_b_watts
and sensor.t81_drier_b_watts
, they may need editing to your entity_id's in the function node.
[{"id":"e2b74283.5c6e2","type":"inject","z":"9b3f9f31.c45298","name":"Dryer 1","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":{\"entity_id\":\"sensor.t81_drier_b_watts\",\"old_state\":{\"entity_id\":\"sensor.t81_drier_b_watts\",\"state\":null,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 Drier B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:27:46.134297+00:00\",\"last_updated\":\"2021-05-06T03:27:46.134297+00:00\",\"context\":{\"id\":\"c7b7478527321dd3d9a5fda8fa6f42a4\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"unavailable\"},\"new_state\":{\"entity_id\":\"sensor.t81_drier_b_watts\",\"state\":1,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 Drier B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:27:47.104005+00:00\",\"last_updated\":\"2021-05-06T03:27:47.104005+00:00\",\"context\":{\"id\":\"2cb5aabcdc80736d22d35bbc7d8c4e2c\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"1\",\"timeSinceChangedMs\":9}},\"_msgid\":\"cc606cbb.5e02f\"}","payloadType":"json","x":100,"y":2200,"wires":[["ad8b58bf.9c7da"]]},{"id":"ad8b58bf.9c7da","type":"join","z":"9b3f9f31.c45298","name":"","mode":"custom","build":"object","property":"payload.data","propertyType":"msg","key":"payload.data.entity_id","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":350,"y":2220,"wires":[["20c3429c.6a62d6"]]},{"id":"20c3429c.6a62d6","type":"function","z":"9b3f9f31.c45298","name":"","func":"if(msg.payload.data[\"sensor.t81_ac_b_watts\"].new_state.state >= 1000 || msg.payload.data[\"sensor.t81_drier_b_watts\"].new_state.state >= 1000) {\n return {topic: \"solar_engaged\", payload: 1000};\n}else if(msg.payload.data[\"sensor.t81_ac_b_watts\"].new_state.state < 1000 && msg.payload.data[\"sensor.t81_drier_b_watts\"].new_state.state < 1000){\n return {topic: \"solar_disengaged\", payload: 0}; \n}else {\n return {topic: \"solar_disengaged\", payload: 0};\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":510,"y":2220,"wires":[["6a027541.bca3a4"]]},{"id":"afa9e146.e614c8","type":"inject","z":"9b3f9f31.c45298","name":"Dryer 1001","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":{\"entity_id\":\"sensor.t81_drier_b_watts\",\"old_state\":{\"entity_id\":\"sensor.t81_drier_b_watts\",\"state\":null,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 Drier B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:27:46.134297+00:00\",\"last_updated\":\"2021-05-06T03:27:46.134297+00:00\",\"context\":{\"id\":\"c7b7478527321dd3d9a5fda8fa6f42a4\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"unavailable\"},\"new_state\":{\"entity_id\":\"sensor.t81_drier_b_watts\",\"state\":1001,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 Drier B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:27:47.104005+00:00\",\"last_updated\":\"2021-05-06T03:27:47.104005+00:00\",\"context\":{\"id\":\"2cb5aabcdc80736d22d35bbc7d8c4e2c\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"1\",\"timeSinceChangedMs\":9}},\"_msgid\":\"cc606cbb.5e02f\"}","payloadType":"json","x":110,"y":2240,"wires":[["ad8b58bf.9c7da"]]},{"id":"28bb699a.8b6166","type":"inject","z":"9b3f9f31.c45298","name":"AC 1","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":{\"entity_id\":\"sensor.t81_ac_b_watts\",\"old_state\":{\"entity_id\":\"sensor.t81_ac_b_watts\",\"state\":0,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 AC B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:35:59.022534+00:00\",\"last_updated\":\"2021-05-06T03:35:59.022534+00:00\",\"context\":{\"id\":\"efd26752a3ee6018693141c9f16641fd\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"0\"},\"new_state\":{\"entity_id\":\"sensor.t81_ac_b_watts\",\"state\":null,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 AC B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:38:28.497425+00:00\",\"last_updated\":\"2021-05-06T03:38:28.497425+00:00\",\"context\":{\"id\":\"9a8ec78c5914768f665d63c82dc63b34\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"unavailable\",\"timeSinceChangedMs\":89}},\"_msgid\":\"d49ce331.88412\"}","payloadType":"json","x":110,"y":2280,"wires":[["ad8b58bf.9c7da"]]},{"id":"699aeb2f.caa14c","type":"inject","z":"9b3f9f31.c45298","name":"AC 1001","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":{\"entity_id\":\"sensor.t81_ac_b_watts\",\"old_state\":{\"entity_id\":\"sensor.t81_ac_b_watts\",\"state\":0,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 AC B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:35:59.022534+00:00\",\"last_updated\":\"2021-05-06T03:35:59.022534+00:00\",\"context\":{\"id\":\"efd26752a3ee6018693141c9f16641fd\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"0\"},\"new_state\":{\"entity_id\":\"sensor.t81_ac_b_watts\",\"state\":1001,\"attributes\":{\"unit_of_measurement\":\"W\",\"friendly_name\":\"T81 AC B Watts\",\"icon\":\"mdi:flash-circle\"},\"last_changed\":\"2021-05-06T03:38:28.497425+00:00\",\"last_updated\":\"2021-05-06T03:38:28.497425+00:00\",\"context\":{\"id\":\"9a8ec78c5914768f665d63c82dc63b34\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"unavailable\",\"timeSinceChangedMs\":89}},\"_msgid\":\"d49ce331.88412\"}","payloadType":"json","x":100,"y":2320,"wires":[["ad8b58bf.9c7da"]]},{"id":"6a027541.bca3a4","type":"switch","z":"9b3f9f31.c45298","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"1000","vt":"str"},{"t":"lt","v":"1000","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":660,"y":2220,"wires":[["97a432a4.3efc48"],["97a432a4.3efc48"]]},{"id":"97a432a4.3efc48","type":"debug","z":"9b3f9f31.c45298","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":650,"y":2160,"wires":[]}]