Skip to content

Commit

Permalink
add new blinds scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Aug 11, 2024
1 parent a7a2ffe commit 16d414b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
29 changes: 29 additions & 0 deletions ph4ha/apps/blinds.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ def scene_activated(self, event_name, data, kwargs):
elif scene_id == "scene.blinds_tilt_close":
self.log("Scene: blinds_tilt_close")
self.blinds_tilt_close()
elif scene_id == "scene.blinds_down_open":
self.log("Scene: blinds_down_open")
self.blinds_down_open()
elif scene_id == "scene.blinds_all_down_open":
self.log("Scene: blinds_all_down_open")
self.blinds_all_down_open()
elif scene_id == "scene.blinds_morning":
self.log("Scene: blinds_morning")
self.blinds_morning()

def handle_vent(self):
self.log("Vent started")
Expand Down Expand Up @@ -119,6 +128,26 @@ def blinds_tilt_close(self):
self.blinds_tilt(self.BLIND_SKLAD, 0)
self.blinds_tilt(self.BLIND_STUDY, 0)

def blinds_down_open(self):
self.blinds_pos_tilt(self.BLIND_LIV_BIG, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_BEDROOM, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_SKLAD, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_STUDY, 0, self.OPEN_HALF)

def blinds_all_down_open(self):
self.blinds_pos_tilt(self.BLIND_LIV_BIG, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_LIV_DOOR, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_BEDROOM, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_SKLAD, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_STUDY, 0, self.OPEN_HALF)

def blinds_morning(self):
self.blinds_living_morning()
self.blinds_pos_tilt(self.BLIND_LIV_DOOR, 100, 0)
self.blinds_pos_tilt(self.BLIND_BEDROOM, 100, 0)
self.blinds_pos_tilt(self.BLIND_SKLAD, 0, self.OPEN_HALF)
self.blinds_pos_tilt(self.BLIND_STUDY, 0, self.OPEN_HALF)

def blinds_pos_tilt(self, blind, pos, tilt):
blind_rec = self.blinds[blind]
blind_host = blind_rec["ip_address"]
Expand Down
15 changes: 15 additions & 0 deletions ph4ha/config-ha/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,18 @@ scene:
entities: { }
icon: mdi:blinds
metadata: { }
- id: 'scene-blinds-all-down-open'
name: Blinds All Down Open
entities: { }
icon: mdi:blinds
metadata: { }
- id: 'scene-blinds-down-open'
name: Blinds Down Open
entities: { }
icon: mdi:blinds
metadata: { }
- id: 'scene-blinds-morning'
name: Blinds Morning
entities: { }
icon: mdi:blinds
metadata: { }

0 comments on commit 16d414b

Please sign in to comment.