Pythm / ad-Lightwand

Extensive control of lights based on time of day with mode event in addition to motion, presence, lux, rain, and media player sensors
https://github.com/Pythm/ad-Lightwand
MIT License
13 stars 0 forks source link

Lights turned on that shouldnt...? #5

Open pointlevel opened 2 days ago

pointlevel commented 2 days ago

Hello,

This morning when we were sleeping, the lights turned on, even though they shouldn't. I had the bed_sensor active (input_boolean). I also had a little sleep today due to a late night, so I got to experience the light in my eyes. Lucky that I have an understanding girlfriend who also woke up :) I had to manually turn the lights off through HA in my mobile. See the history below, the top row is the lights, the middlle one is the bedsensor and the bottom is the activity. Normal mode started at 06:00 and has been constant since.

Shouldnt bed_sensor restrict ALL lights?

Skärmbild 2024-11-10 075610

My config:

master_bedroom:
  module: lightwand
  class: Room
  json_path: /homeassistant/.storage/

  OutLux_sensor: sensor.outdoor_lux

  bed_sensors:
    - input_boolean.in_bed

  motion_sensors:
    - motion_sensor: binary_sensor.activity_in_master_bedroom
      delay: 5
      #motion_constraints: "self.now_is_between('07:30:00', '23:00:00')"
    - motion_sensor: input_boolean.fake_activity_in_master_bedroom
      delay: 5

  Lights:
    - lights:
        - light.master_bedroom_interior_lights

      automations:
        - time: "00:00:00"
          light_data:
            brightness: 30
            transition: 3
            color_temp_kelvin: 2200
        - time: "08:30:00"
          light_data:
            brightness: 60
            transition: 3
            color_temp_kelvin: 2700

      motionlights:
        - time: "07:30:00"
          light_data:
            brightness: 200
            transition: 1

      light_modes:
        - mode: night_master_bedroom
          light_data:
            brightness: 0
            transition: 60
        - mode: morning
          automations:
            - time: "06:50:00"
              light_data:
                brightness: 5
                transition: 3
            - time: "07:00:00"
              light_data:
                brightness: 10
                transition: 3

      lux_constraint: 5000
      lux_turn_on: 4500
      lux_turn_off: 5000
Pythm commented 2 days ago

Can you remove the lux_turn_on and lux_turn_off from the configuration and verify that the light does not turn on after night mode, when bed_sensor is active?

pointlevel commented 2 days ago

Without testing, just looking at the history i can confirm that the lights turn on together with a lux_change, but only when there is activity(motion) active. So disable the lux_turn_on should probably help for the unwanted lights in bed-state, but also brake the normal automations.

Pythm commented 2 days ago

It will not turn back on after lux have been above lux_turn_off, unless there is mode changes or motion...