Compare commits
11 Commits
bf1445759d
...
2b2261e248
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b2261e248 | |||
| 89a2f55583 | |||
| 976b829a8d | |||
| e7e11e3429 | |||
| e5d99438d8 | |||
| 426c6b79cf | |||
| dd27cdc952 | |||
| 30965c2a8a | |||
| cb2e70ee57 | |||
| 2e8dd176b8 | |||
| d9744ff8f1 |
Submodule apps/ad_toolbox updated: c71094641b...b997836401
@@ -13,6 +13,11 @@ motion_tracker:
|
|||||||
motion_sensors: binary_sensor.hallway_motion
|
motion_sensors: binary_sensor.hallway_motion
|
||||||
restroom:
|
restroom:
|
||||||
motion_sensors: binary_sensor.restroom_motion
|
motion_sensors: binary_sensor.restroom_motion
|
||||||
|
porche:
|
||||||
|
motion_sensors: binary_sensor.porche_motion
|
||||||
|
desk:
|
||||||
|
update_on_both_front: true
|
||||||
|
motion_sensors: binary_sensor.desk_presence_presence
|
||||||
garage:
|
garage:
|
||||||
door_generate_motion: true
|
door_generate_motion: true
|
||||||
motion_sensors:
|
motion_sensors:
|
||||||
@@ -52,5 +57,6 @@ occupancy_sensors:
|
|||||||
retain_time: 5 * 60
|
retain_time: 5 * 60
|
||||||
conditions:
|
conditions:
|
||||||
trigger_conditions:
|
trigger_conditions:
|
||||||
- binary_sensor.alienware_r10
|
- sensor.desk_last_motion <= 5
|
||||||
- sensor.macbook_m3_pro_de_pierre_frontmost_app != 'loginwindow' and sensor.macbook_m3_pro_de_pierre_displays == 2
|
#- binary_sensor.alienware_r10
|
||||||
|
#- sensor.macbook_m3_pro_de_pierre_frontmost_app != 'loginwindow' and sensor.macbook_m3_pro_de_pierre_displays == 2
|
||||||
|
|||||||
@@ -17,4 +17,6 @@ virtual_events:
|
|||||||
event_name: turn_off_all_lights
|
event_name: turn_off_all_lights
|
||||||
event_condition: binary_sensor.is_everybody_sleeping
|
event_condition: binary_sensor.is_everybody_sleeping
|
||||||
|
|
||||||
|
turn_off_all_living_room_lights:
|
||||||
|
event_name: turn_off_all_living_room_lights
|
||||||
|
event_condition: binary_sensor.is_living_room_sleeping or binary_sensor.projector_on
|
||||||
|
|||||||
@@ -4,17 +4,25 @@ virtual_sensors:
|
|||||||
priority: 10 # default priority app is 50, since most of them require sensors created by virtual sensors, it's important that virtual_sensors start first
|
priority: 10 # default priority app is 50, since most of them require sensors created by virtual sensors, it's important that virtual_sensors start first
|
||||||
|
|
||||||
sensors:
|
sensors:
|
||||||
binary_sensor.someone_home: person.maeva == 'home' or person.pierre == 'home'
|
binary_sensor.someone_home: person.maeva == 'home' or person.pierre == 'home' or (input_boolean.use_red_shelly_presence and binary_sensor.red_shelly_home)
|
||||||
binary_sensor.is_dark_outside: sun.sun == 'below_horizon'
|
binary_sensor.is_dark_outside: sun.sun == 'below_horizon'
|
||||||
|
event_sensor.red_shelly_home:
|
||||||
|
retain_time: 120
|
||||||
|
activation_events:
|
||||||
|
signal_strenght:
|
||||||
|
event_name: state_changed
|
||||||
|
event_data:
|
||||||
|
entity_id: sensor.shelly_button_red_signal_strength
|
||||||
|
|
||||||
# living room sensors
|
# living room sensors
|
||||||
value_selector.living_room_ambiance_light:
|
value_selector.living_room_ambiance_light:
|
||||||
values:
|
values:
|
||||||
0:
|
0:
|
||||||
- not binary_sensor.living_room_occupancy
|
- not binary_sensor.living_room_occupancy
|
||||||
- binary_sensor.projector_on and not binary_sensor.is_vertex2_content_idle
|
- binary_sensor.projector_on and not binary_sensor.is_vertex2_content_idle
|
||||||
- light.living_room
|
- light.living_room
|
||||||
- sensor.mezzanine_motion_light_level > 10
|
- sensor.mezzanine_motion_light_level > 15
|
||||||
|
- binary_sensor.is_living_room_sleeping
|
||||||
1:
|
1:
|
||||||
- binary_sensor.is_everybody_sleeping
|
- binary_sensor.is_everybody_sleeping
|
||||||
- binary_sensor.projector_on
|
- binary_sensor.projector_on
|
||||||
@@ -33,7 +41,9 @@ virtual_sensors:
|
|||||||
binary_sensor.is_playstation_on: switch.ps5_136_power
|
binary_sensor.is_playstation_on: switch.ps5_136_power
|
||||||
retain_condition.vertex2_has_input_signal:
|
retain_condition.vertex2_has_input_signal:
|
||||||
retain_time: 10
|
retain_time: 10
|
||||||
conditions: sensor.hdfury_vertex2_07_output_tx0 or sensor.hdfury_vertex2_07_audio_output
|
conditions:
|
||||||
|
trigger_conditions: sensor.hdfury_vertex2_07_output_tx0 or sensor.hdfury_vertex2_07_audio_output
|
||||||
|
disable_conditions: sensor.hdfury_vertex2_07_output_tx0 == 'unavailable'
|
||||||
binary_sensor.is_using_apple_tv: binary_sensor.is_apple_tv_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 0
|
binary_sensor.is_using_apple_tv: binary_sensor.is_apple_tv_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 0
|
||||||
binary_sensor.is_using_xbox: binary_sensor.is_xbox_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 1
|
binary_sensor.is_using_xbox: binary_sensor.is_xbox_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 1
|
||||||
binary_sensor.is_using_playstation: binary_sensor.is_playstation_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 2
|
binary_sensor.is_using_playstation: binary_sensor.is_playstation_on and binary_sensor.vertex2_has_input_signal and select.hdfury_vertex2_07_port_select_tx0 == 2
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class InformationsCollector(SmartObject):
|
|||||||
self.min_temp_yesterday_sensor = self.create_entity(output_sensors['min_temp_yesterday'])
|
self.min_temp_yesterday_sensor = self.create_entity(output_sensors['min_temp_yesterday'])
|
||||||
|
|
||||||
current_min_temp, current_max_temp = self.compute_min_max_temp()
|
current_min_temp, current_max_temp = self.compute_min_max_temp()
|
||||||
if not self.max_temp_sensor.exists() or self.max_temp_sensor.get_state() == 'unavailable':
|
if not self.max_temp_sensor.exists() or self.max_temp_sensor.get_state() == 'unavailable' or self.max_temp_sensor.get_state() == 'unknown':
|
||||||
max_temp = current_max_temp
|
max_temp = current_max_temp
|
||||||
try:
|
try:
|
||||||
if max_temp is None or self.dataset['max_temp'] > max_temp:
|
if max_temp is None or self.dataset['max_temp'] > max_temp:
|
||||||
@@ -70,7 +70,7 @@ class InformationsCollector(SmartObject):
|
|||||||
self.log_info(f"Restoring max_temp from dataset ({max_temp}°C)")
|
self.log_info(f"Restoring max_temp from dataset ({max_temp}°C)")
|
||||||
except KeyError: pass
|
except KeyError: pass
|
||||||
self.set_max_temp_sensor(max_temp)
|
self.set_max_temp_sensor(max_temp)
|
||||||
if not self.min_temp_sensor.exists() or self.min_temp_sensor.get_state() == 'unavailable':
|
if not self.min_temp_sensor.exists() or self.min_temp_sensor.get_state() == 'unavailable' or self.min_temp_sensor.get_state() == 'unknown':
|
||||||
min_temp = current_min_temp
|
min_temp = current_min_temp
|
||||||
try:
|
try:
|
||||||
if min_temp is None or self.dataset['min_temp'] < min_temp:
|
if min_temp is None or self.dataset['min_temp'] < min_temp:
|
||||||
@@ -199,8 +199,12 @@ class InformationsCollector(SmartObject):
|
|||||||
min_temp = None
|
min_temp = None
|
||||||
for sensor in self.args['min_max_temp_sensors']['temperature_sensors']:
|
for sensor in self.args['min_max_temp_sensors']['temperature_sensors']:
|
||||||
temp = self.get_state(sensor)
|
temp = self.get_state(sensor)
|
||||||
if not max_temp or temp > max_temp: max_temp = temp
|
try:
|
||||||
if not min_temp or temp < min_temp: min_temp = temp
|
temp = float(temp)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
continue
|
||||||
|
if max_temp is None or temp > max_temp: max_temp = temp
|
||||||
|
if min_temp is None or temp < min_temp: min_temp = temp
|
||||||
return min_temp,max_temp
|
return min_temp,max_temp
|
||||||
|
|
||||||
def on_log_error(self, name, ts, level, type, message, kwargs):
|
def on_log_error(self, name, ts, level, type, message, kwargs):
|
||||||
@@ -224,10 +228,17 @@ class InformationsCollector(SmartObject):
|
|||||||
|
|
||||||
def on_temperature_change(self, entity, attribute, old, new, kwargs):
|
def on_temperature_change(self, entity, attribute, old, new, kwargs):
|
||||||
if new != old:
|
if new != old:
|
||||||
|
|
||||||
|
try:
|
||||||
|
new_value = float(new)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
self.log_warning(f"Invalid temperature value from {entity}: {new}")
|
||||||
|
return
|
||||||
|
|
||||||
min_temp = self.min_temp_sensor.get_state()
|
min_temp = self.min_temp_sensor.get_state()
|
||||||
max_temp = self.max_temp_sensor.get_state()
|
max_temp = self.max_temp_sensor.get_state()
|
||||||
if max_temp is None or max_temp == 'unavailable' or new > max_temp: self.set_max_temp_sensor(new)
|
if max_temp is None or max_temp == 'unavailable' or new_value > float(max_temp): self.set_max_temp_sensor(new_value)
|
||||||
if min_temp is None or min_temp == 'unavailable' or new < min_temp: self.set_min_temp_sensor(new)
|
if min_temp is None or min_temp == 'unavailable' or new_value < float(min_temp): self.set_min_temp_sensor(new_value)
|
||||||
|
|
||||||
def run_at_midnight(self, kwargs):
|
def run_at_midnight(self, kwargs):
|
||||||
self.max_temp_yesterday_sensor.set_state(state=self.max_temp_sensor.get_state(), attributes={'unit_of_measurement': '°C', 'device_class': 'temperature'})
|
self.max_temp_yesterday_sensor.set_state(state=self.max_temp_sensor.get_state(), attributes={'unit_of_measurement': '°C', 'device_class': 'temperature'})
|
||||||
|
|||||||
@@ -41,5 +41,14 @@ light_restroom:
|
|||||||
25: binary_sensor.day_interval_night
|
25: binary_sensor.day_interval_night
|
||||||
100: True
|
100: True
|
||||||
|
|
||||||
|
light_porche:
|
||||||
|
module: smartlight
|
||||||
|
class: SmartLight
|
||||||
|
entity: light.porche
|
||||||
|
|
||||||
|
smart_conditions:
|
||||||
|
trigger_conditions: sensor.porche_last_motion < 3
|
||||||
|
blocking_conditions: sensor.porche_motion_light_level > 10 and not self
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
6
apps/rooms/desk.yaml
Normal file
6
apps/rooms/desk.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
light_ambiance:
|
||||||
|
module: smartlight
|
||||||
|
class: SmartLight
|
||||||
|
entity: light.desk_ambiance
|
||||||
|
|
||||||
|
smart_conditions: sensor.desk_last_motion < 3 and binary_sensor.is_dark_outside
|
||||||
@@ -5,7 +5,7 @@ light_garage:
|
|||||||
|
|
||||||
smart_conditions:
|
smart_conditions:
|
||||||
trigger_conditions: sensor.garage_last_motion < 3
|
trigger_conditions: sensor.garage_last_motion < 3
|
||||||
blocking_conditions: sensor.garage_motion_light_level > 10
|
blocking_conditions: sensor.garage_motion_light_level > 10 and binary_sensor.garage_entrance
|
||||||
|
|
||||||
p1p_light:
|
p1p_light:
|
||||||
module: smartswitch
|
module: smartswitch
|
||||||
|
|||||||
@@ -90,4 +90,19 @@ senseo_quadrante:
|
|||||||
good_morning:
|
good_morning:
|
||||||
event_name: good_morning
|
event_name: good_morning
|
||||||
button: button.senseo_quadrante_brew_coffee_double
|
button: button.senseo_quadrante_brew_coffee_double
|
||||||
condition: binary_sensor.senseo_quadrante_has_program and binary_sensor.senseo_quadrante_has_program.cup_size == 2 and not binary_sensor.senseo_quadrante_has_program.power_pressed
|
condition: binary_sensor.senseo_quadrante_has_program and binary_sensor.senseo_quadrante_has_program.cup_size == 2 and not binary_sensor.senseo_quadrante_has_program.power_pressed
|
||||||
|
|
||||||
|
storeban:
|
||||||
|
module: smartshutter
|
||||||
|
class: SmartShutter
|
||||||
|
entity: cover.storeban
|
||||||
|
|
||||||
|
virtual_sensors:
|
||||||
|
sensors:
|
||||||
|
binary_sensor.storeban_autoclose: sensor.sun_solar_elevation < 0 or (sensor.sun_solar_azimuth > 235 and sensor.sun_solar_elevation < 45)
|
||||||
|
|
||||||
|
close_conditions:
|
||||||
|
trigger_conditions: binary_sensor.storeban_autoclose
|
||||||
|
disable_conditions: not binary_sensor.storeban_autoclose
|
||||||
|
|
||||||
|
|
||||||
@@ -14,6 +14,10 @@ light_mezzanine_01:
|
|||||||
35: binary_sensor.day_interval_night
|
35: binary_sensor.day_interval_night
|
||||||
100: True
|
100: True
|
||||||
|
|
||||||
|
off_events:
|
||||||
|
- turn_off_all_lights
|
||||||
|
- turn_off_all_living_room_lights
|
||||||
|
|
||||||
light_mezzanine_02:
|
light_mezzanine_02:
|
||||||
module: smartlight
|
module: smartlight
|
||||||
class: SmartLight
|
class: SmartLight
|
||||||
@@ -30,6 +34,10 @@ light_mezzanine_02:
|
|||||||
25: binary_sensor.day_interval_night
|
25: binary_sensor.day_interval_night
|
||||||
100: True
|
100: True
|
||||||
|
|
||||||
|
off_events:
|
||||||
|
- turn_off_all_lights
|
||||||
|
- turn_off_all_living_room_lights
|
||||||
|
|
||||||
light_bookshelves:
|
light_bookshelves:
|
||||||
module: smartlight
|
module: smartlight
|
||||||
class: SmartLight
|
class: SmartLight
|
||||||
@@ -77,6 +85,8 @@ light_living_room:
|
|||||||
|
|
||||||
off_events:
|
off_events:
|
||||||
- turn_off_all_lights
|
- turn_off_all_lights
|
||||||
|
- turn_off_all_living_room_lights
|
||||||
|
|
||||||
|
|
||||||
projection_screen:
|
projection_screen:
|
||||||
module: smartshutter
|
module: smartshutter
|
||||||
@@ -113,4 +123,20 @@ mezzanine_curtains:
|
|||||||
|
|
||||||
close_conditions:
|
close_conditions:
|
||||||
trigger_conditions: binary_sensor.projector_on or not binary_sensor.projector_off_for_a_while
|
trigger_conditions: binary_sensor.projector_on or not binary_sensor.projector_off_for_a_while
|
||||||
disable_conditions: self == 'closed' and (binary_sensor.is_dark_outside or binary_sensor.is_anybody_sleeping)
|
disable_conditions: self == 'closed' and (binary_sensor.is_dark_outside or binary_sensor.is_anybody_sleeping)
|
||||||
|
|
||||||
|
living_room_sleep_switch:
|
||||||
|
module: smartswitch
|
||||||
|
class: SmartSwitch
|
||||||
|
|
||||||
|
entity: input_boolean.living_room_sleeping
|
||||||
|
|
||||||
|
toggle_events:
|
||||||
|
button_press:
|
||||||
|
event_name: state_changed
|
||||||
|
debounce_seconds: 0.5
|
||||||
|
event_data:
|
||||||
|
entity_id: event.living_room_bilresa_button_bouton_2
|
||||||
|
new_state:
|
||||||
|
attributes:
|
||||||
|
event_type: multi_press_1
|
||||||
Reference in New Issue
Block a user