# Turning off devices based on Presence

**URL:** <https://community.openhab.org/t/turning-off-devices-based-on-presence/43237>\
**Category:** Scripts & Rules\
**Created:** [April 6, 2018, 3:13pm UTC](https://community.openhab.org/t/turning-off-devices-based-on-presence/43237 "2018-04-06T15:13:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [April 6, 2018, 5:42pm UTC](https://community.openhab.org/t/turning-off-devices-based-on-presence/43237/5 "2018-04-06T17:42:42Z")

</div>

> [@binderth](#):
>
> note: please don’t use the Syntax sendCommand(CurrentActivityHub, “PowerOff”) anymore, it’s deprecated, please use instead CurrentActivityHub.sendCommand(“PowerOff”) - as Vincent used.

The advice is correct but the reason is not. The Actions are not deprecated and will stay around for the long-term. At least I hope so because there are a couple of really good use cases for them. We do discourage their use when you have you know apriori what Item you have because of everything raised [here](https://docs.openhab.org/configuration/rules-dsl.html#sendcommand-method-vs-action).

But if you are using [Design Pattern: Associated Items](https://community.openhab.org/t/design-pattern-associated-items/15790) or some other approach where you are generating the name of an Item to send a command to based on some other criteria, the Actions are the best way to do it since they don’t require you to add the Items to a Group and use the findFirst trick to get a handle on them.

I really hope the Actions do not go away.

---

_[View the full topic](https://community.openhab.org/t/turning-off-devices-based-on-presence/43237)._
