# Cannot setCapabilityValue measure\_temperature

**URL:** <https://community.homey.app/t/cannot-setcapabilityvalue-measure-temperature/71150>\
**Category:** Apps\
**Created:** [October 25, 2022, 9:19am UTC](https://community.homey.app/t/cannot-setcapabilityvalue-measure-temperature/71150 "2022-10-25T09:19:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fvrdam](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fvrdam/32/47643_2.png) [@fvrdam](https://community.homey.app/u/fvrdam)\
**Post date:** [October 25, 2022, 9:19am UTC](https://community.homey.app/t/cannot-setcapabilityvalue-measure-temperature/71150/1 "2022-10-25T09:19:23Z")

</div>

I’ve created an App that adds a thermostat to Homey and I don’t seem to be able to change the value of measure\_temperature capability. I have a temp sensor connected to Homey and want to show the current temperature in the thermostat.

I found this issue: [Cannot update measure\_temperature for Virtual Thermostate Device · Issue #65 · ArjanKranenburg/virtual-devices · GitHub](https://github.com/ArjanKranenburg/virtual-devices/issues/65)  
But it’s old and I can’t figure out how to make this setable…

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [October 25, 2022, 9:23am UTC](https://community.homey.app/t/cannot-setcapabilityvalue-measure-temperature/71150/2 "2022-10-25T09:23:30Z")

</div>

> [@fvrdam](#):
>
> and I don’t seem to be able to change the value of measure\_temperature capability

You get errors? It’s not showing the correct temperature? Are you passing a correct value to it? What’s the code that you use?

---

<div class="post-metadata">

**Author:** ![fvrdam](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fvrdam/32/47643_2.png) [@fvrdam](https://community.homey.app/u/fvrdam)\
**Post date:** [October 25, 2022, 7:16pm UTC](https://community.homey.app/t/cannot-setcapabilityvalue-measure-temperature/71150/3 "2022-10-25T19:16:58Z")

</div>

Sorry, should have posted the code with it.  
You did fix it, just by asking the question. It made me realise it should just work and it turns out I was using the wrong function call.

This in device.js works fine now:

```auto
'use strict';

const { Device } = require('homey');
const DeviceApi = require('./device-api');

class MyDevice extends Device {

    async onInit() {
         this.setCapabilityValue('measure_temperature', 13);
     }
}

```

@robertklep: thanks !
