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)
That means the capability is read-only, meaning that it can’t be changed (only read).
Tank you for the reply.
I’m looking for a solution. Have you manage to set up a virtual thermostat with a script?
Which capability are you trying to change? Only target_temperature can be set, measure_temperature is read-only.
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.
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. 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:
// 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
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.