# Mustache notation not working in Call Service Node

**URL:** <https://discourse.nodered.org/t/mustache-notation-not-working-in-call-service-node/20206>\
**Category:** General\
**Created:** [12 January 2020 00:29 UTC](https://discourse.nodered.org/t/mustache-notation-not-working-in-call-service-node/20206 "2020-01-12T00:29:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nineclicks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nineclicks/32/16084_2.png) [@nineclicks](https://discourse.nodered.org/u/nineclicks)\
**Post date:** [12 January 2020 00:29 UTC](https://discourse.nodered.org/t/mustache-notation-not-working-in-call-service-node/20206/1 "2020-01-12T00:29:21Z")

</div>

I have a function feeding in to a Call Service Node. This is the function code:

```auto
let state = context.get("door_state");
if (state === undefined) {
    state = 0;
}
state ^= 1;
context.set("door_state", state);
msg.service = state ? "turn_on" : "turn_off";
return msg;

```

A debug out shows that this is working the way I want, it toggles between turn\_on and turn\_off in the msg.service variable. The Call Service Node has {{service}} in the service field. But I am getting the error "Error call service, home assistant api error. Error Message: Service not found."

 ![Annotation 2020-01-11 162803](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e0b5804958585e1dbc1d1af2cd4470bb8bb83f1f.jpeg) ![Annotation 2020-01-11 162809](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/2587d2b63c0622f5276914b224f2951609343e24.jpeg)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [12 January 2020 00:38 UTC](https://discourse.nodered.org/t/mustache-notation-not-working-in-call-service-node/20206/2 "2020-01-12T00:38:57Z")

</div>

> [@nineclicks](#):
>
> Call Service Node

I assume the Call Service node is one of the Home Assistant nodes given its blue colour? It isn't a core node of Node-RED, so often helpful to be explicit.

Does that node's help say it supports mustache syntax in its fields? Nodes typically don't aside from the odd exception.

---

<div class="post-metadata">

**Author:** ![nineclicks](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nineclicks/32/16084_2.png) [@nineclicks](https://discourse.nodered.org/u/nineclicks)\
**Post date:** [12 January 2020 01:10 UTC](https://discourse.nodered.org/t/mustache-notation-not-working-in-call-service-node/20206/3 "2020-01-12T01:10:43Z")

</div>

Yes sorry, it is home assistant. Other fields work fine with mustache syntax. It says that mustache syntax works with the entity\_id and data fields. However I found that it also works with the domain field. So I suppose it just doesn't happen to work with the service field?
