# Nest Thermostat - how to split two objects

**URL:** <https://discourse.nodered.org/t/nest-thermostat-how-to-split-two-objects/11553>\
**Category:** General\
**Created:** [26 May 2019 10:06 UTC](https://discourse.nodered.org/t/nest-thermostat-how-to-split-two-objects/11553 "2019-05-26T10:06:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [26 May 2019 10:06 UTC](https://discourse.nodered.org/t/nest-thermostat-how-to-split-two-objects/11553/1 "2019-05-26T10:06:26Z")

</div>

Hi

I have two Nest Thermostat (Hallway and Conservatory) which are both reported back together via the Nest node, and while I can split them into two payload messages (sent one after the other), I can’t seem to then switch them out to be processed individually ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5d9b8ed27a759c5d90201fae9db31c97a57f3271.jpeg)

Original payload is this (not sure if I should share those identifiers?)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6ab8a4225a74ab66629a939542308256a46b299b.jpeg)

The SPLIT node then creates these two objects, sent in quick succession

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6bd7a5e1c763e3460d6214c073bfb2c1f832783a.jpeg)

I’d like to to use the SWITCH node to switch them out, so I can process them separately, but I’m not sure of the best way?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/53161f808039ca2f888bdc2f6c32e175d4f2e9e8.jpeg)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 May 2019 10:09 UTC](https://discourse.nodered.org/t/nest-thermostat-how-to-split-two-objects/11553/2 "2019-05-26T10:09:58Z")

</div>

If you set the split to set property to be key value - eg topic  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cfb1da81eaa5ac6ca54380af5f8201c5f6fb5989.png)

then set debug to look at complete msg not just payload. The msg.topic will then be what you need to do the switch

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [26 May 2019 22:03 UTC](https://discourse.nodered.org/t/nest-thermostat-how-to-split-two-objects/11553/3 "2019-05-26T22:03:29Z")

</div>

Hi @dceejay

Thanks for helping, I’ve done as you suggested, plus I’ve also set the property to msg.topic within the switch, but I cant see msg.topic appearing anywhere ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4a48984c0775628f4c0ab6c68f3a6ff9c9df058a.jpeg)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 May 2019 22:36 UTC](https://discourse.nodered.org/t/nest-thermostat-how-to-split-two-objects/11553/4 "2019-05-26T22:36:41Z")

</div>

once it's in the topic (from the split) then it should now just be a string - so the contains just needs to check a string type - not msg.

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [26 May 2019 23:29 UTC](https://discourse.nodered.org/t/nest-thermostat-how-to-split-two-objects/11553/5 "2019-05-26T23:29:03Z")

</div>

Damn I had tried string before - but changed it !!

Many thanks - just when I think I’m getting the hang of it - something I thought was straight forward catches me out !! 🤪
