# Extract value with quote''

**URL:** <https://community.homey.app/t/extract-value-with-quote/78193>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [March 22, 2023, 6:45am UTC](https://community.homey.app/t/extract-value-with-quote/78193 "2023-03-22T06:45:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebyldino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebyldino/32/20067_2.png) [@sebyldino](https://community.homey.app/u/sebyldino)\
**Post date:** [March 22, 2023, 6:45am UTC](https://community.homey.app/t/extract-value-with-quote/78193/1 "2023-03-22T06:45:20Z")

</div>

Hello,

I want to get a sensor value but i have problem with quote.

This script:

```auto
const spa = await Homey.devices.getDevice({id: '2aba115d-86be-493b-98cf-8dfb1c8185de'});
log (spa.capabilitiesObj);

return true

```

Return this:

```auto
{
  'measure_temperature.DS18B20-1': {
    value: 13.5,
    lastUpdated: '2023-03-22T06:18:31.896Z',
    type: 'number',
    getable: true,
    setable: false,
    title: 'Temperature (DS18B20-1)',
    desc: 'Température en degrés Celsius (°C)',
    units: '°C',
    decimals: 2,
    chartType: 'spline',
    id: 'measure_temperature.DS18B20-1',
    options: { units: [Object], title: [Object] },
    values: undefined
  },
  'measure_temperature.DS18B20-2': {
    value: 13.8,
    lastUpdated: '2023-03-22T03:23:32.447Z',
    type: 'number',
    getable: true,
    setable: false,
    title: 'Temperature (DS18B20-2)',
    desc: 'Température en degrés Celsius (°C)',
    units: '°C',
    decimals: 2,
    chartType: 'spline',
    id: 'measure_temperature.DS18B20-2',
    options: { units: [Object], title: [Object] },
    values: undefined
  },
  additional_sensors: {
    value: null,
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'Switch',
    desc: null,
    units: null,
    id: 'additional_sensors',
    options: {},
    values: undefined
  },
  'switch.1': {
    value: false,
    lastUpdated: '2023-03-21T14:55:49.642Z',
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'switch 1',
    desc: null,
    units: null,
    id: 'switch.1',
    options: { title: [Object] },
    values: undefined
  },
  'switch.2': {
    value: false,
    lastUpdated: '2023-03-21T14:56:00.025Z',
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'switch 2',
    desc: null,
    units: null,
    id: 'switch.2',
    options: { title: [Object] },
    values: undefined
  },
  'switch.3': {
    value: false,
    lastUpdated: '2023-03-21T14:55:58.905Z',
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'switch 3',
    desc: null,
    units: null,
    id: 'switch.3',
    options: { title: [Object] },
    values: undefined
  },
  'switch.4': {
    value: false,
    lastUpdated: '2023-03-21T14:55:57.092Z',
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'switch 4',
    desc: null,
    units: null,
    id: 'switch.4',
    options: { title: [Object] },
    values: undefined
  },
  onoff: {
    value: false,
    lastUpdated: '2023-03-21T14:56:00.534Z',
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'Switch',
    desc: null,
    units: null,
    id: 'onoff',
    options: {},
    values: undefined
  },
  multiplesockets: {
    value: null,
    type: 'boolean',
    getable: true,
    setable: true,
    title: 'Switch',
    desc: null,
    units: null,
    id: 'multiplesockets',
    options: {},
    values: undefined
  },
  measure_signal_strength: {
    value: 100,
    lastUpdated: '2023-03-21T18:48:51.738Z',
    type: 'number',
    getable: true,
    setable: false,
    title: 'Signal strength',
    desc: null,
    units: '%',
    iconObj: {
      id: '8f9319a376ecfe96f8469b09b26db4f3',
      url: '/icon/8f9319a376ecfe96f8469b09b26db4f3/icon.svg'
    },
    id: 'measure_signal_strength',
    options: {},
    values: undefined
  }
}

```

I want to get value of `'measure_temperature.DS18B20-1'` but i dont know how do that because there are quotes.

For `measure_signal_strength` i can do this:

```auto
log (spa.capabilitiesObj.measure_signal_strength.value);

```

How can i do for `'measure_temperature.DS18B20-1'`?

Thanks

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [March 22, 2023, 6:50am UTC](https://community.homey.app/t/extract-value-with-quote/78193/2 "2023-03-22T06:50:52Z")

</div>

Try:

`log (spa.capabilitiesObj.['measure_temperature.DS18B20-1'].value);`

---

<div class="post-metadata">

**Author:** ![sebyldino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebyldino/32/20067_2.png) [@sebyldino](https://community.homey.app/u/sebyldino)\
**Post date:** [March 22, 2023, 6:54am UTC](https://community.homey.app/t/extract-value-with-quote/78193/3 "2023-03-22T06:54:41Z")

</div>

> [@Adrian\_Rockall](#):
>
> log (spa.capabilitiesObj.[‘measure\_temperature.DS18B20-1’].value);

Return:  
`❌ Script Error  
⚠ testSpa.js:2  
log (spa.capabilitiesObj.[‘measure\_temperature.DS18B20-1’].value);  
^

SyntaxError: Unexpected token ‘[’  
at new Script (node:vm:100:7)  
at HomeyScriptApp.runScript (/app.js:483:23)  
at processTicksAndRejections (node:internal/process/task\_queues:96:5)  
at async Object.runScript (/api.js:30:22)`

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [March 22, 2023, 6:58am UTC](https://community.homey.app/t/extract-value-with-quote/78193/4 "2023-03-22T06:58:53Z")

</div>

Sorry, copy and paste error I think, try without the . before the [

---

<div class="post-metadata">

**Author:** ![sebyldino](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sebyldino/32/20067_2.png) [@sebyldino](https://community.homey.app/u/sebyldino)\
**Post date:** [March 22, 2023, 6:59am UTC](https://community.homey.app/t/extract-value-with-quote/78193/5 "2023-03-22T06:59:51Z")

</div>

> [@Adrian\_Rockall](#):
>
> Sorry, copy and paste error I think, try without the . before the [

Yes! Thank you! 🙂
