# Prevent on/off function on thermostats

**URL:** <https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528>\
**Category:** Questions & Help\
**Tags:** thermostats\
**Created:** [March 15, 2026, 4:51pm UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528 "2026-03-15T16:51:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stugan\_Bjare](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stugan_bjare/32/80078_2.png) [@Stugan\_Bjare](https://community.homey.app/u/Stugan_Bjare)\
**Post date:** [March 15, 2026, 4:51pm UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528/1 "2026-03-15T16:51:28Z")

</div>

I have 12 thermostats. Some of them act up if you turn them off with the button in Homey. It’s hard to understand why there isn’t a default to block this function. You have to create a virtual thermostat and then make a flow. It works but is cumbersome with so many thermostats. I have tried with scripts, but without success. I get the response: Script Error  
Error: Capability Not Setable  
at Device.setCapabilityValue (file:///app/packages/homey-core/lib/Device.mjs:1137:13)  
at process.processTicksAndRejections (node:internal/process/task\_queues:104:5)

---

<div class="post-metadata">

**Author:** ![smarthomesven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/smarthomesven/32/79712_2.png) [@smarthomesven](https://community.homey.app/u/smarthomesven)\
**Post date:** [March 15, 2026, 5:41pm UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528/2 "2026-03-15T17:41:13Z")

</div>

> [@Stugan\_Bjare](#):
>
> Error: Capability Not Setable  
> at Device.setCapabilityValue (file:///app/packages/homey-core/lib/Device.mjs:1137:13)  
> at process.processTicksAndRejections (node:internal/process/task\_queues:104:5)

That means the capability is read-only, meaning that it can’t be changed (only read).

---

<div class="post-metadata">

**Author:** ![Stugan\_Bjare](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stugan_bjare/32/80078_2.png) [@Stugan\_Bjare](https://community.homey.app/u/Stugan_Bjare)\
**Post date:** [March 15, 2026, 10:45pm UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528/3 "2026-03-15T22:45:18Z")

</div>

Tank you for the reply.

I’m looking for a solution. Have you manage to set up a virtual thermostat with a script?

---

<div class="post-metadata">

**Author:** ![smarthomesven](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/smarthomesven/32/79712_2.png) [@smarthomesven](https://community.homey.app/u/smarthomesven)\
**Post date:** [March 15, 2026, 10:46pm UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528/4 "2026-03-15T22:46:36Z")

</div>

Which capability are you trying to change? Only `target_temperature` can be set, `measure_temperature` is read-only.

---

<div class="post-metadata">

**Author:** ![Stugan\_Bjare](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stugan_bjare/32/80078_2.png) [@Stugan\_Bjare](https://community.homey.app/u/Stugan_Bjare)\
**Post date:** [March 16, 2026, 8:58am UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528/5 "2026-03-16T08:58:21Z")

</div>

The target\_temperature shall be changeable and change the value of the real thermostat. The measure\_temperature shall reproduce the value of the real thermostat.

---

<div class="post-metadata">

**Author:** ![Andy\_Henderson](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andy_henderson/32/80642_2.png) [@Andy\_Henderson](https://community.homey.app/u/Andy_Henderson)\
**Post date:** [March 16, 2026, 1:15pm UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528/6 "2026-03-16T13:15:15Z")

</div>

I have the same issue with my ‘Everything Presence Lite’ sensors. My educated guess is that if a device has an onoff attribute, Homey automatically allows you to switch it on and off by tapping it in the devices tab - unless the app author has overridden that capability.

You can find out if your devices have onoff capabilities via the Homey [developer tools](https://tools.developer.homey.app/tools/devices). My sensors define capability onoff.esp32\_led. The developer intends it to allow me to turn off the device’s LED, but it seems Homey sees the ‘onoff’ bit and decides how to use it by default.

I created the following script which you might be able to adapt:

```auto
// Get all devices
const devices = await Homey.devices.getDevices();
// Loop over all devices
for (const device of Object.values(devices)) {
  // If an Everything Presence Lite
  if(device.settings['device_type'] == 'epl') {
    // Turn the sensor on
    await device.setCapabilityValue('onoff.esp32_led', true);
  }
}

```

It turns all onoff.esp32\_led capabilities to true (i.e. on) for all devices with a device type of epl. The developer tools should give you suitable values for your thermostats.

I then set up a flow that, for each device, uses when ‘device turned off for 1 second’ runs the script to turn it back on.

I hope that’s useful.

Andy

---

<div class="post-metadata">

**Author:** ![Stugan\_Bjare](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/stugan_bjare/32/80078_2.png) [@Stugan\_Bjare](https://community.homey.app/u/Stugan_Bjare)\
**Post date:** [March 16, 2026, 1:34pm UTC](https://community.homey.app/t/prevent-on-off-function-on-thermostats/152528/7 "2026-03-16T13:34:13Z")

</div>

Thank you. For most of the thermostats this will work, BUT two of thermostats will not turn on, unless I manually turn them on, at the radiator.
