Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lights not turning on when presence is detected #325

Closed
twindebank opened this issue Apr 7, 2024 · 2 comments
Closed

Lights not turning on when presence is detected #325

twindebank opened this issue Apr 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@twindebank
Copy link

twindebank commented Apr 7, 2024

Describe the bug

I expect lights within the area to turn on when presence is detected, they do not. However, if I turn the lights on manually then leave the area, then they turn off when the area state is clear.

To Reproduce (config/screenshots in dropdowns)

Set up a magic area with default configuration + a light group.
{
  "features": {
    "light_groups": {
      "overhead_lights": [],
      "overhead_lights_states": [
        "occupied",
        "extended"
      ],
      "overhead_lights_act_on": [
        "occupancy",
        "state"
      ],
      "sleep_lights": [],
      "sleep_lights_states": [],
      "sleep_lights_act_on": [],
      "accent_lights": [],
      "accent_lights_states": [],
      "accent_lights_act_on": [],
      "task_lights": [],
      "task_lights_states": [],
      "task_lights_act_on": []
    }
  },
  "type": "interior",
  "exclude_entities": [],
  "update_interval": 60,
  "clear_timeout": 60,
  "icon": "mdi:texture-box",
  "presence_sensor_device_class": [
    "motion",
    "occupancy",
    "presence"
  ],
  "secondary_states": {
    "sleep_state": "on",
    "extended_time": 120,
    "accent_state": "on",
    "extended_timeout": 300,
    "sleep_timeout": 60,
    "sleep_entity": "",
    "accent_entity": "",
    "dark_state": "on",
    "dark_entity": ""
  },
  "presence_device_platforms": [
    "media_player",
    "binary_sensor"
  ],
  "on_states": [
    "on",
    "open"
  ],
  "include_entities": [],
  "name": "Hallway",
  "id": "hallway"
}
Three entities are created image
Turn on the `Area Light Control (Hallway)` entity. image
Walk into the area -> presence is detected. image
Lights do not turn on. image

Logs:

2024-04-07 16:21:16.659 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Area (Hallway): sensor 'binary_sensor.presence_sensor_fp2_7034_presence_sensor_4' changed to on
2024-04-07 16:21:16.659 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] [Area: hallway] Updating state. (Valid states: ['on', 'open'])
2024-04-07 16:21:16.660 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] [Area: hallway] Sensor binary_sensor.presence_sensor_fp2_7034_presence_sensor_4 state: on
2024-04-07 16:21:16.660 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] [Area: hallway] Valid presence sensor found: binary_sensor.presence_sensor_fp2_7034_presence_sensor_4.
2024-04-07 16:21:16.660 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] [Area: hallway] Active sensors: ['binary_sensor.presence_sensor_fp2_7034_presence_sensor_4']
2024-04-07 16:21:16.660 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Hallway: State changed to True at 2024-04-07 15:21:16.660781
2024-04-07 16:21:16.661 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Area (Hallway): Current state: {'dark', 'occupied'}, last state: {'dark', 'clear'} -> new states {'occupied'} / lost states {'clear'}
2024-04-07 16:21:16.661 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Hallway: States updated. New states: {'occupied'} / Lost states: {'clear'}
2024-04-07 16:21:16.661 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Reporting state change for Hallway (new states: ['dark', 'occupied']/lost states: [])
2024-04-07 16:21:16.670 DEBUG (SyncWorker_19) [custom_components.magic_areas.light] Light group Hallway Lights detected area state change

If I turn the lights on manually then leave the area, they turn off sucessfully:

2024-04-07 16:25:58.918 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Refreshing sensor states Area (Hallway)
2024-04-07 16:25:58.918 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] [Area: hallway] Updating state. (Valid states: ['on', 'open'])
2024-04-07 16:25:58.919 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] [Area: hallway] Sensor binary_sensor.presence_sensor_fp2_7034_presence_sensor_4 state: off
2024-04-07 16:25:58.919 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] [Area: hallway] Active sensors: []
2024-04-07 16:25:58.919 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Hallway: Area is on timeout
2024-04-07 16:25:58.919 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Hallway: States updated. New states: [] / Lost states: []
2024-04-07 16:25:58.920 DEBUG (SyncWorker_3) [custom_components.magic_areas.binary_sensor] Reporting state change for Hallway (new states: []/lost states: [])
2024-04-07 16:25:58.927 DEBUG (SyncWorker_21) [custom_components.magic_areas.light] Light group Hallway Lights detected area state change
2024-04-07 16:26:16.660 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] Refreshing sensor states Area (Hallway)
2024-04-07 16:26:16.660 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] [Area: hallway] Updating state. (Valid states: ['on', 'open'])
2024-04-07 16:26:16.660 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] [Area: hallway] Sensor binary_sensor.presence_sensor_fp2_7034_presence_sensor_4 state: off
2024-04-07 16:26:16.660 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] [Area: hallway] Active sensors: []
2024-04-07 16:26:16.660 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] Hallway: Area is on timeout
2024-04-07 16:26:16.660 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] Hallway: Clear Timeout exceeded.
2024-04-07 16:26:16.661 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] Hallway: State changed to False at 2024-04-07 15:26:16.661446
2024-04-07 16:26:16.661 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] Area (Hallway): Current state: {'dark', 'clear'}, last state: {'dark', 'occupied'} -> new states {'clear'} / lost states {'occupied'}
2024-04-07 16:26:16.661 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] Hallway: States updated. New states: {'clear'} / Lost states: {'occupied'}
2024-04-07 16:26:16.661 DEBUG (SyncWorker_19) [custom_components.magic_areas.binary_sensor] Reporting state change for Hallway (new states: ['dark', 'clear']/lost states: [])
2024-04-07 16:26:16.662 DEBUG (SyncWorker_6) [custom_components.magic_areas.light] Light group Hallway Lights detected area state change
2024-04-07 16:26:16.663 DEBUG (SyncWorker_6) [custom_components.magic_areas.light] Hallway Lights: Area is clear, should turn off lights!
2024-04-07 16:26:16.665 DEBUG (SyncWorker_6) [custom_components.magic_areas.light] {self.name}: Control Reset.
2024-04-07 16:26:16.825 DEBUG (SyncWorker_22) [custom_components.magic_areas.light] {self.name}: Control Reset.

I've tried various combinations of restarting and reinstalling magic areas to no avail. I've also tried other areas with the same results.

@twindebank twindebank added the bug Something isn't working label Apr 7, 2024
@twindebank twindebank changed the title Lights not automatically turning on when presence is detected Lights not turning on when presence is detected Apr 7, 2024
@jseidl
Copy link
Owner

jseidl commented Apr 24, 2024

Seems like you didn't added any lights to any of the groups.

    "light_groups": {
      "overhead_lights": [],
       ....
      "sleep_lights": [],
       ....
      "accent_lights": [],
       ....
      "task_lights": [],
    }

Try adding some lights into the "Overhead lights" through the config UI.

Also check out the wiki for Light Groups https://github.com/jseidl/hass-magic_areas/wiki/Light-Groups

@jseidl
Copy link
Owner

jseidl commented May 27, 2024

Closing this due lack of interaction, please reopen if you still have issues.

@jseidl jseidl closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants