# Switch Nodes,, MQTT and Strings

**URL:** https://discourse.nodered.org/t/switch-nodes-mqtt-and-strings/62666
**Category:** General
**Created:** [16 May 2022 02:23 UTC](https://discourse.nodered.org/t/switch-nodes-mqtt-and-strings/62666 "2022-05-16T02:23:26Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [16 May 2022 02:23 UTC](https://discourse.nodered.org/t/switch-nodes-mqtt-and-strings/62666/1 "2022-05-16T02:23:26Z")

</div>

Guys,

I have an MQTT message coming in that contains temperature information - this is being sent across from Home Assistant to me.

It is showing in the debug window as a String of 4 characters (e.g. 23.4) and hence does not appear to get processed by my switch node which is looking to make decisions based on numbers - is it as easy as telling the switch node to treat it as a string (and will this produce the same results when doing comparisons such as \> or \< etc ?)

Craig

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [16 May 2022 06:52 UTC](https://discourse.nodered.org/t/switch-nodes-mqtt-and-strings/62666/2 "2022-05-16T06:52:22Z")

</div>

changing the incoming MQTT node to treat it as an Object instead of an auto sensed string etc did the trick

Now the payload has a number in it not a string

Craig
