# How to read a sensor with a homey script

**URL:** https://community.homey.app/t/how-to-read-a-sensor-with-a-homey-script/31962
**Category:** Questions & Help
**Created:** [July 2, 2020, 8:19pm UTC](https://community.homey.app/t/how-to-read-a-sensor-with-a-homey-script/31962 "2020-07-02T20:19:47Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [July 2, 2020, 8:57pm UTC](https://community.homey.app/t/how-to-read-a-sensor-with-a-homey-script/31962/2 "2020-07-02T20:57:31Z")

</div>

I’m not sure why you’re using `device.state`, AFAIK [that property doesn’t exist](https://developer.athom.com/docs/api/HomeyAPI.ManagerDevices.Device.html).

Reading the current value of a capability from Homeyscript [was discussed here](https://community.homey.app/t/device-capabilitiesobj-in-homeyscript-stays-the-same-value-when-triggered-in-a-flow/14529/3).

---

_[View the full topic](https://community.homey.app/t/how-to-read-a-sensor-with-a-homey-script/31962)._
