# \[APP\]\[Pro\] Plugwise App by Plugwise \[Adam, Anna, Smile P1\] \[v3.1.0\]

**URL:** <https://community.homey.app/t/app-pro-plugwise-app-by-plugwise-adam-anna-smile-p1-v3-1-0/8828>\
**Category:** Apps\
**Tags:** app, official, homey-pro\
**Created:** [February 6, 2019, 8:27pm UTC](https://community.homey.app/t/app-pro-plugwise-app-by-plugwise-adam-anna-smile-p1-v3-1-0/8828 "2019-02-06T20:27:34Z")\
**Posts on this page:** 1\
**Showing post:** 128

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [January 8, 2023, 11:06am UTC](https://community.homey.app/t/app-pro-plugwise-app-by-plugwise-adam-anna-smile-p1-v3-1-0/8828/128 "2023-01-08T11:06:10Z")

</div>

Of course. It’s a rather complex build-up (with url & payload & authentication) with a couple of plugwise id’s you need to gather from different place’s:

```auto
let url = "http://<your_bridge_ip>/core/rules;id="+rule_id;

let payload = '\<?xml version="1.0" encoding="UTF-8" ?><rules><rule id="'+rule_id+'"><name><![CDATA['+name+']]></name><template tag="zone_preset_based_on_time_and_presence_with_override"/><contexts><context><zone><location id="'+location_id+'"/></zone></context></contexts></rule></rules>';

const response = await fetch(url, {
      method: 'POST',
      headers: {
          'content-type': 'text/xml',
          'content-length': payload.length,
          'authorization' : 'Basic <your authorization id here>'
      },
      body: payload
  }).then(response => response.text())
  .then(data => {
    console.log('Success:', data);
  })
  .catch((error) => {
    console.error('Error:', error);
  });

```

So you need to find your _rule\_id_ and _name_ for the schema (check \<your\_bridge\_ip\>/core/rules), the _location\_id_ for the zone (check \<your\_bridge\_ip/core/appliances) and your authorization id (assign a zone to a schema in the plug wise webpage and find this in the http request call using developer mode of your browser).

With this call you can assign 1 zone to a schema. It is possible to assign multiple zone’s at once. In that case repeat the `<context><zone><location id=+locationa_id+ /></zone></context>` part multiple times in the payload.

---

_[View the full topic](https://community.homey.app/t/app-pro-plugwise-app-by-plugwise-adam-anna-smile-p1-v3-1-0/8828)._
