# Wemo Light Switch Issues

**URL:** <https://community.smartthings.com/t/wemo-light-switch-issues/5480>\
**Category:** Devices & Integrations\
**Created:** [October 3, 2014, 4:28am UTC](https://community.smartthings.com/t/wemo-light-switch-issues/5480 "2014-10-03T04:28:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![weid83](https://avatars.discourse-cdn.com/v4/letter/w/e95f7d/32.png) [@weid83](https://community.smartthings.com/u/weid83)\
**Post date:** [October 3, 2014, 4:28am UTC](https://community.smartthings.com/t/wemo-light-switch-issues/5480/1 "2014-10-03T04:28:06Z")

</div>

Lately my Wemo Light Switches wouldn’t update it’s state after I turn it on or off. After digging into the code, found an issue in the parse() function:

```
    else if (body?.Body?.SetBinaryStateResponse?.BinaryState?.text())
    {
    	log.trace "Got SetBinaryStateResponse = ${body?.Body?.SetBinaryStateResponse?.BinaryState?.text()}"
    }

```

should be:

```
    else if (body?.Body?.SetBinaryStateResponse?.BinaryState?.text())
    {
        def value = body?.Body?.SetBinaryStateResponse?.BinaryState?.text().toInteger() == 1 ? "on" : "off"
    	log.trace "Got SetBinaryStateResponse = ${value}"
        result << createEvent(name: "switch", value: value)
    }

```

Essentially what happens is that if you do a set (i.e. turn the light on or off), it goes into that particular else and then won’t do anything. The fix is to do a createEvent based on the response. After this my light switches update their state correctly.
