WTH there is no easy way to assign / change areas via automations

When trying to build an automation via the UI, I’m not able to change areas for devices (and entities):

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - sensor.mysensor_estimated_distance
    attribute: source
    to: "\"FF:FF:FF:FF:FF:FF\""
    for:
      hours: 0
      minutes: 5
      seconds: 0
condition: []
action:
  # here ideally we would be able to programmatically change the area for the device either:
  # A) device.move_area_to: area_id
  # B) call_service 'area_change' device_id area_id
  # C) area.remove / area.add device_id 
  # whichever is more architecturally sound
    data: {}

Out of curiosity, what we be the use case - or why would you like to achieve that?

It opens up a better way to do room presence detection, e.g. changing the iBeacon entity area dinamycally, and adds more use to Areas.

1 Like

I have a use case for this as well: I have a standing lamp that i sometimes move between two rooms. All my light automations are controlling areas not individual lights so i would like an eassy way to change the lights area for example: I could stick an nfc tag to the lamp so when i move it, i scan it, that could trigger an automation that toggles the area of the light between the two rooms i’am using it in. All my automations would then automatically correctly continue to work withouth turning the standing lamp on when not desired or not turning it on when it sould be turned on.

2 Likes

Old thread, but I want to throw another use case in the mix. I’m also controlling my lights via areas. My use case is to create a guest mode, so that lights and devices in the guest room is not affected by my master OFF switch (and other automations), if guest mode is enabled. It would be really easy to just take the devices out of the assigned room, and then back again when guestmode is off.

1 Like