├── .gitignore ├── README.md ├── automation ├── 3d_printer.yaml ├── alarm.yaml ├── bedtime.yaml ├── blinds.yaml ├── bug_zapper.yaml ├── camera.yaml ├── christmas.yaml ├── climate.yaml ├── doors.yaml ├── energy.yaml ├── fans.yaml ├── fountain.yaml ├── garage.yaml ├── holiday.yaml ├── ios_actions.yaml ├── laundry.yaml ├── led_clock.yaml ├── lights.yaml ├── location.yaml ├── locks.yaml ├── media.yaml ├── motion.yaml ├── network.yaml ├── occupancy.yaml ├── roomba.yaml ├── system.yaml ├── vacation.yaml ├── water_works.yaml └── weather.yaml ├── command_line.yaml ├── configuration.yaml ├── customize.yaml ├── emulated_hue.yaml ├── esphome └── garage_door_relay │ ├── README.MD │ ├── garage_door_relay.yaml │ └── images │ ├── 4RelayESP32.jpeg │ └── ha-esp32.png ├── groups.yaml ├── homekit.yaml ├── images ├── 3d-print-screenshot.jpg ├── alarm-screenshot.jpg ├── basement-screenshot.jpg ├── bath-screenshot.jpg ├── bedrooms-screenshot.jpg ├── dining-screenshot.jpg ├── home-screenshot.jpg ├── living-room-screenshot.jpg ├── offices-screenshot.jpg ├── outdoor-screenshot.jpg ├── power-screenshot.jpg ├── system-screenshot.jpg ├── upstairs-screenshot.jpg ├── water-screenshot.jpg └── weather-screenshot.jpg ├── ios.yaml ├── lovelace.yaml ├── python_scripts ├── basement_roomba.py ├── main_floor_roomba.py └── upstairs_roomba.py ├── recorder.yaml ├── scripts.yaml ├── sensors.yaml ├── switch.yaml ├── template.yaml └── tools ├── README.MD ├── ha-github-scrub.sh ├── ha-mgmt-bash.sh ├── ha-mgmt-docker.sh └── redacted.txt /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .DS_Store 3 | www/hass-bha-icons.html.txt 4 | -------------------------------------------------------------------------------- /automation/bug_zapper.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Bug Zapper Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Turn On Bug Zapper at Sunset 7 | ########################################################## 8 | 9 | - alias: Bug Zapper - Turn On Bug Zapper at Sunset 10 | id: 'bug_zapper_turn_on_bug_zapper_at_sunset' 11 | 12 | triggers: 13 | - trigger: sun 14 | event: 'sunset' 15 | offset: '-00:30:00' 16 | 17 | conditions: 18 | - condition: state 19 | entity_id: group.household 20 | state: 'home' 21 | - condition: state 22 | entity_id: switch.bug_zapper 23 | state: 'off' 24 | - condition: not 25 | conditions: 26 | - condition: state 27 | entity_id: sensor.season 28 | state: 'winter' 29 | 30 | actions: 31 | - action: switch.turn_on 32 | target: 33 | entity_id: 34 | - switch.bug_zapper 35 | 36 | ########################################################## 37 | ## Turn Off Bug Zapper at Sunrise 38 | ########################################################## 39 | 40 | - alias: Bug Zapper - Turn Off Bug Zapper at Sunrise 41 | id: 'bug_zapper_turn_off_bug_zapper_at_sunrise' 42 | 43 | triggers: 44 | - trigger: sun 45 | event: 'sunrise' 46 | offset: '+00:15:00' 47 | 48 | conditions: 49 | - condition: state 50 | entity_id: switch.bug_zapper 51 | state: 'on' 52 | 53 | actions: 54 | - action: switch.turn_off 55 | target: 56 | entity_id: 57 | - switch.bug_zapper 58 | 59 | ########################################################## 60 | ## Turn Off Bug Zapper in the Rain 61 | ########################################################## 62 | 63 | - alias: Bug Zapper - Turn Off Bug Zapper in the Rain 64 | id: 'bug_zapper_turn_off_bug_zapper_in_the_rain' 65 | 66 | triggers: 67 | - trigger: state 68 | entity_id: weather.REDACTED 69 | to: 'rainy' 70 | for: 71 | hours: 0 72 | minutes: 30 73 | seconds: 0 74 | - trigger: state 75 | entity_id: weather.REDACTED 76 | to: 'lightning-rainy' 77 | for: 78 | hours: 0 79 | minutes: 30 80 | seconds: 0 81 | 82 | conditions: 83 | - condition: state 84 | entity_id: switch.bug_zapper 85 | state: 'on' 86 | 87 | actions: 88 | - action: switch.turn_off 89 | target: 90 | entity_id: 91 | - switch.bug_zapper 92 | 93 | ########################################################## 94 | ## Turn On Bug Zapper After Rain Stops 95 | ########################################################## 96 | 97 | - alias: Bug Zapper - Turn On Bug Zapper After Rain Stops 98 | id: 'bug_zapper_turn_on_bug_zapper_after_rain_stops' 99 | 100 | triggers: 101 | - trigger: state 102 | entity_id: weather.REDACTED 103 | from: 'rainy' 104 | 105 | conditions: 106 | - condition: state 107 | entity_id: switch.bug_zapper 108 | state: 'off' 109 | - condition: state 110 | entity_id: sun.sun 111 | state: 'below_horizon' 112 | - condition: state 113 | entity_id: group.household 114 | state: 'home' 115 | - condition: not 116 | conditions: 117 | - condition: state 118 | entity_id: sensor.season 119 | state: 'winter' 120 | 121 | actions: 122 | - action: switch.turn_on 123 | target: 124 | entity_id: 125 | - switch.bug_zapper 126 | 127 | ########################################################## 128 | ## Turn On Bug Zapper when Returning Home 129 | ########################################################## 130 | 131 | - alias: Bug Zapper - Turn On Bug Zapper when Returning Home 132 | id: 'bug_zapper_turn_bug_zapper_when_returning_home' 133 | 134 | triggers: 135 | - trigger: state 136 | entity_id: group.household 137 | from: 'not_home' 138 | to: 'home' 139 | for: 140 | hours: 0 141 | minutes: 0 142 | seconds: 30 143 | 144 | conditions: 145 | - condition: state 146 | entity_id: switch.bug_zapper 147 | state: 'off' 148 | - condition: state 149 | entity_id: sun.sun 150 | state: 'below_horizon' 151 | - condition: not 152 | conditions: 153 | - condition: state 154 | entity_id: weather.REDACTED 155 | state: 'rainy' 156 | - condition: not 157 | conditions: 158 | - condition: state 159 | entity_id: weather.REDACTED 160 | state: 'lightning-rainy' 161 | - condition: not 162 | conditions: 163 | - condition: state 164 | entity_id: sensor.season 165 | state: 'winter' 166 | 167 | actions: 168 | - action: switch.turn_on 169 | target: 170 | entity_id: 171 | - switch.bug_zapper 172 | 173 | ########################################################## 174 | ## Turn On Bug Zapper when Returning Home before Sunset 175 | ########################################################## 176 | 177 | - alias: Bug Zapper - Turn On Bug Zapper when Returning Home before Sunset 178 | id: 'bug_zapper_turn_on_bug_zapper_when_returning_home_before_sunset' 179 | 180 | triggers: 181 | - trigger: state 182 | entity_id: group.household 183 | from: 'not_home' 184 | to: 'home' 185 | for: 186 | hours: 0 187 | minutes: 0 188 | seconds: 30 189 | 190 | conditions: 191 | - condition: state 192 | entity_id: switch.bug_zapper 193 | state: 'off' 194 | - condition: sun 195 | after: sunset 196 | after_offset: "-00:30:00" 197 | - condition: not 198 | conditions: 199 | - condition: state 200 | entity_id: weather.REDACTED 201 | state: 'rainy' 202 | - condition: not 203 | conditions: 204 | - condition: state 205 | entity_id: weather.REDACTED 206 | state: 'lightning-rainy' 207 | - condition: not 208 | conditions: 209 | - condition: state 210 | entity_id: sensor.season 211 | state: 'winter' 212 | 213 | actions: 214 | - action: switch.turn_on 215 | target: 216 | entity_id: 217 | - switch.bug_zapper 218 | -------------------------------------------------------------------------------- /automation/christmas.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Christmas Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Turn on Exterior Christmas Lights at Sunset 7 | ########################################################## 8 | 9 | - alias: Christmas - Turn on Exterior Christmas Lights at Sunset 10 | 11 | trigger: 12 | - platform: sun 13 | event: 'sunset' 14 | offset: '-00:15:00' 15 | 16 | condition: 17 | - condition: state 18 | entity_id: input_boolean.disable_exterior_on_sunset 19 | state: 'off' 20 | - condition: or 21 | conditions: 22 | - condition: state 23 | entity_id: input_select.holiday 24 | state: 'Christmas' 25 | - condition: state 26 | entity_id: sensor.holidays_calendar 27 | state: "New Year's Eve" 28 | 29 | action: 30 | - service: switch.turn_on 31 | entity_id: 32 | - switch.exterior_christmas_lights 33 | 34 | ########################################################## 35 | ## Turn Off Exterior Christmas Lights at 2a 36 | ########################################################## 37 | 38 | - alias: Christmas - Turn Off Exterior Christmas Lights at 2a 39 | 40 | trigger: 41 | - platform: time 42 | at: '02:00:00' 43 | 44 | action: 45 | - service: switch.turn_off 46 | entity_id: 47 | - switch.exterior_christmas_lights 48 | 49 | ########################################################## 50 | ## Turn Off Exterior Christmas Lights at Sunrise 51 | ########################################################## 52 | 53 | - alias: Christmas - Turn Off Exterior Christmas Lights at Sunrise 54 | 55 | trigger: 56 | - platform: sun 57 | event: 'sunrise' 58 | offset: '+00:15:00' 59 | 60 | action: 61 | - service: switch.turn_off 62 | entity_id: 63 | - switch.exterior_christmas_lights 64 | 65 | ########################################################## 66 | ## Turn off Christmas Lights after 2a 67 | ########################################################## 68 | 69 | - alias: Christmas - Turn off Christmas Lights after 2a 70 | 71 | trigger: 72 | - platform: state 73 | entity_id: switch.exterior_christmas_lights 74 | from: 'off' 75 | to: 'on' 76 | for: 77 | hours: 1 78 | minutes: 0 79 | seconds: 0 80 | 81 | condition: 82 | - condition: time 83 | after: '02:00' 84 | before: '07:30' 85 | - condition: state 86 | entity_id: group.household 87 | state: 'home' 88 | 89 | action: 90 | - service: switch.turn_off 91 | entity_id: 92 | - switch.exterior_christmas_lights 93 | 94 | ########################################################## 95 | ## Turn on Christmas Lights when Home 96 | ########################################################## 97 | 98 | - alias: Christmas - Turn on Christmas Lights when Home 99 | 100 | trigger: 101 | - platform: state 102 | entity_id: group.household 103 | from: 'not_home' 104 | to: 'home' 105 | 106 | condition: 107 | - condition: state 108 | entity_id: input_boolean.disable_home_away 109 | state: 'off' 110 | - condition: state 111 | entity_id: sun.sun 112 | state: 'below_horizon' 113 | - condition: state 114 | entity_id: switch.exterior_christmas_lights 115 | state: 'off' 116 | - condition: or 117 | conditions: 118 | - condition: state 119 | entity_id: input_select.holiday 120 | state: 'Christmas' 121 | - condition: state 122 | entity_id: sensor.holidays_calendar 123 | state: "New Year's Eve" 124 | - condition: or 125 | conditions: 126 | - condition: state 127 | entity_id: input_boolean.USER1_away 128 | state: 'on' 129 | - condition: state 130 | entity_id: input_boolean.USER2_away 131 | state: 'on' 132 | 133 | action: 134 | - service: switch.turn_on 135 | entity_id: 136 | - switch.exterior_christmas_lights 137 | 138 | ########################################################## 139 | ## Christmas Tree Away Mode 140 | ########################################################## 141 | 142 | - alias: Christmas - Tree Away Mode 143 | 144 | trigger: 145 | - platform: state 146 | entity_id: group.household 147 | from: 'home' 148 | to: 'not_home' 149 | for: 150 | hours: 0 151 | minutes: 1 152 | seconds: 0 153 | 154 | condition: 155 | - condition: state 156 | entity_id: input_boolean.disable_home_away 157 | state: 'off' 158 | - condition: state 159 | entity_id: switch.christmas_tree 160 | state: 'on' 161 | 162 | action: 163 | - service: switch.turn_off 164 | entity_id: 165 | - switch.christmas_tree 166 | 167 | ########################################################## 168 | ## Christmas Tree Home Mode 169 | ########################################################## 170 | 171 | - alias: Christmas - Tree Home Mode 172 | 173 | trigger: 174 | - platform: state 175 | entity_id: group.household 176 | from: 'not_home' 177 | to: 'home' 178 | for: 179 | hours: 0 180 | minutes: 0 181 | seconds: 45 182 | 183 | condition: 184 | - condition: state 185 | entity_id: input_boolean.disable_home_away 186 | state: 'off' 187 | - condition: state 188 | entity_id: sun.sun 189 | state: 'below_horizon' 190 | - condition: or 191 | conditions: 192 | - condition: state 193 | entity_id: input_boolean.USER1_away 194 | state: 'on' 195 | - condition: state 196 | entity_id: input_boolean.USER2_away 197 | state: 'on' 198 | - condition: state 199 | entity_id: switch.christmas_tree 200 | state: 'off' 201 | 202 | action: 203 | - service: switch.turn_on 204 | entity_id: 205 | - switch.christmas_tree 206 | 207 | ########################################################## 208 | ## Turn on Christmas Tree at Sunset 209 | ########################################################## 210 | 211 | - alias: Christmas - Turn on Christmas Tree at Sunset 212 | 213 | trigger: 214 | - platform: sun 215 | event: 'sunset' 216 | offset: '-00:30:00' 217 | 218 | condition: 219 | - condition: state 220 | entity_id: group.household 221 | state: 'home' 222 | - condition: state 223 | entity_id: input_boolean.disable_interior_lights_sunset 224 | state: 'off' 225 | - condition: state 226 | entity_id: switch.christmas_tree 227 | state: 'off' 228 | 229 | action: 230 | - service: switch.turn_on 231 | entity_id: 232 | - switch.christmas_tree 233 | 234 | ########################################################## 235 | ## Turn on Christmas Tree when Sun Below Horizon 236 | ########################################################## 237 | 238 | - alias: Christmas - Turn on Christmas Tree when Sun Below Horizon 239 | 240 | trigger: 241 | - platform: state 242 | entity_id: sun.sun 243 | from: 'above_horizon' 244 | to: 'below_horizon' 245 | 246 | condition: 247 | - condition: state 248 | entity_id: group.household 249 | state: 'home' 250 | - condition: state 251 | entity_id: input_boolean.disable_interior_lights_sunset 252 | state: 'off' 253 | - condition: state 254 | entity_id: switch.christmas_tree 255 | state: 'off' 256 | 257 | action: 258 | - service: switch.turn_on 259 | entity_id: 260 | - switch.christmas_tree 261 | 262 | ########################################################## 263 | ## Turn on Christmas Tree when USER2 Home 264 | ########################################################## 265 | 266 | - alias: Christmas - Turn on Tree when USER2 Home 267 | 268 | trigger: 269 | - platform: time 270 | at: '08:00:00' 271 | 272 | condition: 273 | - condition: state 274 | entity_id: person.USER2 275 | state: 'home' 276 | - condition: state 277 | entity_id: switch.christmas_tree 278 | state: 'off' 279 | 280 | action: 281 | - service: switch.turn_on 282 | entity_id: 283 | - switch.christmas_tree 284 | 285 | ########################################################## 286 | ## Turn off Christmas Tree when USER2 Leaves 287 | ########################################################## 288 | 289 | - alias: Christmas - Turn off Tree when USER2 Leaves 290 | 291 | trigger: 292 | - platform: state 293 | entity_id: person.USER2 294 | from: 'home' 295 | to: 'not_home' 296 | for: 297 | hours: 0 298 | minutes: 5 299 | seconds: 0 300 | 301 | condition: 302 | - condition: state 303 | entity_id: input_boolean.disable_home_away 304 | state: 'off' 305 | - condition: time 306 | after: '05:00' 307 | before: '15:00' 308 | - condition: state 309 | entity_id: person.USER1 310 | state: 'home' 311 | - condition: state 312 | entity_id: switch.christmas_tree 313 | state: 'on' 314 | 315 | action: 316 | - service: switch.turn_off 317 | entity_id: 318 | - switch.christmas_tree 319 | 320 | ########################################################## 321 | ## Turn on Christmas Tree when USER2 Arrives Home 322 | ########################################################## 323 | 324 | - alias: Christmas - Turn on Christmas Tree when USER2 Arrives Home 325 | 326 | trigger: 327 | - platform: state 328 | entity_id: person.USER2 329 | from: 'not_home' 330 | to: 'home' 331 | for: 332 | hours: 0 333 | minutes: 0 334 | seconds: 30 335 | 336 | condition: 337 | - condition: state 338 | entity_id: input_boolean.disable_home_away 339 | state: 'off' 340 | - condition: time 341 | after: '08:30' 342 | before: '18:00' 343 | - condition: state 344 | entity_id: input_boolean.USER2_away 345 | state: 'on' 346 | - condition: state 347 | entity_id: switch.christmas_tree 348 | state: 'off' 349 | 350 | action: 351 | - service: switch.turn_on 352 | entity_id: 353 | - switch.christmas_tree 354 | 355 | ########################################################## 356 | ## Plex Stopped Playing Christmas Tree On 357 | ########################################################## 358 | 359 | - alias: Christmas - Plex Stopped Playing Tree On 360 | 361 | trigger: 362 | - platform: state 363 | entity_id: media_player.plex_living_room_appletv 364 | to: 'paused' 365 | for: 366 | hours: 0 367 | minutes: 2 368 | seconds: 0 369 | - platform: state 370 | entity_id: media_player.plex_living_room_appletv 371 | to: 'idle' 372 | for: 373 | hours: 0 374 | minutes: 2 375 | seconds: 0 376 | 377 | condition: 378 | - condition: state 379 | entity_id: sun.sun 380 | state: 'below_horizon' 381 | - condition: state 382 | entity_id: input_boolean.disable_media_lights 383 | state: 'off' 384 | - condition: state 385 | entity_id: switch.christmas_tree 386 | state: 'off' 387 | 388 | action: 389 | - service: switch.turn_on 390 | entity_id: 391 | - switch.christmas_tree 392 | 393 | ########################################################## 394 | ## Plex Playing Christmas Tree Off 395 | ########################################################## 396 | 397 | - alias: Christmas - Plex Playing Tree Off 398 | 399 | trigger: 400 | - platform: state 401 | entity_id: media_player.plex_living_room_appletv 402 | to: 'playing' 403 | for: 404 | hours: 0 405 | minutes: 2 406 | seconds: 0 407 | 408 | condition: 409 | - condition: state 410 | entity_id: sun.sun 411 | state: 'below_horizon' 412 | - condition: state 413 | entity_id: input_boolean.disable_media_lights 414 | state: 'off' 415 | - condition: state 416 | entity_id: switch.christmas_tree 417 | state: 'on' 418 | 419 | action: 420 | - service: switch.turn_off 421 | entity_id: 422 | - switch.christmas_tree 423 | 424 | ########################################################## 425 | ## Late Night TV Watching before Midnight Christmas Tree on 426 | ########################################################## 427 | 428 | - alias: Christmas - Late Night TV Watching before Midnight Tree on 429 | 430 | trigger: 431 | - platform: state 432 | entity_id: media_player.living_room_apple_tv 433 | to: 'paused' 434 | for: 435 | hours: 0 436 | minutes: 3 437 | seconds: 0 438 | - platform: state 439 | entity_id: media_player.living_room_apple_tv 440 | to: 'idle' 441 | for: 442 | hours: 0 443 | minutes: 3 444 | seconds: 0 445 | 446 | condition: 447 | - condition: state 448 | entity_id: sun.sun 449 | state: 'below_horizon' 450 | - condition: state 451 | entity_id: input_boolean.disable_media_lights 452 | state: 'off' 453 | - condition: time 454 | after: '21:30' 455 | - condition: state 456 | entity_id: input_boolean.watching_plex 457 | state: 'off' 458 | - condition: state 459 | entity_id: select.living_room_tv_activities 460 | state: "Watch TV" 461 | - condition: state 462 | entity_id: switch.christmas_tree 463 | state: 'off' 464 | 465 | action: 466 | - service: switch.turn_on 467 | entity_id: 468 | - switch.christmas_tree 469 | 470 | ########################################################## 471 | ## Late Night TV Watching after Midnight Christmas Tree on 472 | ########################################################## 473 | 474 | - alias: Christmas - Late Night TV Watching after Midnight Tree on 475 | 476 | trigger: 477 | - platform: state 478 | entity_id: media_player.living_room_apple_tv 479 | to: 'paused' 480 | for: 481 | hours: 0 482 | minutes: 3 483 | seconds: 0 484 | - platform: state 485 | entity_id: media_player.living_room_apple_tv 486 | to: 'idle' 487 | for: 488 | hours: 0 489 | minutes: 3 490 | seconds: 0 491 | 492 | condition: 493 | - condition: state 494 | entity_id: sun.sun 495 | state: 'below_horizon' 496 | - condition: state 497 | entity_id: input_boolean.disable_media_lights 498 | state: 'off' 499 | - condition: time 500 | after: '00:00' 501 | before: '03:00' 502 | - condition: state 503 | entity_id: input_boolean.watching_plex 504 | state: 'off' 505 | - condition: state 506 | entity_id: select.living_room_tv_activities 507 | state: "Watch TV" 508 | - condition: state 509 | entity_id: switch.christmas_tree 510 | state: 'off' 511 | 512 | action: 513 | - service: switch.turn_on 514 | entity_id: 515 | - switch.christmas_tree 516 | 517 | ########################################################## 518 | ## Late Night TV Watching after Midnight Christmas Tree On 519 | ########################################################## 520 | 521 | - alias: Christmas - Late Night TV Watching after Midnight Tree On 522 | 523 | trigger: 524 | - platform: state 525 | entity_id: media_player.living_room_apple_tv 526 | to: 'paused' 527 | for: 528 | hours: 0 529 | minutes: 3 530 | seconds: 0 531 | - platform: state 532 | entity_id: media_player.living_room_apple_tv 533 | to: 'idle' 534 | for: 535 | hours: 0 536 | minutes: 3 537 | seconds: 0 538 | 539 | condition: 540 | - condition: state 541 | entity_id: sun.sun 542 | state: 'below_horizon' 543 | - condition: state 544 | entity_id: input_boolean.disable_media_lights 545 | state: 'off' 546 | - condition: time 547 | after: '00:00' 548 | before: '03:00' 549 | - condition: state 550 | entity_id: input_boolean.watching_plex 551 | state: 'off' 552 | - condition: state 553 | entity_id: switch.christmas_tree 554 | state: 'off' 555 | 556 | action: 557 | - service: switch.turn_on 558 | entity_id: 559 | - switch.christmas_tree 560 | 561 | ########################################################## 562 | ## Late Night TV Watching after Midnight Christmas Tree off 563 | ########################################################## 564 | 565 | - alias: Christmas - Late Night TV Watching after Midnight Tree off 566 | 567 | trigger: 568 | - platform: state 569 | entity_id: media_player.living_room_apple_tv 570 | to: 'playing' 571 | for: 572 | hours: 0 573 | minutes: 2 574 | seconds: 0 575 | 576 | condition: 577 | - condition: state 578 | entity_id: sun.sun 579 | state: 'below_horizon' 580 | - condition: state 581 | entity_id: input_boolean.disable_media_lights 582 | state: 'off' 583 | - condition: time 584 | after: '00:00' 585 | before: '03:00' 586 | - condition: state 587 | entity_id: input_boolean.watching_plex 588 | state: 'off' 589 | - condition: state 590 | entity_id: select.living_room_tv_activities 591 | state: "Watch TV" 592 | - condition: state 593 | entity_id: switch.christmas_tree 594 | state: 'on' 595 | 596 | action: 597 | - service: switch.turn_off 598 | entity_id: 599 | - switch.christmas_tree 600 | 601 | ########################################################## 602 | ## Late Night TV Watching before Midnight Christmas Tree Off 603 | ########################################################## 604 | 605 | - alias: Christmas - Late Night TV Watching before Midnight Tree Off 606 | 607 | trigger: 608 | - platform: state 609 | entity_id: media_player.living_room_apple_tv 610 | to: 'playing' 611 | for: 612 | hours: 0 613 | minutes: 2 614 | seconds: 0 615 | 616 | condition: 617 | - condition: state 618 | entity_id: sun.sun 619 | state: 'below_horizon' 620 | - condition: state 621 | entity_id: input_boolean.disable_media_lights 622 | state: 'off' 623 | - condition: time 624 | after: '21:30' 625 | - condition: state 626 | entity_id: input_boolean.watching_plex 627 | state: 'off' 628 | - condition: state 629 | entity_id: select.living_room_tv_activities 630 | state: "Watch TV" 631 | - condition: state 632 | entity_id: switch.christmas_tree 633 | state: 'on' 634 | 635 | action: 636 | - service: switch.turn_off 637 | entity_id: 638 | - switch.christmas_tree 639 | 640 | ########################################################## 641 | ## Christmas Tree Bedtime 642 | ########################################################## 643 | 644 | - alias: Christmas - Tree Bedtime 645 | 646 | trigger: 647 | - platform: state 648 | entity_id: input_boolean.bedtime 649 | to: 'on' 650 | for: 651 | hours: 0 652 | minutes: 2 653 | seconds: 0 654 | 655 | condition: 656 | - condition: state 657 | entity_id: switch.christmas_tree 658 | state: 'on' 659 | 660 | action: 661 | - service: switch.turn_off 662 | entity_id: 663 | - switch.christmas_tree 664 | 665 | ########################################################## 666 | ## Turn off Christmas Tree When Playing Xbox 667 | ########################################################## 668 | 669 | - alias: Christmas - Turn off Christmas Tree When Playing Xbox 670 | 671 | trigger: 672 | - platform: state 673 | entity_id: select.living_room_tv_activities 674 | to: 'Play Xbox' 675 | for: 676 | hours: 0 677 | minutes: 2 678 | seconds: 0 679 | 680 | condition: 681 | - condition: state 682 | entity_id: group.household 683 | state: 'home' 684 | - condition: state 685 | entity_id: person.USER1 686 | state: 'home' 687 | - condition: not 688 | conditions: 689 | - condition: state 690 | entity_id: group.friends_and_family 691 | state: 'home' 692 | - condition: state 693 | entity_id: sun.sun 694 | state: 'below_horizon' 695 | - condition: time 696 | after: '21:00:00' 697 | before: '05:00:00' 698 | - condition: state 699 | entity_id: switch.christmas_tree 700 | state: 'on' 701 | 702 | action: 703 | - service: switch.turn_off 704 | entity_id: 705 | - switch.christmas_tree 706 | 707 | ########################################################## 708 | ## Turn on Christmas Tree When Done Playing Xbox 709 | ########################################################## 710 | 711 | - alias: Christmas - Turn on Christmas Tree When Done Playing Xbox 712 | 713 | trigger: 714 | - platform: state 715 | entity_id: select.living_room_tv_activities 716 | from: 'Play Xbox' 717 | for: 718 | hours: 0 719 | minutes: 0 720 | seconds: 30 721 | 722 | condition: 723 | - condition: state 724 | entity_id: group.household 725 | state: 'home' 726 | - condition: state 727 | entity_id: person.USER1 728 | state: 'home' 729 | - condition: state 730 | entity_id: sun.sun 731 | state: 'below_horizon' 732 | - condition: time 733 | after: '21:00:00' 734 | before: '05:00:00' 735 | - condition: state 736 | entity_id: switch.christmas_tree 737 | state: 'off' 738 | 739 | action: 740 | - service: switch.turn_on 741 | entity_id: 742 | - switch.christmas_tree -------------------------------------------------------------------------------- /automation/doors.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Door Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Turn On Front Porch Lights when Front Door Opens 7 | ########################################################## 8 | 9 | - alias: Doors - Turn On Front Porch Lights when Front Door Opens 10 | id: 'doors_turn_on_front_porch_lights_when_front_door_opens' 11 | 12 | triggers: 13 | - trigger: state 14 | entity_id: binary_sensor.front_door_opened 15 | from: 'off' 16 | to: 'on' 17 | 18 | conditions: 19 | - condition: state 20 | entity_id: sun.sun 21 | state: 'below_horizon' 22 | - condition: state 23 | entity_id: input_boolean.disable_door_open_lights_on 24 | state: 'off' 25 | 26 | actions: 27 | - action: light.turn_on 28 | target: 29 | entity_id: 30 | - light.front_porch 31 | data: 32 | brightness_pct: 100 33 | 34 | ########################################################## 35 | ## Reset Front Porch Lights Brightness when Front Door Closes 36 | ########################################################## 37 | 38 | - alias: Doors - Reset Front Porch Lights Brightness when Front Door Closes 39 | id: 'doors_reset_front_porch_lights_brightness_when_front_door_closes' 40 | 41 | triggers: 42 | - trigger: state 43 | entity_id: binary_sensor.front_door_opened 44 | from: 'on' 45 | to: 'off' 46 | for: 47 | hours: 0 48 | minutes: 5 49 | seconds: 0 50 | 51 | conditions: 52 | - condition: state 53 | entity_id: sun.sun 54 | state: 'below_horizon' 55 | - condition: state 56 | entity_id: input_boolean.disable_door_open_lights_on 57 | state: 'off' 58 | - condition: state 59 | entity_id: group.household 60 | state: 'home' 61 | - condition: state 62 | entity_id: input_select.holiday 63 | state: 'None' 64 | 65 | actions: 66 | - action: light.turn_on 67 | target: 68 | entity_id: 69 | - light.front_porch 70 | data: 71 | brightness_pct: 50 72 | transition: 120 73 | 74 | ########################################################## 75 | ## Turn Off Front Porch Lights when Front Door Closes between 12-5a 76 | ########################################################## 77 | 78 | - alias: Doors - Turn Off Front Porch Lights when Front Door Closes between 12-5a 79 | id: 'doors_turn_off_front_porch_lights_when_front_door_closes_between_12_5a' 80 | 81 | triggers: 82 | - trigger: state 83 | entity_id: binary_sensor.front_door_opened 84 | from: 'on' 85 | to: 'off' 86 | for: 87 | hours: 0 88 | minutes: 15 89 | seconds: 0 90 | 91 | conditions: 92 | - condition: time 93 | after: '00:00:00' 94 | before: '05:00:00' 95 | - condition: state 96 | entity_id: input_boolean.disable_door_open_lights_on 97 | state: 'off' 98 | - condition: state 99 | entity_id: group.household 100 | state: 'home' 101 | - condition: state 102 | entity_id: input_select.holiday 103 | state: 'None' 104 | 105 | actions: 106 | - action: light.turn_off 107 | target: 108 | entity_id: 109 | - light.front_porch 110 | data: 111 | transition: 900 112 | 113 | ########################################################## 114 | ## Turn On Living Room Lights when Front Door Opens 115 | ########################################################## 116 | 117 | - alias: Doors - Turn On Living Room Lights when Front Door Opens 118 | id: 'doors_turn_on_living_room_lights_when_front_door_opens' 119 | 120 | triggers: 121 | - trigger: state 122 | entity_id: binary_sensor.front_door_opened 123 | from: 'off' 124 | to: 'on' 125 | 126 | conditions: 127 | - condition: state 128 | entity_id: sun.sun 129 | state: 'below_horizon' 130 | - condition: state 131 | entity_id: input_boolean.disable_door_open_lights_on 132 | state: 'off' 133 | - condition: state 134 | entity_id: light.living_room_accent_lights 135 | state: 'off' 136 | 137 | actions: 138 | - action: light.turn_on 139 | target: 140 | entity_id: 141 | - light.living_room_accent_lights 142 | 143 | ########################################################## 144 | ## Turn On Back Door Lights when Back Door Opens 145 | ########################################################## 146 | 147 | - alias: Doors - Turn On Back Door Lights when Back Door Opens 148 | id: 'doors_turn_on_back_door_lights_when_back_door_opens' 149 | 150 | triggers: 151 | - trigger: state 152 | entity_id: binary_sensor.back_door_opened 153 | from: 'off' 154 | to: 'on' 155 | 156 | conditions: 157 | - condition: state 158 | entity_id: sun.sun 159 | state: 'below_horizon' 160 | - condition: state 161 | entity_id: input_boolean.disable_door_open_lights_on 162 | state: 'off' 163 | 164 | actions: 165 | - action: light.turn_on 166 | target: 167 | entity_id: 168 | - light.back_door 169 | data: 170 | brightness_pct: 100 171 | 172 | ########################################################## 173 | ## Reset Back Door Lights Brightness when Back Door Closes 174 | ########################################################## 175 | 176 | - alias: Doors - Reset Back Door Lights Brightness when Back Door Closes 177 | id: 'doors_reset_back_door_lights_brightness_when_back_door_closes' 178 | 179 | triggers: 180 | - trigger: state 181 | entity_id: binary_sensor.back_door_opened 182 | from: 'on' 183 | to: 'off' 184 | for: 185 | hours: 0 186 | minutes: 10 187 | seconds: 0 188 | 189 | conditions: 190 | - condition: state 191 | entity_id: sun.sun 192 | state: 'below_horizon' 193 | - condition: state 194 | entity_id: input_boolean.disable_door_open_lights_on 195 | state: 'off' 196 | 197 | actions: 198 | - action: light.turn_on 199 | target: 200 | entity_id: 201 | - light.back_door 202 | data: 203 | brightness_pct: 2 204 | transition: 300 205 | 206 | ########################################################## 207 | ## Turn Off Back Door Lights when Back Door Closes between 12-5a 208 | ########################################################## 209 | 210 | - alias: Doors - Turn Off Back Door Lights when Back Door Closes between 12-5a 211 | id: 'doors_turn_off_back_door_lights_when_back_door_closes_between_12_5a' 212 | 213 | triggers: 214 | - trigger: state 215 | entity_id: binary_sensor.back_door_opened 216 | from: 'on' 217 | to: 'off' 218 | for: 219 | hours: 0 220 | minutes: 17 221 | seconds: 0 222 | 223 | conditions: 224 | - condition: time 225 | after: '00:00:00' 226 | before: '05:00:00' 227 | - condition: state 228 | entity_id: input_boolean.disable_door_open_lights_on 229 | state: 'off' 230 | - condition: state 231 | entity_id: group.household 232 | state: 'home' 233 | - condition: state 234 | entity_id: input_boolean.guest_mode 235 | state: 'off' 236 | 237 | actions: 238 | - action: light.turn_off 239 | target: 240 | entity_id: 241 | - light.back_door 242 | data: 243 | transition: 900 244 | 245 | ########################################################## 246 | ## Turn On Basement Lights when Basement Door Opens and Lights Off 247 | ########################################################## 248 | 249 | - alias: Doors - Turn On Basement Lights when Basement Door Opens and Lights Off 250 | id: 'doors_turn_on_basement_lights_when_basement_door_opens_and_lights_off' 251 | 252 | triggers: 253 | - trigger: state 254 | entity_id: binary_sensor.basement_door_opened 255 | from: 'off' 256 | to: 'on' 257 | 258 | conditions: 259 | - condition: state 260 | entity_id: light.basement_lighting 261 | state: 'off' 262 | - condition: state 263 | entity_id: sun.sun 264 | state: 'below_horizon' 265 | - condition: state 266 | entity_id: input_boolean.disable_door_open_lights_on 267 | state: 'off' 268 | - condition: state 269 | entity_id: group.household 270 | state: 'home' 271 | 272 | actions: 273 | - action: light.turn_on 274 | target: 275 | entity_id: 276 | - light.basement_lights 277 | data: 278 | brightness_pct: 100 279 | - action: light.turn_on 280 | target: 281 | entity_id: 282 | - light.basement_stairs 283 | data: 284 | brightness_pct: 100 285 | - action: light.turn_on 286 | target: 287 | entity_id: 288 | - light.laundry_room_light 289 | - action: light.turn_on 290 | target: 291 | entity_id: 292 | - light.basement_lamp 293 | data: 294 | brightness_pct: 100 295 | - action: light.turn_on 296 | target: 297 | entity_id: 298 | - light.work_bench_light 299 | data: 300 | brightness_pct: 2 301 | 302 | ################################################################# 303 | ## Notifications 304 | ################################################################# 305 | 306 | ########################################################## 307 | ## Door Low Battery Notification 308 | ########################################################## 309 | 310 | - alias: Doors - Low Battery Notification 311 | id: 'doors_low_battery_notification' 312 | 313 | mode: parallel 314 | triggers: 315 | - trigger: numeric_state 316 | entity_id: 317 | - sensor.front_door_sensor_batt 318 | - sensor.back_door_sensor_batt 319 | - sensor.basement_door_sensor_batt 320 | below: 30 321 | for: 322 | hours: 1 323 | minutes: 0 324 | seconds: 0 325 | 326 | conditions: 327 | - condition: state 328 | entity_id: input_boolean.disable_notifications 329 | state: 'off' 330 | 331 | actions: 332 | - action: notify.USER1_devices 333 | data: 334 | message: "{{ trigger.to_state.attributes.friendly_name }} Low" -------------------------------------------------------------------------------- /automation/energy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Energy 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Set Winter Rate First 750 7 | ########################################################## 8 | 9 | - alias: Energy - Set Winter Rate First 750 10 | id: 'energy_set_winter_rate_first_750' 11 | 12 | trigger: 13 | - trigger: state 14 | entity_id: 15 | - sensor.monthly_electric 16 | 17 | conditions: 18 | - condition: template 19 | value_template: "{{ now().month in [1,2,3,4,5,10,11,12] }}" 20 | - condition: template 21 | value_template: '{{ trigger.to_state.state | float(0) < 750000 }}' 22 | - condition: not 23 | conditions: 24 | - condition: state 25 | entity_id: select.monthly_electric 26 | state: "Winter Rate First 750" 27 | 28 | actions: 29 | - action: select.select_option 30 | data: 31 | entity_id: select.monthly_electric 32 | option: "Winter Rate First 750" 33 | 34 | ########################################################## 35 | ## Set Winter Rate Over 750 36 | ########################################################## 37 | 38 | - alias: Energy - Set Winter Rate Over 750 39 | id: 'energy_set_winter_rate_over_750' 40 | 41 | trigger: 42 | - trigger: state 43 | entity_id: 44 | - sensor.monthly_electric 45 | 46 | conditions: 47 | - condition: template 48 | value_template: "{{ now().month in [1,2,3,4,5,10,11,12] }}" 49 | - condition: template 50 | value_template: '{{ trigger.to_state.state | float(0) > 749999 }}' 51 | - condition: not 52 | conditions: 53 | - condition: state 54 | entity_id: select.monthly_electric 55 | state: "Winter Rate Over 750" 56 | 57 | actions: 58 | - action: select.select_option 59 | data: 60 | entity_id: select.monthly_electric 61 | option: "Winter Rate Over 750" 62 | 63 | ########################################################## 64 | ## Set Summer Rate 65 | ########################################################## 66 | 67 | - alias: Energy - Set Summer Rate 68 | id: 'energy_set_summer_rate' 69 | 70 | trigger: 71 | - trigger: state 72 | entity_id: 73 | - sensor.monthly_electric 74 | 75 | conditions: 76 | - condition: template 77 | value_template: "{{ now().month in [6,7,8,9] }}" 78 | - condition: not 79 | conditions: 80 | - condition: state 81 | entity_id: select.monthly_electric 82 | state: "Summer Rate" 83 | 84 | actions: 85 | - action: select.select_option 86 | data: 87 | entity_id: select.monthly_electric 88 | option: "Summer Rate" 89 | 90 | ########################################################## 91 | ## Turn Off USER1 Electric Bike Chargers when Not Charging 92 | ########################################################## 93 | 94 | - alias: Energy - Turn Off USER1 Electric Bike Chargers when Not Charging 95 | id: 'energy_turn_off_USER1_ebike_chargers_when_not_charging' 96 | 97 | trigger: 98 | - trigger: numeric_state 99 | entity_id: sensor.USER1s_bike_charger_current_consumption 100 | below: 1 101 | for: 102 | hours: 0 103 | minutes: 30 104 | seconds: 0 105 | 106 | conditions: 107 | - condition: state 108 | entity_id: switch.USER1s_bike_charger 109 | state: 'on' 110 | 111 | actions: 112 | - action: switch.turn_off 113 | data: 114 | entity_id: switch.USER1s_bike_charger 115 | 116 | ########################################################## 117 | ## Turn Off USER2 Electric Bike Chargers when Not Charging 118 | ########################################################## 119 | 120 | - alias: Energy - Turn Off USER2 Electric Bike Chargers when Not Charging 121 | id: 'energy_turn_off_USER2_ebike_chargers_when_not_charging' 122 | 123 | trigger: 124 | - trigger: numeric_state 125 | entity_id: sensor.USER2s_bike_charger_current_consumption 126 | below: 1 127 | for: 128 | hours: 0 129 | minutes: 30 130 | seconds: 0 131 | 132 | conditions: 133 | - condition: state 134 | entity_id: switch.USER2s_bike_charger 135 | state: 'on' 136 | 137 | actions: 138 | - action: switch.turn_off 139 | data: 140 | entity_id: switch.USER2s_bike_charger -------------------------------------------------------------------------------- /automation/fountain.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Fountain Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Fountain Off When Away 7 | ########################################################## 8 | 9 | - alias: Fountain - Fountain Off When Away 10 | id: 'fountain_off_when_away' 11 | 12 | triggers: 13 | - trigger: state 14 | entity_id: group.household 15 | from: 'home' 16 | to: 'not_home' 17 | for: 18 | hours: 0 19 | minutes: 3 20 | seconds: 0 21 | 22 | conditions: 23 | - condition: state 24 | entity_id: input_boolean.disable_fountain 25 | state: 'off' 26 | - condition: state 27 | entity_id: switch.fountain 28 | state: 'on' 29 | 30 | actions: 31 | - action: switch.turn_off 32 | target: 33 | entity_id: 34 | - switch.fountain 35 | - switch.fountain_lights 36 | 37 | ########################################################## 38 | ## Fountain On When Home 39 | ########################################################## 40 | 41 | - alias: Fountain - Fountain On When Home 42 | id: 'fountain_on_when_home' 43 | 44 | triggers: 45 | - trigger: state 46 | entity_id: group.household 47 | from: 'not_home' 48 | to: 'home' 49 | for: 50 | hours: 0 51 | minutes: 1 52 | seconds: 0 53 | 54 | conditions: 55 | - condition: state 56 | entity_id: input_boolean.disable_fountain 57 | state: 'off' 58 | - condition: time 59 | after: '12:00:00' 60 | before: '23:59:00' 61 | - condition: state 62 | entity_id: switch.fountain 63 | state: 'off' 64 | - condition: numeric_state 65 | entity_id: sensor.REDACTED_temperature 66 | above: 39 67 | - condition: not 68 | conditions: 69 | - condition: state 70 | entity_id: weather.REDACTED 71 | state: 'rainy' 72 | - condition: not 73 | conditions: 74 | - condition: state 75 | entity_id: weather.REDACTED 76 | state: 'lightning-rainy' 77 | - condition: not 78 | conditions: 79 | - condition: state 80 | entity_id: sensor.season 81 | state: 'winter' 82 | 83 | actions: 84 | - action: switch.turn_on 85 | target: 86 | entity_id: 87 | - switch.fountain 88 | 89 | ########################################################## 90 | ## Fountain Lights On When Home Before Sunset 91 | ########################################################## 92 | 93 | - alias: Fountain - Lights On When Home Before Sunset 94 | id: 'fountain_lights_on_when_home_before_sunset' 95 | 96 | triggers: 97 | - trigger: state 98 | entity_id: group.household 99 | from: 'not_home' 100 | to: 'home' 101 | 102 | conditions: 103 | - condition: state 104 | entity_id: input_boolean.disable_fountain 105 | state: 'off' 106 | - condition: state 107 | entity_id: switch.fountain 108 | state: 'on' 109 | - condition: state 110 | entity_id: switch.fountain_lights 111 | state: 'off' 112 | - condition: sun 113 | after: sunset 114 | after_offset: "-00:15:00" 115 | 116 | actions: 117 | - action: switch.turn_on 118 | target: 119 | entity_id: 120 | - switch.fountain_lights 121 | 122 | ########################################################## 123 | ## Turn on Fountain Lights at Sunset 124 | ########################################################## 125 | 126 | - alias: Fountain - Turn on Lights at Sunset 127 | id: 'fountain_turn_on_lights_at_sunset' 128 | 129 | triggers: 130 | - trigger: sun 131 | event: 'sunset' 132 | offset: '-00:15:00' 133 | 134 | conditions: 135 | - condition: state 136 | entity_id: input_boolean.disable_fountain 137 | state: 'off' 138 | - condition: state 139 | entity_id: group.household 140 | state: 'home' 141 | - condition: state 142 | entity_id: switch.fountain 143 | state: 'on' 144 | 145 | actions: 146 | - action: switch.turn_on 147 | target: 148 | entity_id: 149 | - switch.fountain_lights 150 | 151 | ########################################################## 152 | ## Turn on Fountain Lights when Fountain on at Night 153 | ########################################################## 154 | 155 | - alias: Fountain - Turn on Lights when Fountain on at Night 156 | id: 'fountain_turn_on_lights_when_fountain_on_at_night' 157 | 158 | triggers: 159 | - trigger: state 160 | entity_id: switch.fountain 161 | to: 'on' 162 | 163 | conditions: 164 | - condition: state 165 | entity_id: input_boolean.disable_fountain 166 | state: 'off' 167 | - condition: state 168 | entity_id: group.household 169 | state: 'home' 170 | - condition: state 171 | entity_id: switch.fountain_lights 172 | state: 'off' 173 | - condition: state 174 | entity_id: sun.sun 175 | state: 'below_horizon' 176 | 177 | actions: 178 | - action: switch.turn_on 179 | target: 180 | entity_id: 181 | - switch.fountain_lights 182 | 183 | ########################################################## 184 | ## Turn off Fountain Lights when Fountain turns off 185 | ########################################################## 186 | 187 | - alias: Fountain - Turn off Lights when Fountain turns off 188 | id: 'fountain_turn_off_lights_when_fountain_turns_off' 189 | 190 | triggers: 191 | - trigger: state 192 | entity_id: switch.fountain 193 | to: 'off' 194 | 195 | conditions: 196 | - condition: state 197 | entity_id: input_boolean.disable_fountain 198 | state: 'off' 199 | - condition: state 200 | entity_id: group.household 201 | state: 'home' 202 | - condition: state 203 | entity_id: switch.fountain_lights 204 | state: 'on' 205 | 206 | actions: 207 | - action: switch.turn_off 208 | target: 209 | entity_id: 210 | - switch.fountain_lights 211 | 212 | ########################################################## 213 | ## Turn On Fountain Daily 214 | ########################################################## 215 | 216 | - alias: Fountain - Turn On Daily 217 | id: 'fountain_turn_on_daily' 218 | 219 | triggers: 220 | - trigger: time 221 | at: '10:00:00' 222 | 223 | conditions: 224 | - condition: state 225 | entity_id: input_boolean.disable_fountain 226 | state: 'off' 227 | - condition: state 228 | entity_id: switch.fountain 229 | state: 'off' 230 | - condition: state 231 | entity_id: group.household 232 | state: 'home' 233 | - condition: numeric_state 234 | entity_id: sensor.REDACTED_temperature 235 | above: 39 236 | - condition: not 237 | conditions: 238 | - condition: state 239 | entity_id: weather.REDACTED 240 | state: 'rainy' 241 | - condition: not 242 | conditions: 243 | - condition: state 244 | entity_id: weather.REDACTED 245 | state: 'lightning-rainy' 246 | - condition: not 247 | conditions: 248 | - condition: state 249 | entity_id: sensor.season 250 | state: 'winter' 251 | 252 | actions: 253 | - action: switch.turn_on 254 | target: 255 | entity_id: 256 | - switch.fountain 257 | 258 | ########################################################## 259 | ## Turn Off Fountain at Midnight 260 | ########################################################## 261 | 262 | - alias: Fountain - Turn Off at Midnight 263 | id: 'fountain_turn_off_at_midnight' 264 | 265 | triggers: 266 | - trigger: time 267 | at: '23:59:00' 268 | 269 | conditions: 270 | - condition: state 271 | entity_id: input_boolean.disable_fountain 272 | state: 'off' 273 | - condition: state 274 | entity_id: switch.fountain 275 | state: 'on' 276 | - condition: state 277 | entity_id: input_boolean.guest_mode 278 | state: 'off' 279 | 280 | actions: 281 | - action: switch.turn_off 282 | target: 283 | entity_id: 284 | - switch.fountain 285 | - switch.fountain_lights 286 | 287 | ########################################################## 288 | ## Turn Off Fountain When Raining 289 | ########################################################## 290 | 291 | - alias: Fountain - Turn Off When Raining 292 | id: 'fountain_turn_off_when_raining' 293 | 294 | triggers: 295 | - trigger: state 296 | entity_id: weather.REDACTED 297 | to: 'rainy' 298 | for: 299 | hours: 1 300 | minutes: 0 301 | seconds: 0 302 | - trigger: state 303 | entity_id: weather.REDACTED 304 | to: 'lightning-rainy' 305 | for: 306 | hours: 1 307 | minutes: 0 308 | seconds: 0 309 | 310 | conditions: 311 | - condition: state 312 | entity_id: input_boolean.disable_fountain 313 | state: 'off' 314 | - condition: state 315 | entity_id: switch.fountain 316 | state: 'on' 317 | - condition: state 318 | entity_id: group.household 319 | state: 'home' 320 | 321 | actions: 322 | - action: switch.turn_off 323 | target: 324 | entity_id: 325 | - switch.fountain 326 | 327 | ########################################################## 328 | ## Turn On Fountain When Done Raining 329 | ########################################################## 330 | 331 | - alias: Fountain - Turn On When Done Raining 332 | id: 'fountain_turn_on_when_done_raining' 333 | 334 | triggers: 335 | - trigger: state 336 | entity_id: weather.REDACTED 337 | from: 'rainy' 338 | for: 339 | hours: 1 340 | minutes: 0 341 | seconds: 0 342 | - trigger: state 343 | entity_id: weather.REDACTED 344 | from: 'lightning-rainy' 345 | for: 346 | hours: 1 347 | minutes: 0 348 | seconds: 0 349 | 350 | conditions: 351 | - condition: state 352 | entity_id: input_boolean.disable_fountain 353 | state: 'off' 354 | - condition: state 355 | entity_id: switch.fountain 356 | state: 'off' 357 | - condition: state 358 | entity_id: group.household 359 | state: 'home' 360 | - condition: time 361 | after: '12:00:00' 362 | before: '23:59:00' 363 | - condition: numeric_state 364 | entity_id: sensor.REDACTED_temperature 365 | above: 39 366 | - condition: not 367 | conditions: 368 | - condition: state 369 | entity_id: weather.REDACTED 370 | state: 'rainy' 371 | - condition: not 372 | conditions: 373 | - condition: state 374 | entity_id: weather.REDACTED 375 | state: 'lightning-rainy' 376 | - condition: not 377 | conditions: 378 | - condition: state 379 | entity_id: sensor.season 380 | state: 'winter' 381 | 382 | actions: 383 | - action: switch.turn_on 384 | target: 385 | entity_id: 386 | - switch.fountain 387 | 388 | ########################################################## 389 | ## Turn Off Fountain When Cold 390 | ########################################################## 391 | 392 | - alias: Fountain - Turn Off When Cold 393 | id: 'fountain_turn_off_when_cold' 394 | 395 | triggers: 396 | - trigger: numeric_state 397 | entity_id: sensor.REDACTED_temperature 398 | below: 38 399 | for: 400 | hours: 0 401 | minutes: 30 402 | seconds: 0 403 | 404 | conditions: 405 | - condition: state 406 | entity_id: switch.fountain 407 | state: 'on' 408 | 409 | actions: 410 | - action: switch.turn_off 411 | target: 412 | entity_id: 413 | - switch.fountain 414 | - action: notify.USER1_devices 415 | data: 416 | message: Cold Outside Shutting Off Fountain 417 | data: 418 | tag: fountain -------------------------------------------------------------------------------- /automation/garage.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Garage Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Household Away Mode Close Garage 7 | ########################################################## 8 | 9 | - alias: Garage - Household Away Mode Close Garage 10 | id: 'garage_household_away_mode_close_garage' 11 | 12 | triggers: 13 | - trigger: state 14 | entity_id: group.household 15 | from: 'home' 16 | to: 'not_home' 17 | for: 18 | hours: 0 19 | minutes: 3 20 | seconds: 0 21 | 22 | conditions: 23 | - condition: state 24 | entity_id: input_boolean.disable_auto_garage 25 | state: 'off' 26 | - condition: state 27 | entity_id: cover.garage_door 28 | state: 'open' 29 | - condition: state 30 | entity_id: input_boolean.garage_door_motor 31 | state: 'off' 32 | 33 | actions: 34 | - action: lifx.effect_pulse 35 | data: 36 | cycles: 5 37 | power_on: true 38 | brightness_pct: 100 39 | target: 40 | entity_id: light.garage_interior 41 | - delay: '00:00:05' 42 | - action: cover.close_cover 43 | entity_id: cover.garage_door 44 | 45 | ########################################################## 46 | ## Close Garage Door when USER1 Leaves 47 | ########################################################## 48 | 49 | - alias: Garage - Close Garage when USER1 Leaves 50 | id: 'garage_close_garage_when_USER1_leaves' 51 | 52 | triggers: 53 | - trigger: state 54 | entity_id: input_boolean.USER1_away 55 | from: 'off' 56 | to: 'on' 57 | for: 58 | hours: 0 59 | minutes: 1 60 | seconds: 0 61 | 62 | conditions: 63 | - condition: state 64 | entity_id: input_boolean.garage_door_motor 65 | state: 'off' 66 | - condition: state 67 | entity_id: input_boolean.disable_auto_garage 68 | state: 'off' 69 | - condition: state 70 | entity_id: cover.garage_door 71 | state: 'open' 72 | 73 | actions: 74 | - action: lifx.effect_pulse 75 | data: 76 | cycles: 5 77 | power_on: true 78 | brightness_pct: 100 79 | target: 80 | entity_id: light.garage_interior 81 | - delay: '00:00:05' 82 | - action: cover.close_cover 83 | entity_id: cover.garage_door 84 | 85 | ########################################################## 86 | ## Close Garage Door when USER2 Leaves 87 | ########################################################## 88 | 89 | - alias: Garage - Close Garage when USER2 Leaves 90 | id: 'garage_close_garage_when_USER2_leaves' 91 | 92 | triggers: 93 | - trigger: state 94 | entity_id: input_boolean.USER2_away 95 | from: 'off' 96 | to: 'on' 97 | 98 | conditions: 99 | - condition: state 100 | entity_id: input_boolean.garage_door_motor 101 | state: 'off' 102 | - condition: state 103 | entity_id: input_boolean.disable_auto_garage 104 | state: 'off' 105 | - condition: state 106 | entity_id: cover.garage_door 107 | state: 'open' 108 | 109 | actions: 110 | - action: lifx.effect_pulse 111 | data: 112 | cycles: 5 113 | power_on: true 114 | brightness_pct: 100 115 | target: 116 | entity_id: light.garage_interior 117 | - delay: '00:00:05' 118 | - action: cover.close_cover 119 | entity_id: cover.garage_door 120 | 121 | ########################################################## 122 | ## USER1 Home from Driving Open Garage Door 123 | ########################################################## 124 | 125 | - alias: Garage - USER1 Home from Driving Open Garage Door 126 | id: 'garage_USER1_home_from_driving_open_garage_door' 127 | 128 | triggers: 129 | - trigger: state 130 | entity_id: person.USER1 131 | from: 'not_home' 132 | to: 'home' 133 | 134 | conditions: 135 | - condition: state 136 | entity_id: input_boolean.garage_door_motor 137 | state: 'off' 138 | - condition: state 139 | entity_id: input_boolean.disable_auto_garage 140 | state: 'off' 141 | - condition: state 142 | entity_id: input_boolean.USER1_away 143 | state: 'on' 144 | - condition: state 145 | entity_id: input_boolean.USER1_away_driving 146 | state: 'on' 147 | - condition: state 148 | entity_id: cover.garage_door 149 | state: 'closed' 150 | 151 | actions: 152 | - action: cover.open_cover 153 | entity_id: cover.garage_door 154 | 155 | ########################################################## 156 | ## After USER1 Home Close Garage Windy 157 | ######################################################## 158 | 159 | - alias: Garage - USER1 Home Close Garage Windy 160 | id: 'garage_USER1_home_close_garage_windy' 161 | 162 | triggers: 163 | - trigger: state 164 | entity_id: person.USER1 165 | from: 'not_home' 166 | to: 'home' 167 | for: 168 | hours: 0 169 | minutes: 4 170 | seconds: 0 171 | 172 | conditions: 173 | - condition: state 174 | entity_id: input_boolean.disable_auto_garage 175 | state: 'off' 176 | - condition: state 177 | entity_id: cover.garage_door 178 | state: 'open' 179 | - condition: state 180 | entity_id: input_boolean.garage_door_motor 181 | state: 'off' 182 | - condition: or 183 | conditions: 184 | - condition: state 185 | entity_id: weather.REDACTED 186 | state: 'windy' 187 | - condition: numeric_state 188 | entity_id: weather.REDACTED 189 | attribute: wind_speed 190 | above: '13' 191 | 192 | actions: 193 | - action: lifx.effect_pulse 194 | data: 195 | cycles: 5 196 | power_on: true 197 | brightness_pct: 100 198 | target: 199 | entity_id: light.garage_interior 200 | - delay: '00:00:05' 201 | - action: homeassistant.turn_on 202 | entity_id: input_boolean.garage_door_motor 203 | - action: cover.close_cover 204 | entity_id: cover.garage_door 205 | 206 | ########################################################## 207 | ## After USER1 Home Close Garage Door 208 | ######################################################## 209 | 210 | - alias: Garage - USER1 Home Close Garage 211 | id: 'garage_USER1_home_close_garage' 212 | 213 | triggers: 214 | - trigger: state 215 | entity_id: input_boolean.USER1_away 216 | from: 'on' 217 | to: 'off' 218 | for: 219 | hours: 0 220 | minutes: 1 221 | seconds: 0 222 | 223 | conditions: 224 | - condition: state 225 | entity_id: input_boolean.disable_auto_garage 226 | state: 'off' 227 | - condition: state 228 | entity_id: cover.garage_door 229 | state: 'open' 230 | - condition: state 231 | entity_id: input_boolean.garage_door_motor 232 | state: 'off' 233 | 234 | actions: 235 | - action: lifx.effect_pulse 236 | data: 237 | cycles: 5 238 | power_on: true 239 | brightness_pct: 100 240 | target: 241 | entity_id: light.garage_interior 242 | - delay: '00:00:05' 243 | - action: homeassistant.turn_on 244 | entity_id: input_boolean.garage_door_motor 245 | - action: cover.close_cover 246 | entity_id: cover.garage_door 247 | 248 | ########################################################## 249 | ## USER2 Home from Driving Open Garage 250 | ########################################################## 251 | 252 | - alias: Garage - USER2 Home from Driving Open Garage 253 | id: 'garage_USER2_home_from_driving_open_garage' 254 | 255 | triggers: 256 | - trigger: state 257 | entity_id: person.USER2 258 | from: 'not_home' 259 | to: 'home' 260 | for: 261 | hours: 0 262 | minutes: 0 263 | seconds: 5 264 | 265 | conditions: 266 | - condition: state 267 | entity_id: input_boolean.garage_door_motor 268 | state: 'off' 269 | - condition: state 270 | entity_id: input_boolean.disable_auto_garage 271 | state: 'off' 272 | - condition: state 273 | entity_id: input_boolean.USER2_away 274 | state: 'on' 275 | - condition: state 276 | entity_id: input_boolean.USER2_away_driving 277 | state: 'on' 278 | - condition: state 279 | entity_id: cover.garage_door 280 | state: 'closed' 281 | 282 | actions: 283 | - action: cover.open_cover 284 | entity_id: cover.garage_door 285 | 286 | ########################################################## 287 | ## After USER2 Home Close Garage Windy 288 | ######################################################## 289 | 290 | - alias: Garage - USER2 Home Close Garage Windy 291 | id: 'garage_USER2_home_close_garage_windy' 292 | 293 | triggers: 294 | - trigger: state 295 | entity_id: person.USER2 296 | from: 'not_home' 297 | to: 'home' 298 | for: 299 | hours: 0 300 | minutes: 3 301 | seconds: 0 302 | 303 | conditions: 304 | - condition: state 305 | entity_id: input_boolean.disable_auto_garage 306 | state: 'off' 307 | - condition: state 308 | entity_id: cover.garage_door 309 | state: 'open' 310 | - condition: state 311 | entity_id: input_boolean.garage_door_motor 312 | state: 'off' 313 | - condition: or 314 | conditions: 315 | - condition: state 316 | entity_id: weather.REDACTED 317 | state: 'windy' 318 | - condition: numeric_state 319 | entity_id: weather.REDACTED 320 | attribute: wind_speed 321 | above: '13' 322 | 323 | actions: 324 | - action: lifx.effect_pulse 325 | data: 326 | cycles: 5 327 | power_on: true 328 | brightness_pct: 100 329 | target: 330 | entity_id: light.garage_interior 331 | - delay: '00:00:05' 332 | - action: homeassistant.turn_on 333 | entity_id: input_boolean.garage_door_motor 334 | - action: cover.close_cover 335 | entity_id: cover.garage_door 336 | 337 | ########################################################## 338 | ## After USER2 Home Close Garage Door 339 | ######################################################## 340 | 341 | - alias: Garage - USER2 Home Close Garage 342 | id: 'garage_USER2_home_close_garage' 343 | 344 | triggers: 345 | - trigger: state 346 | entity_id: input_boolean.USER2_away 347 | from: 'on' 348 | to: 'off' 349 | for: 350 | hours: 0 351 | minutes: 0 352 | seconds: 0 353 | 354 | conditions: 355 | - condition: state 356 | entity_id: input_boolean.disable_auto_garage 357 | state: 'off' 358 | - condition: state 359 | entity_id: cover.garage_door 360 | state: 'open' 361 | - condition: state 362 | entity_id: input_boolean.garage_door_motor 363 | state: 'off' 364 | 365 | actions: 366 | - action: lifx.effect_pulse 367 | data: 368 | cycles: 5 369 | power_on: true 370 | brightness_pct: 100 371 | target: 372 | entity_id: light.garage_interior 373 | - delay: '00:00:05' 374 | - action: homeassistant.turn_on 375 | entity_id: input_boolean.garage_door_motor 376 | - action: cover.close_cover 377 | entity_id: cover.garage_door 378 | 379 | ########################################################## 380 | ## Close Garage Door after 30 Mins 381 | ########################################################## 382 | 383 | - alias: Garage - Close After 30 Mins 384 | id: 'garage_close_after_30_mins' 385 | 386 | triggers: 387 | - trigger: state 388 | entity_id: cover.garage_door 389 | to: 'open' 390 | for: 391 | hours: 0 392 | minutes: 30 393 | seconds: 0 394 | 395 | conditions: 396 | - condition: state 397 | entity_id: input_boolean.disable_auto_garage 398 | state: 'off' 399 | - condition: state 400 | entity_id: cover.garage_door 401 | state: 'open' 402 | - condition: state 403 | entity_id: input_boolean.garage_door_motor 404 | state: 'off' 405 | 406 | actions: 407 | - action: lifx.effect_pulse 408 | data: 409 | cycles: 5 410 | power_on: true 411 | brightness_pct: 100 412 | target: 413 | entity_id: light.garage_interior 414 | - delay: '00:00:05' 415 | - action: cover.close_cover 416 | entity_id: cover.garage_door 417 | 418 | ########################################################## 419 | ## Garage Door Open On Demand (Echo Integration) 420 | ########################################################## 421 | 422 | - alias: Garage - Open On Demand 423 | id: 'garage_open_on_demand' 424 | 425 | triggers: 426 | - trigger: state 427 | entity_id: input_boolean.garage_door 428 | to: 'on' 429 | 430 | conditions: 431 | - condition: state 432 | entity_id: cover.garage_door 433 | state: 'closed' 434 | - condition: state 435 | entity_id: input_boolean.garage_door_motor 436 | state: 'off' 437 | 438 | actions: 439 | - action: cover.open_cover 440 | entity_id: cover.garage_door 441 | 442 | ########################################################## 443 | ## Garage Door Close On Demand (Echo Integration) 444 | ########################################################## 445 | 446 | - alias: Garage - Close On Demand 447 | id: 'garage_close_on_demand' 448 | 449 | triggers: 450 | - trigger: state 451 | entity_id: input_boolean.garage_door 452 | to: 'off' 453 | 454 | conditions: 455 | - condition: state 456 | entity_id: cover.garage_door 457 | state: 'open' 458 | - condition: state 459 | entity_id: input_boolean.garage_door_motor 460 | state: 'off' 461 | 462 | actions: 463 | - action: lifx.effect_pulse 464 | data: 465 | cycles: 5 466 | power_on: true 467 | brightness_pct: 100 468 | target: 469 | entity_id: light.garage_interior 470 | - delay: '00:00:05' 471 | - action: cover.close_cover 472 | entity_id: cover.garage_door 473 | 474 | ########################################################## 475 | ## Turn Off Garage Door Boolean when Closed 476 | ########################################################## 477 | 478 | - alias: Garage - Turn Off Garage Door Boolean when Closed 479 | id: 'garage_turn_off_garage_door_boolean_when_closed' 480 | 481 | triggers: 482 | - trigger: state 483 | entity_id: cover.garage_door 484 | from: 'open' 485 | to: 'closed' 486 | 487 | conditions: 488 | - condition: state 489 | entity_id: cover.garage_door 490 | state: 'closed' 491 | 492 | actions: 493 | - action: homeassistant.turn_off 494 | entity_id: input_boolean.garage_door 495 | 496 | ########################################################## 497 | ## Turn On Garage Door Boolean when Open 498 | ########################################################## 499 | 500 | - alias: Garage - Turn On Garage Door Boolean when Open 501 | id: 'garage_turn_on_garage_door_boolean_when_open' 502 | 503 | triggers: 504 | - trigger: state 505 | entity_id: cover.garage_door 506 | from: 'closed' 507 | to: 'open' 508 | 509 | conditions: 510 | - condition: state 511 | entity_id: cover.garage_door 512 | state: 'open' 513 | 514 | actions: 515 | - action: homeassistant.turn_on 516 | entity_id: input_boolean.garage_door 517 | 518 | ########################################################## 519 | ## Open Garage Door when USER2 Leaves for Work 520 | ########################################################## 521 | 522 | - alias: Garage - USER2 Leaving for Work Open Garage 523 | id: 'garage_USER2_leaving_for_work_open_garage' 524 | 525 | triggers: 526 | - trigger: state 527 | entity_id: binary_sensor.back_door_opened 528 | from: 'off' 529 | to: 'on' 530 | 531 | conditions: 532 | - condition: time 533 | after: '06:00:00' 534 | before: '07:30:00' 535 | - condition: state 536 | entity_id: input_boolean.disable_auto_garage 537 | state: 'off' 538 | - condition: state 539 | entity_id: person.USER2 540 | state: 'home' 541 | - condition: state 542 | entity_id: input_boolean.USER2_away 543 | state: 'off' 544 | - condition: time 545 | weekday: 546 | - mon 547 | - tue 548 | - wed 549 | - thu 550 | - fri 551 | - condition: state 552 | entity_id: cover.garage_door 553 | state: 'closed' 554 | - condition: state 555 | entity_id: input_boolean.garage_door_motor 556 | state: 'off' 557 | 558 | actions: 559 | - action: cover.open_cover 560 | entity_id: cover.garage_door 561 | 562 | ########################################################## 563 | ## Flash Light When Garage Door Motor On 564 | ########################################################## 565 | 566 | - alias: Garage - Flash Light When Garage Motor On 567 | id: 'garage_flash_light_when_garage_motor_on' 568 | 569 | triggers: 570 | - trigger: state 571 | entity_id: input_boolean.garage_door_motor 572 | to: 'on' 573 | 574 | actions: 575 | - action: lifx.effect_pulse 576 | data: 577 | cycles: 5 578 | power_on: true 579 | brightness_pct: 100 580 | target: 581 | entity_id: light.garage_interior 582 | 583 | ########################################################## 584 | ## Garage Door Motor On 585 | ########################################################## 586 | 587 | - alias: Garage - Door Motor On 588 | id: 'garage_door_motor_on' 589 | 590 | triggers: 591 | - trigger: event 592 | event_type: call_service 593 | event_data: 594 | domain: cover 595 | service: close_cover 596 | service_data: 597 | entity_id: cover.garage_door 598 | - trigger: event 599 | event_type: call_service 600 | event_data: 601 | domain: cover 602 | service: open_cover 603 | service_data: 604 | entity_id: cover.garage_door 605 | 606 | actions: 607 | - action: homeassistant.turn_on 608 | entity_id: input_boolean.garage_door_motor 609 | 610 | ########################################################## 611 | ## Garage Door Motor Off 612 | ########################################################## 613 | 614 | - alias: Garage - Door Motor Off 615 | id: 'garage_door_motor_off' 616 | 617 | triggers: 618 | - trigger: state 619 | entity_id: input_boolean.garage_door_motor 620 | to: 'on' 621 | for: 622 | hours: 0 623 | minutes: 0 624 | seconds: 18 625 | 626 | actions: 627 | - action: homeassistant.turn_off 628 | entity_id: input_boolean.garage_door_motor 629 | 630 | ################################################################# 631 | ## Notifications 632 | ################################################################# 633 | 634 | ################################################################# 635 | ## Garage Open iOS Notification 636 | ################################################################# 637 | 638 | - alias: Garage - Open iOS Notification 639 | id: 'garage_open_ios_notification' 640 | 641 | triggers: 642 | - trigger: state 643 | entity_id: cover.garage_door 644 | from: 'closed' 645 | to: 'open' 646 | 647 | conditions: 648 | - condition: state 649 | entity_id: input_boolean.disable_notifications 650 | state: 'off' 651 | 652 | actions: 653 | - action: notify.USER1_devices 654 | data: 655 | message: Garage Door Open 656 | data: 657 | tag: garage-open 658 | entity_id: camera.garage 659 | actions: 660 | - action: "close_garage" 661 | title: "Close Garage Door" 662 | destructive: true 663 | activationMode: background 664 | 665 | ################################################################# 666 | ## Garage Closed iOS Notification 667 | ################################################################# 668 | 669 | - alias: Garage - Closed iOS Notification 670 | id: 'garage_closed_ios_notification' 671 | 672 | triggers: 673 | - trigger: state 674 | entity_id: cover.garage_door 675 | from: 'open' 676 | to: 'closed' 677 | 678 | conditions: 679 | - condition: state 680 | entity_id: input_boolean.disable_notifications 681 | state: 'off' 682 | 683 | actions: 684 | - action: notify.USER1_devices 685 | data: 686 | message: Garage Door Closed 687 | data: 688 | tag: garage-closed 689 | entity_id: camera.garage 690 | actions: 691 | - action: "open_garage" 692 | title: "Open Garage Door" 693 | destructive: true 694 | activationMode: background 695 | 696 | ################################################################# 697 | ## Garage Door Still Open iOS Notification 698 | ################################################################# 699 | 700 | - alias: Garage - Door Still Open iOS Notification 701 | id: 'garage_door_still_open_ios_notification' 702 | 703 | triggers: 704 | - trigger: state 705 | entity_id: cover.garage_door 706 | to: 'open' 707 | for: 708 | hours: 0 709 | minutes: 35 710 | seconds: 0 711 | - trigger: state 712 | entity_id: cover.garage_door 713 | to: 'closing' 714 | for: 715 | hours: 0 716 | minutes: 10 717 | seconds: 0 718 | - trigger: state 719 | entity_id: cover.garage_door 720 | to: 'opening' 721 | for: 722 | hours: 0 723 | minutes: 10 724 | seconds: 0 725 | 726 | conditions: 727 | - condition: state 728 | entity_id: input_boolean.disable_notifications 729 | state: 'off' 730 | 731 | actions: 732 | - action: notify.USER1_devices 733 | data: 734 | message: Garage Door is Still Open! 735 | data: 736 | tag: garage-still-open 737 | entity_id: camera.garage 738 | actions: 739 | - action: "close_garage" 740 | title: "Close Garage Door" 741 | destructive: true 742 | activationMode: background -------------------------------------------------------------------------------- /automation/ios_actions.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## iOS Action Automations 3 | ################################################################# 4 | 5 | ################################################################# 6 | ## Bedtime 7 | ################################################################# 8 | 9 | - alias: iOS Action - Bedtime 10 | id: 'ios_action_bedtime' 11 | 12 | triggers: 13 | - trigger: event 14 | event_type: ios.action_fired 15 | event_data: 16 | actionName: 'Bedtime' 17 | 18 | actions: 19 | - action: homeassistant.turn_on 20 | target: 21 | entity_id: 22 | - input_boolean.bedtime 23 | 24 | ################################################################# 25 | ## Arm Alarm Home 26 | ################################################################# 27 | 28 | - alias: iOS Action - Arm Alarm Home 29 | id: 'ios_action_arm_alarm_home' 30 | 31 | triggers: 32 | - trigger: event 33 | event_type: ios.action_fired 34 | event_data: 35 | actionName: 'Arm Alarm Home' 36 | 37 | actions: 38 | - action: alarm_control_panel.alarm_arm_home 39 | entity_id: alarm_control_panel.alarm 40 | 41 | ################################################################# 42 | ## Arm Alarm Away 43 | ################################################################# 44 | 45 | - alias: iOS Action - Arm Alarm Away 46 | id: 'ios_action_arm_alarm_away' 47 | 48 | triggers: 49 | - trigger: event 50 | event_type: ios.action_fired 51 | event_data: 52 | actionName: 'Arm Alarm Away' 53 | 54 | actions: 55 | - action: alarm_control_panel.alarm_arm_away 56 | entity_id: alarm_control_panel.alarm 57 | 58 | ################################################################# 59 | ## Disarm Alarm 60 | ################################################################# 61 | 62 | - alias: iOS Action - Disarm Alarm 63 | id: 'ios_action_disarm_alarm' 64 | 65 | triggers: 66 | - trigger: event 67 | event_type: ios.action_fired 68 | event_data: 69 | actionName: 'Disarm Alarm' 70 | 71 | actions: 72 | - action: alarm_control_panel.alarm_disarm 73 | entity_id: alarm_control_panel.alarm 74 | 75 | ################################################################# 76 | ## Toggle Garage Door 77 | ################################################################# 78 | 79 | - alias: iOS Action - Toggle Garage Door 80 | id: 'ios_action_automation_toogle_garage_door' 81 | 82 | triggers: 83 | - trigger: event 84 | event_type: ios.action_fired 85 | event_data: 86 | actionName: 'Toggle Garage Door' 87 | 88 | actions: 89 | - action: cover.toggle 90 | target: 91 | entity_id: cover.garage_door 92 | data: {} 93 | 94 | ################################################################# 95 | ## Toggle Fireplace 96 | ################################################################# 97 | 98 | - alias: iOS Action - Toggle Fireplace 99 | id: 'ios_action_automation_toogle_fireplace' 100 | 101 | triggers: 102 | - trigger: event 103 | event_type: ios.action_fired 104 | event_data: 105 | actionName: 'Toggle Fireplace' 106 | 107 | actions: 108 | - action: switch.toggle 109 | target: 110 | entity_id: switch.fireplace 111 | data: {} 112 | 113 | ################################################################# 114 | ## Unlock Front Door 115 | ################################################################# 116 | 117 | - alias: iOS Action - Unlock Front Door 118 | id: 'ios_action_automation_unlock_front_door' 119 | 120 | triggers: 121 | - trigger: event 122 | event_type: ios.action_fired 123 | event_data: 124 | actionName: 'Unlock Front Door' 125 | 126 | actions: 127 | - action: lock.unlock 128 | target: 129 | entity_id: lock.front_door 130 | data: {} 131 | 132 | ################################################################# 133 | ## Unlock Back Door 134 | ################################################################# 135 | 136 | - alias: iOS Action - Unlock Back Door 137 | id: 'ios_action_automation_unlock_back_door' 138 | 139 | triggers: 140 | - trigger: event 141 | event_type: ios.action_fired 142 | event_data: 143 | actionName: 'Unlock Back Door' 144 | 145 | actions: 146 | - action: lock.unlock 147 | target: 148 | entity_id: lock.back_door 149 | data: {} 150 | 151 | ################################################################# 152 | ## Unlock Basement Door 153 | ################################################################# 154 | 155 | - alias: iOS Action - Unlock Basement Door 156 | id: 'ios_action_automation_unlock_basement_door' 157 | 158 | triggers: 159 | - trigger: event 160 | event_type: ios.action_fired 161 | event_data: 162 | actionName: 'Unlock Basement Door' 163 | 164 | actions: 165 | - action: lock.unlock 166 | target: 167 | entity_id: lock.basement_door 168 | data: {} 169 | 170 | ################################################################# 171 | ## Lock Doors 172 | ################################################################# 173 | 174 | - alias: iOS Action - Lock Doors 175 | id: 'ios_action_automation_lock_doors' 176 | 177 | triggers: 178 | - trigger: event 179 | event_type: ios.action_fired 180 | event_data: 181 | actionName: 'Lock Doors' 182 | 183 | actions: 184 | - action: lock.lock 185 | target: 186 | entity_id: 187 | - lock.front_door 188 | - lock.back_door 189 | - lock.basement_door 190 | data: {} 191 | 192 | ################################################################# 193 | ## Toggle Living Room Fans 194 | ################################################################# 195 | 196 | - alias: iOS Action - Toggle Living Room Fans 197 | id: 'ios_action_automation_toggle_living_room_fans' 198 | 199 | triggers: 200 | - trigger: event 201 | event_type: ios.action_fired 202 | event_data: 203 | actionName: 'Toggle Living Room Fans' 204 | 205 | actions: 206 | - action: fan.toggle 207 | target: 208 | entity_id: fan.living_room_fans 209 | data: {} 210 | 211 | ################################################################# 212 | ## Living Room Fans Increase Speed 213 | ################################################################# 214 | 215 | - alias: iOS Action - Living Room Fans Increase Speed 216 | id: 'ios_action_automation_living_room_fans_increase_speed' 217 | 218 | triggers: 219 | - trigger: event 220 | event_type: ios.action_fired 221 | event_data: 222 | actionName: 'Living Room Fans Increase Speed' 223 | 224 | actions: 225 | - action: fan.increase_speed 226 | target: 227 | entity_id: fan.living_room_fans 228 | data: {} 229 | 230 | ################################################################# 231 | ## Living Room Fans Decrease Speed 232 | ################################################################# 233 | 234 | - alias: iOS Action - Living Room Fans Decrease Speed 235 | id: 'ios_action_automation_living_room_fans_decrease_speed' 236 | 237 | triggers: 238 | - trigger: event 239 | event_type: ios.action_fired 240 | event_data: 241 | actionName: 'Living Room Fans Decrease Speed' 242 | 243 | actions: 244 | - action: fan.decrease_speed 245 | target: 246 | entity_id: fan.living_room_fans 247 | data: {} 248 | 249 | ################################################################# 250 | ## Party Mode 251 | ################################################################# 252 | 253 | - alias: iOS Action - Party Mode 254 | id: 'ios_action_automation_party_mode' 255 | 256 | triggers: 257 | - trigger: event 258 | event_type: ios.action_fired 259 | event_data: 260 | actionName: 'Party Mode' 261 | 262 | conditions: 263 | - condition: not 264 | conditions: 265 | - condition: state 266 | entity_id: sensor.season 267 | state: 'winter' 268 | 269 | actions: 270 | - action: homeassistant.toggle 271 | target: 272 | entity_id: 273 | - input_boolean.livingroom_rainbow 274 | - input_boolean.bedroom_rainbow 275 | - input_boolean.pop_music 276 | data: {} 277 | - action: select.select_option 278 | data: 279 | entity_id: select.living_room_tv_activities 280 | option: "Watch TV" 281 | 282 | ################################################################# 283 | ## Party Mode TV On 284 | ################################################################# 285 | 286 | - alias: iOS Action - Party Mode TV On 287 | id: 'ios_action_automation_party_mode_tv_on' 288 | 289 | triggers: 290 | - trigger: event 291 | event_type: ios.action_fired 292 | event_data: 293 | actionName: 'Party Mode' 294 | 295 | conditions: 296 | - condition: state 297 | entity_id: select.living_room_tv_activities 298 | state: "power_off" 299 | 300 | actions: 301 | - action: select.select_option 302 | data: 303 | entity_id: select.living_room_tv_activities 304 | option: "Watch TV" 305 | 306 | ################################################################# 307 | ## Party Mode Winter 308 | ################################################################# 309 | 310 | - alias: iOS Action - Party Mode Winter 311 | id: 'ios_action_automation_party_mode_winter' 312 | 313 | triggers: 314 | - trigger: event 315 | event_type: ios.action_fired 316 | event_data: 317 | actionName: 'Party Mode' 318 | 319 | conditions: 320 | - condition: state 321 | entity_id: sensor.season 322 | state: 'winter' 323 | 324 | actions: 325 | - action: homeassistant.toggle 326 | target: 327 | entity_id: 328 | - input_boolean.livingroom_rainbow 329 | - input_boolean.bedroom_rainbow 330 | - input_boolean.pop_music 331 | data: {} 332 | - action: switch.toggle 333 | target: 334 | entity_id: 335 | - switch.fireplace 336 | data: {} 337 | - action: select.select_option 338 | data: 339 | entity_id: select.living_room_tv_activities 340 | option: "Watch TV" 341 | 342 | ################################################################# 343 | ## iOS Actionable Notifications 344 | ################################################################# 345 | 346 | ################################################################# 347 | ## Unlock Doors 348 | ################################################################# 349 | 350 | - alias: iOS Action - Unlock Doors 351 | id: 'ios_action_unlock_doors' 352 | 353 | triggers: 354 | - trigger: event 355 | event_type: mobile_app_notification_action 356 | event_data: 357 | action: "unlock_doors" 358 | 359 | actions: 360 | - action: lock.unlock 361 | target: 362 | entity_id: 363 | - lock.back_door 364 | - lock.front_door 365 | 366 | ################################################################# 367 | ## Unlock Front Door 368 | ################################################################# 369 | 370 | - alias: iOS Action - Unlock Front Door 371 | id: 'ios_action_unlock_front_door' 372 | 373 | triggers: 374 | - trigger: event 375 | event_type: mobile_app_notification_action 376 | event_data: 377 | action: "unlock_front_door" 378 | 379 | actions: 380 | - action: lock.unlock 381 | target: 382 | entity_id: 383 | - lock.front_door 384 | 385 | ################################################################# 386 | ## Close Garage 387 | ################################################################# 388 | 389 | - alias: iOS Action - Close Garage 390 | id: 'ios_action_close_garage' 391 | 392 | triggers: 393 | - trigger: event 394 | event_type: mobile_app_notification_action 395 | event_data: 396 | action: "close_garage" 397 | 398 | actions: 399 | - action: cover.close_cover 400 | entity_id: cover.garage_door 401 | 402 | ################################################################# 403 | ## Open Garage 404 | ################################################################# 405 | 406 | - alias: iOS Action - Open Garage 407 | id: 'ios_action_open_garage' 408 | 409 | triggers: 410 | - trigger: event 411 | event_type: mobile_app_notification_action 412 | event_data: 413 | action: "open_garage" 414 | 415 | actions: 416 | - action: cover.open_cover 417 | entity_id: cover.garage_door 418 | 419 | ################################################################# 420 | ## Disarm Alarm 421 | ################################################################# 422 | 423 | - alias: iOS Action - Silence Alarm 424 | id: 'ios_action_silence_alarm' 425 | 426 | triggers: 427 | - trigger: event 428 | event_type: mobile_app_notification_action 429 | event_data: 430 | action: "disarm_alarm" 431 | 432 | actions: 433 | - action: alarm_control_panel.alarm_disarm 434 | entity_id: alarm_control_panel.alarm 435 | 436 | ################################################################# 437 | ## Enable Alarm 438 | ################################################################# 439 | 440 | - alias: iOS Action - Enable Alarm 441 | id: 'ios_action_enable_alarm' 442 | 443 | triggers: 444 | - trigger: event 445 | event_type: mobile_app_notification_action 446 | event_data: 447 | action: "arm_alarm" 448 | 449 | actions: 450 | - action: alarm_control_panel.alarm_arm_away 451 | entity_id: alarm_control_panel.alarm 452 | 453 | ################################################################# 454 | ## Siren Off 455 | ################################################################# 456 | 457 | - alias: iOS Action - Siren 458 | id: 'ios_action_siren' 459 | 460 | triggers: 461 | - trigger: event 462 | event_type: mobile_app_notification_action 463 | event_data: 464 | action: "siren_off" 465 | 466 | actions: 467 | - action: switch.turn_off 468 | entity_id: switch.siren 469 | 470 | ################################################################# 471 | ## Fireplace Off 472 | ################################################################# 473 | 474 | - alias: iOS Action - Fireplace Off 475 | id: 'ios_action_fireplace_off' 476 | 477 | triggers: 478 | - trigger: event 479 | event_type: mobile_app_notification_action 480 | event_data: 481 | action: "fireplace_off" 482 | 483 | actions: 484 | - action: switch.turn_off 485 | entity_id: switch.fireplace 486 | -------------------------------------------------------------------------------- /automation/laundry.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Laundry Automations 3 | ################################################################# 4 | 5 | ################################################################# 6 | ## Notifications 7 | ################################################################# 8 | 9 | ########################################################## 10 | ## Washing Machine Done - USER1 iOS Notification 11 | ########################################################## 12 | 13 | - alias: Laundry - Washing Machine Done USER1 iOS Notification 14 | id: 'laundry_washing_machine_done_USER1_ios_notification' 15 | 16 | triggers: 17 | - trigger: state 18 | entity_id: binary_sensor.washer_wash_completed 19 | from: 'off' 20 | to: 'on' 21 | for: 22 | hours: 0 23 | minutes: 0 24 | seconds: 1 25 | 26 | conditions: 27 | - condition: state 28 | entity_id: group.household 29 | state: 'home' 30 | - condition: state 31 | entity_id: person.USER1 32 | state: 'home' 33 | - condition: state 34 | entity_id: input_boolean.disable_notifications 35 | state: 'off' 36 | 37 | actions: 38 | - action: notify.USER1_devices 39 | data: 40 | message: Washing Machine Finished 41 | data: 42 | tag: washer 43 | 44 | ########################################################## 45 | ## Dryer Done - USER1 iOS Notification 46 | ########################################################## 47 | 48 | - alias: Laundry - Dryer Done USER1 iOS Notification 49 | id: 'laundry_dryer_done_USER1_ios_notification' 50 | 51 | triggers: 52 | - trigger: state 53 | entity_id: binary_sensor.dryer_dry_completed 54 | from: 'off' 55 | to: 'on' 56 | for: 57 | hours: 0 58 | minutes: 0 59 | seconds: 1 60 | 61 | conditions: 62 | - condition: state 63 | entity_id: group.household 64 | state: 'home' 65 | - condition: state 66 | entity_id: person.USER1 67 | state: 'home' 68 | - condition: state 69 | entity_id: input_boolean.disable_notifications 70 | state: 'off' 71 | 72 | actions: 73 | - action: notify.USER1_devices 74 | data: 75 | message: Dryer Finished 76 | data: 77 | tag: dryer 78 | 79 | ########################################################## 80 | ## Washing Machine Done - USER2 iOS Notification 81 | ########################################################## 82 | 83 | - alias: Laundry - Washing Machine Done USER2 iOS Notification 84 | id: 'laundry_washing_machine_done_USER2_ios_notification' 85 | 86 | triggers: 87 | - trigger: state 88 | entity_id: binary_sensor.washer_wash_completed 89 | from: 'off' 90 | to: 'on' 91 | for: 92 | hours: 0 93 | minutes: 0 94 | seconds: 1 95 | 96 | conditions: 97 | - condition: state 98 | entity_id: group.household 99 | state: 'home' 100 | - condition: state 101 | entity_id: person.USER2 102 | state: 'home' 103 | - condition: state 104 | entity_id: input_boolean.disable_notifications 105 | state: 'off' 106 | 107 | actions: 108 | - action: notify.USER2_devices 109 | data: 110 | message: Washing Machine Finished 111 | data: 112 | tag: washer 113 | 114 | ########################################################## 115 | ## Dryer Done - USER2 iOS Notification 116 | ########################################################## 117 | 118 | - alias: Laundry - Dryer Done USER2 iOS Notification 119 | id: 'laundry_dryer_done_USER2_ios_notficiation' 120 | 121 | triggers: 122 | - trigger: state 123 | entity_id: binary_sensor.dryer_dry_completed 124 | from: 'off' 125 | to: 'on' 126 | for: 127 | hours: 0 128 | minutes: 0 129 | seconds: 1 130 | 131 | conditions: 132 | - condition: state 133 | entity_id: group.household 134 | state: 'home' 135 | - condition: state 136 | entity_id: person.USER2 137 | state: 'home' 138 | - condition: state 139 | entity_id: input_boolean.disable_notifications 140 | state: 'off' 141 | 142 | actions: 143 | - action: notify.USER2_devices 144 | data: 145 | message: Dryer Finished 146 | data: 147 | tag: dryer 148 | 149 | ########################################################## 150 | ## Washing Machine Done - Audio Notification 151 | ########################################################## 152 | 153 | - alias: Laundry - Washing Machine Done Audio Notification 154 | id: 'laundry_washing_machine_done_audio_notification' 155 | 156 | triggers: 157 | - trigger: state 158 | entity_id: binary_sensor.washer_wash_completed 159 | from: 'off' 160 | to: 'on' 161 | for: 162 | hours: 0 163 | minutes: 0 164 | seconds: 1 165 | 166 | conditions: 167 | - condition: state 168 | entity_id: group.household 169 | state: 'home' 170 | - condition: state 171 | entity_id: input_boolean.disable_notifications 172 | state: 'off' 173 | - condition: time 174 | after: '09:00:00' 175 | before: '20:00:00' 176 | 177 | actions: 178 | - action: media_player.play_media 179 | target: 180 | entity_id: 181 | - media_player.sonos_living_room 182 | - media_player.sonos_kitchen 183 | - media_player.sonos_bathroom 184 | - media_player.sonos_USER1s_office 185 | - media_player.sonos_USER2s_office 186 | - media_player.sonos_move 187 | - media_player.sonos_fitness_room 188 | - media_player.sonos_craft_room 189 | data: 190 | announce: true 191 | media_content_id: > 192 | media-source://tts/cloud?message="Washing Machine Has Finished" 193 | media_content_type: "music" 194 | extra: 195 | volume: 45 196 | 197 | ########################################################## 198 | ## Dryer Done - Audio Notification 199 | ########################################################## 200 | 201 | - alias: Laundry - Dryer Done Audio Notification 202 | id: 'laundry_dryer_done_audio_notification' 203 | 204 | triggers: 205 | - trigger: state 206 | entity_id: binary_sensor.dryer_dry_completed 207 | from: 'off' 208 | to: 'on' 209 | for: 210 | hours: 0 211 | minutes: 0 212 | seconds: 1 213 | 214 | conditions: 215 | - condition: state 216 | entity_id: group.household 217 | state: 'home' 218 | - condition: state 219 | entity_id: input_boolean.disable_notifications 220 | state: 'off' 221 | - condition: time 222 | after: '09:00:00' 223 | before: '20:00:00' 224 | 225 | actions: 226 | - action: media_player.play_media 227 | target: 228 | entity_id: 229 | - media_player.sonos_living_room 230 | - media_player.sonos_kitchen 231 | - media_player.sonos_bathroom 232 | - media_player.sonos_USER1s_office 233 | - media_player.sonos_USER2s_office 234 | - media_player.sonos_move 235 | - media_player.sonos_fitness_room 236 | - media_player.sonos_craft_room 237 | data: 238 | announce: true 239 | media_content_id: > 240 | media-source://tts/cloud?message="Dryer Has Finished" 241 | media_content_type: "music" 242 | extra: 243 | volume: 45 244 | 245 | ########################################################## 246 | ## Washer Run Tub Clean Notification 247 | ########################################################## 248 | 249 | - alias: Laundry - Washer Run Tub Clean Notification 250 | id: 'laundry_washer_run_tub_clean_notification' 251 | 252 | triggers: 253 | - trigger: numeric_state 254 | entity_id: sensor.washer_tub_clean 255 | above: 29 256 | 257 | conditions: 258 | - condition: state 259 | entity_id: group.household 260 | state: 'home' 261 | - condition: state 262 | entity_id: input_boolean.disable_notifications 263 | state: 'off' 264 | 265 | actions: 266 | - action: notify.USER1_devices 267 | data: 268 | message: Time to Run a Tub Clean Cycler on the Washer 269 | data: 270 | tag: washer-clean -------------------------------------------------------------------------------- /automation/locks.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Door Lock Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Doorbell Fingerprint Unlock Front Door 7 | ########################################################## 8 | 9 | - alias: Locks - doorbell fingerprint unlock front door 10 | id: 'locks_doorbell_fingerprint_unlock_front_door' 11 | 12 | triggers: 13 | - platform: event 14 | event_type: state_changed 15 | event_data: 16 | entity_id: event.front_door_camera_fingerprint 17 | 18 | conditions: 19 | - condition: state 20 | entity_id: lock.front_door 21 | state: 'locked' 22 | - condition: state 23 | entity_id: input_boolean.disable_lock_unlock_doors 24 | state: 'off' 25 | - condition: state 26 | entity_id: binary_sensor.front_door_opened 27 | state: 'off' 28 | - condition: template 29 | value_template: > 30 | {{ 31 | not trigger.event.data.old_state.attributes.get('restored', false) and 32 | not trigger.event.data.old_state.state == 'unavailable' and 33 | trigger.event.data.new_state is not none and 34 | trigger.event.data.new_state.attributes.event_type == 'identified' and 35 | (trigger.event.data.new_state.attributes.ulp_id|default('')) != '' and 36 | trigger.event.data.new_state.attributes.ulp_id in ['REDACTED', 'REDACTED'] 37 | }} 38 | 39 | actions: 40 | - action: lock.unlock 41 | entity_id: lock.front_door 42 | 43 | ########################################################## 44 | ## Lock Front Door After 30 Mins 45 | ########################################################## 46 | 47 | - alias: Locks - Lock Front Door After 30 Mins 48 | id: 'locks_lock_front_door_after_30_mins' 49 | 50 | triggers: 51 | - trigger: state 52 | entity_id: lock.front_door 53 | from: 'locked' 54 | to: 'unlocked' 55 | for: 56 | hours: 0 57 | minutes: 30 58 | seconds: 0 59 | 60 | conditions: 61 | - condition: state 62 | entity_id: input_boolean.disable_lock_unlock_doors 63 | state: 'off' 64 | - condition: state 65 | entity_id: binary_sensor.front_door_opened 66 | state: 'off' 67 | - condition: state 68 | entity_id: lock.front_door 69 | state: 'unlocked' 70 | 71 | actions: 72 | - action: lock.lock 73 | entity_id: lock.front_door 74 | 75 | ########################################################## 76 | ## Lock Back Door After 2 Hours 77 | ########################################################## 78 | 79 | - alias: Locks - Lock Back Door After 2 Hours 80 | id: 'locks_lock_back_door_after_2_hours' 81 | 82 | triggers: 83 | - trigger: state 84 | entity_id: lock.back_door 85 | from: 'locked' 86 | to: 'unlocked' 87 | for: 88 | hours: 2 89 | minutes: 0 90 | seconds: 0 91 | 92 | conditions: 93 | - condition: state 94 | entity_id: input_boolean.disable_lock_unlock_doors 95 | state: 'off' 96 | - condition: state 97 | entity_id: binary_sensor.back_door_opened 98 | state: 'off' 99 | for: 100 | hours: 1 101 | minutes: 0 102 | seconds: 0 103 | - condition: state 104 | entity_id: lock.back_door 105 | state: 'unlocked' 106 | 107 | actions: 108 | - action: lock.lock 109 | entity_id: lock.back_door 110 | 111 | ########################################################## 112 | ## Lock Basement Door After 2 hours 113 | ########################################################## 114 | 115 | - alias: Locks - Lock Basement Door After 45 Mins 116 | id: 'locks_lock_basement_door_after_45_mins' 117 | 118 | triggers: 119 | - trigger: state 120 | entity_id: lock.basement_door 121 | from: 'locked' 122 | to: 'unlocked' 123 | for: 124 | hours: 2 125 | minutes: 0 126 | seconds: 0 127 | 128 | conditions: 129 | - condition: state 130 | entity_id: input_boolean.disable_lock_unlock_doors 131 | state: 'off' 132 | - condition: state 133 | entity_id: binary_sensor.basement_door_opened 134 | state: 'off' 135 | for: 136 | hours: 1 137 | minutes: 0 138 | seconds: 0 139 | - condition: state 140 | entity_id: lock.basement_door 141 | state: 'unlocked' 142 | 143 | actions: 144 | - action: lock.lock 145 | entity_id: lock.basement_door 146 | 147 | ########################################################## 148 | ## Lock Doors at 2a 149 | ########################################################## 150 | 151 | - alias: Locks - Lock Doors at 2a 152 | id: 'locks_lock_back_door_at_2a' 153 | 154 | triggers: 155 | - trigger: time 156 | at: '02:00:00' 157 | 158 | conditions: 159 | - condition: state 160 | entity_id: input_boolean.disable_lock_unlock_doors 161 | state: 'off' 162 | - condition: state 163 | entity_id: binary_sensor.doors 164 | state: 'off' 165 | 166 | actions: 167 | - action: lock.lock 168 | target: 169 | entity_id: 170 | - lock.front_door 171 | - lock.back_door 172 | - lock.basement_door 173 | 174 | ################################################################# 175 | ## Notifications 176 | ################################################################# 177 | 178 | ########################################################## 179 | ## Locks Low Battery Notification 180 | ########################################################## 181 | 182 | - alias: Locks - Low Battery Notification 183 | id: 'locks_low_battery_notification' 184 | 185 | mode: parallel 186 | triggers: 187 | - trigger: numeric_state 188 | entity_id: 189 | - sensor.front_door_lock_batt 190 | - sensor.back_door_lock_batt 191 | - sensor.basement_door_lock_batt 192 | below: 30 193 | for: 194 | hours: 1 195 | minutes: 0 196 | seconds: 0 197 | 198 | conditions: 199 | - condition: state 200 | entity_id: input_boolean.disable_notifications 201 | state: 'off' 202 | 203 | actions: 204 | - action: notify.USER1_devices 205 | data: 206 | message: "{{ trigger.to_state.attributes.friendly_name }} Low" -------------------------------------------------------------------------------- /automation/network.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Network 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Re-Enable Pi-hole After 30 Mins 7 | ########################################################## 8 | 9 | - alias: Network - Re-Enable Pi-hole After 30 Mins 10 | id: 'network_reenable_pihole_after_30_mins' 11 | 12 | triggers: 13 | - trigger: state 14 | entity_id: input_boolean.pihole 15 | from: 'on' 16 | to: 'off' 17 | for: 18 | hours: 0 19 | minutes: 31 20 | seconds: 0 21 | 22 | conditions: 23 | - condition: state 24 | entity_id: input_boolean.pihole 25 | state: 'off' 26 | 27 | actions: 28 | - action: homeassistant.turn_on 29 | target: 30 | entity_id: 31 | - input_boolean.pihole 32 | 33 | ########################################################## 34 | ## Disable Pi-hole 35 | ########################################################## 36 | 37 | - alias: Network - Disable Pi-hole 38 | id: 'network_disable_pihole' 39 | 40 | triggers: 41 | - trigger: state 42 | entity_id: input_boolean.pihole 43 | from: 'on' 44 | to: 'off' 45 | for: 46 | hours: 0 47 | minutes: 0 48 | seconds: 3 49 | 50 | conditions: 51 | - condition: state 52 | entity_id: input_boolean.pihole 53 | state: 'off' 54 | 55 | actions: 56 | - action: script.pihole_disable 57 | data: {} 58 | 59 | ########################################################## 60 | ## Enable Pi-hole 61 | ########################################################## 62 | 63 | - alias: Network - Enable Pi-hole 64 | id: 'network_enable_pihole' 65 | 66 | triggers: 67 | - trigger: state 68 | entity_id: input_boolean.pihole 69 | from: 'off' 70 | to: 'on' 71 | for: 72 | hours: 0 73 | minutes: 0 74 | seconds: 3 75 | 76 | conditions: 77 | - condition: state 78 | entity_id: input_boolean.pihole 79 | state: 'on' 80 | 81 | actions: 82 | - action: script.pihole_enable 83 | data: {} 84 | 85 | ################################################################# 86 | ## Notifications 87 | ################################################################# 88 | 89 | ################################################################# 90 | ## WAN Down Notification 91 | ################################################################# 92 | 93 | - alias: Network - WAN Down Notification 94 | id: 'network_wan_down_notification' 95 | 96 | triggers: 97 | - trigger: state 98 | entity_id: binary_sensor.wan 99 | to: 'off' 100 | for: 101 | hours: 0 102 | minutes: 1 103 | seconds: 0 104 | 105 | conditions: 106 | - condition: state 107 | entity_id: input_boolean.disable_notifications 108 | state: 'off' 109 | 110 | actions: 111 | - action: notify.USER1_devices 112 | data: 113 | message: Internet is Down! 114 | data: 115 | tag: network 116 | 117 | ################################################################# 118 | ## WAN Up Notification 119 | ################################################################# 120 | 121 | - alias: Network - WAN Up Notification 122 | id: 'network_wan_up_notification' 123 | 124 | triggers: 125 | - trigger: state 126 | entity_id: binary_sensor.wan 127 | from: 'off' 128 | to: 'on' 129 | for: 130 | hours: 0 131 | minutes: 1 132 | seconds: 0 133 | 134 | conditions: 135 | - condition: state 136 | entity_id: input_boolean.disable_notifications 137 | state: 'off' 138 | 139 | actions: 140 | - action: notify.USER1_devices 141 | data: 142 | message: Internet is Up 143 | data: 144 | tag: network 145 | -------------------------------------------------------------------------------- /automation/occupancy.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Occupancy Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Turn Off Bedroom when Unoccupied 7 | ########################################################## 8 | 9 | - alias: Occupancy - Turn Off Bedroom Lights when Unoccupied 10 | id: 'occupancy_turn_off_bedroom_lights_when_unoccupied' 11 | 12 | triggers: 13 | - trigger: state 14 | entity_id: binary_sensor.bedroom_occupancy 15 | from: 'on' 16 | to: 'off' 17 | for: 18 | hours: 1 19 | minutes: 0 20 | seconds: 0 21 | 22 | conditions: 23 | - condition: state 24 | entity_id: input_boolean.disable_occupancy 25 | state: 'off' 26 | - condition: not 27 | conditions: 28 | - condition: state 29 | entity_id: vacuum.main_floor_roomba 30 | state: 'cleaning' 31 | - condition: state 32 | entity_id: vacuum.main_floor_roomba 33 | state: 'returning' 34 | - condition: not 35 | conditions: 36 | - condition: state 37 | entity_id: light.closet_lamp 38 | attribute: effect 39 | state: "Plantgrowth" 40 | 41 | actions: 42 | - action: light.turn_off 43 | target: 44 | entity_id: 45 | - light.bedroom_lights 46 | 47 | ########################################################## 48 | ## Turn Off Guest Bedroom when Unoccupied 49 | ########################################################## 50 | 51 | - alias: Occupancy - Turn Off Guest Bedroom Lights when Unoccupied 52 | id: 'occupancy_turn_off_guest_bedroom_lights_when_unoccupied' 53 | 54 | triggers: 55 | - trigger: state 56 | entity_id: binary_sensor.guest_bedroom_occupancy 57 | from: 'on' 58 | to: 'off' 59 | for: 60 | hours: 0 61 | minutes: 30 62 | seconds: 0 63 | 64 | conditions: 65 | - condition: state 66 | entity_id: input_boolean.disable_occupancy 67 | state: 'off' 68 | - condition: state 69 | entity_id: input_boolean.guest_mode 70 | state: 'off' 71 | - condition: not 72 | conditions: 73 | - condition: state 74 | entity_id: vacuum.upstairs_roomba 75 | state: 'cleaning' 76 | - condition: state 77 | entity_id: vacuum.upstairs_roomba 78 | state: 'returning' 79 | 80 | actions: 81 | - action: light.turn_off 82 | entity_id: light.guest_bedroom_lights 83 | -------------------------------------------------------------------------------- /automation/vacation.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Vacation Mode Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Vacation Mode On 7 | ########################################################## 8 | 9 | - alias: Vacation - Mode On 10 | id: 'vacation_mode_on' 11 | 12 | triggers: 13 | - trigger: state 14 | entity_id: input_boolean.vacation_mode 15 | to: 'on' 16 | 17 | conditions: 18 | - condition: not 19 | conditions: 20 | - condition: state 21 | entity_id: group.household 22 | state: 'home' 23 | - condition: state 24 | entity_id: input_boolean.guest_mode 25 | state: 'off' 26 | 27 | actions: 28 | - action: homeassistant.turn_on 29 | target: 30 | entity_id: 31 | - input_boolean.disable_rainy_day 32 | - input_boolean.disable_interior_lights_sunset 33 | - input_boolean.disable_media_lights 34 | - input_boolean.disable_occupancy 35 | - input_boolean.disable_motion 36 | - input_boolean.disable_fountain 37 | 38 | ########################################################## 39 | ## Vacation Mode Off 40 | ########################################################## 41 | 42 | - alias: Vacation - Mode Off 43 | id: 'vacation_mode_off' 44 | 45 | triggers: 46 | - trigger: state 47 | entity_id: input_boolean.vacation_mode 48 | to: 'off' 49 | 50 | actions: 51 | - action: homeassistant.turn_off 52 | target: 53 | entity_id: 54 | - input_boolean.disable_rainy_day 55 | - input_boolean.disable_interior_lights_sunset 56 | - input_boolean.disable_media_lights 57 | - input_boolean.disable_occupancy 58 | - input_boolean.thermostat_away 59 | - input_boolean.disable_motion 60 | 61 | ########################################################## 62 | ## Turn On Vacation Mode when Gone 24 Hours 63 | ########################################################## 64 | 65 | - alias: Vacation - Turn On when Gone 24 Hours 66 | id: 'vacation_turn_on_when_gone_24_hours' 67 | 68 | triggers: 69 | - trigger: state 70 | entity_id: group.household 71 | to: 'not_home' 72 | for: 73 | hours: 24 74 | minutes: 0 75 | seconds: 0 76 | 77 | conditions: 78 | - condition: state 79 | entity_id: input_boolean.disable_home_away 80 | state: 'off' 81 | 82 | actions: 83 | - action: homeassistant.turn_on 84 | entity_id: input_boolean.vacation_mode 85 | 86 | ########################################################## 87 | ## Turn off Vacation Mode when Home 88 | ########################################################## 89 | 90 | - alias: Vacation - Turn off when Home 91 | id: 'vacation_turn_off_when_home' 92 | 93 | triggers: 94 | - trigger: state 95 | entity_id: group.household 96 | from: 'not_home' 97 | to: 'home' 98 | 99 | conditions: 100 | - condition: state 101 | entity_id: input_boolean.disable_home_away 102 | state: 'off' 103 | 104 | actions: 105 | - action: homeassistant.turn_off 106 | entity_id: input_boolean.vacation_mode 107 | 108 | ########################################################## 109 | ## Turn On Vacation Mode when Thermostat set to Vacation 110 | ########################################################## 111 | 112 | - alias: Vacation - Turn On when Thermostat set to Vacation 113 | id: 'vacation_turn_on_when_thermostat_set_to_vacation' 114 | 115 | triggers: 116 | - trigger: state 117 | entity_id: sensor.thermostat_climate_mode 118 | to: 'vacation' 119 | 120 | conditions: 121 | - condition: state 122 | entity_id: input_boolean.disable_home_away 123 | state: 'off' 124 | - condition: not 125 | conditions: 126 | - condition: state 127 | entity_id: group.household 128 | state: 'home' 129 | 130 | actions: 131 | - action: homeassistant.turn_on 132 | entity_id: input_boolean.vacation_mode 133 | 134 | ########################################################## 135 | ## Vacation Lights On at Night 136 | ########################################################## 137 | 138 | - alias: Vacation - Lights On at Night 139 | id: 'vacation_lights_on_at_night' 140 | 141 | triggers: 142 | - trigger: state 143 | entity_id: sun.sun 144 | from: 'above_horizon' 145 | to: 'below_horizon' 146 | 147 | conditions: 148 | - condition: state 149 | entity_id: input_boolean.vacation_mode 150 | state: 'on' 151 | 152 | actions: 153 | - delay: 154 | minutes: '{{ range(2, 20) | random }}' 155 | - action: light.turn_on 156 | target: 157 | entity_id: 158 | - light.kitchen_sink 159 | data: 160 | brightness_pct: 50 161 | - delay: 162 | minutes: '{{ range(2, 28) | random }}' 163 | - action: light.turn_on 164 | target: 165 | entity_id: 166 | - light.living_room_lamps 167 | data: 168 | brightness_pct: 75 169 | transition: 120 170 | - delay: 171 | minutes: '{{ range(2, 59) | random }}' 172 | - action: light.turn_on 173 | target: 174 | entity_id: 175 | - light.bedroom_ceiling 176 | data: 177 | brightness_pct: 25 178 | transition: 60 179 | - delay: 180 | minutes: '{{ range(2, 45) | random }}' 181 | - action: light.turn_on 182 | target: 183 | entity_id: 184 | - light.USER1_office_desk_lamp 185 | - light.USER1_office_desk_accent 186 | data: 187 | brightness_pct: 80 188 | 189 | ########################################################## 190 | ## Vacation Mode Lights off at Night 191 | ########################################################## 192 | 193 | - alias: Vacation - Lights Off at Night 194 | id: 'vacation_lights_off_at_night' 195 | 196 | triggers: 197 | - trigger: time 198 | at: '21:30:00' 199 | 200 | conditions: 201 | - condition: state 202 | entity_id: input_boolean.vacation_mode 203 | state: 'on' 204 | 205 | actions: 206 | - delay: 207 | minutes: '{{ range(2, 32) | random }}' 208 | - action: light.turn_off 209 | target: 210 | entity_id: 211 | - light.kitchen_sink 212 | - delay: 213 | minutes: '{{ range(2, 59) | random }}' 214 | - action: light.turn_off 215 | target: 216 | entity_id: 217 | - light.living_room_lamps 218 | - delay: 219 | minutes: '{{ range(2, 30) | random }}' 220 | - action: light.turn_off 221 | target: 222 | entity_id: 223 | - light.bedroom_ceiling 224 | - delay: 225 | minutes: '{{ range(2, 45) | random }}' 226 | - action: light.turn_off 227 | target: 228 | entity_id: 229 | - light.USER1_office_desk_lamp 230 | - light.USER1_office_desk_accent -------------------------------------------------------------------------------- /automation/weather.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Weather Based Automations 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Turn Globe Blue when Raining 7 | ########################################################## 8 | 9 | - alias: Weather - Turn Globe Blue when Raining 10 | id: 'weather_turn_globe_blue_when_raining' 11 | 12 | triggers: 13 | - trigger: state 14 | entity_id: weather.REDACTED 15 | to: 'rainy' 16 | for: 17 | hours: 0 18 | minutes: 1 19 | seconds: 0 20 | - trigger: state 21 | entity_id: weather.REDACTED 22 | to: 'lightning-rainy' 23 | for: 24 | hours: 0 25 | minutes: 1 26 | seconds: 0 27 | 28 | conditions: 29 | - condition: state 30 | entity_id: group.household 31 | state: 'home' 32 | - condition: state 33 | entity_id: light.globe 34 | state: 'on' 35 | - condition: state 36 | entity_id: input_boolean.disable_rainy_day 37 | state: 'off' 38 | 39 | actions: 40 | - action: light.turn_on 41 | target: 42 | entity_id: 43 | - light.globe 44 | data: 45 | color_name: blue 46 | brightness_pct: 100 47 | transition: 15 48 | 49 | ########################################################## 50 | ## Reset Globe Color when Not Raining 51 | ########################################################## 52 | 53 | - alias: Weather - Reset Globe Color when Not Raining 54 | id: 'weather_reset_globe_color_when_not_raining' 55 | 56 | triggers: 57 | - trigger: state 58 | entity_id: weather.REDACTED 59 | from: 'rainy' 60 | - trigger: state 61 | entity_id: weather.REDACTED 62 | from: 'lightning-rainy' 63 | 64 | conditions: 65 | - condition: state 66 | entity_id: group.household 67 | state: 'home' 68 | - condition: state 69 | entity_id: light.globe 70 | state: 'on' 71 | - condition: state 72 | entity_id: input_boolean.disable_rainy_day 73 | state: 'off' 74 | 75 | actions: 76 | - action: light.turn_on 77 | target: 78 | entity_id: 79 | - light.globe 80 | data: 81 | brightness_pct: 65 82 | color_temp: 366 83 | transition: 15 84 | 85 | ########################################################## 86 | ## Set Globe Blue when On and Raining 87 | ########################################################## 88 | 89 | - alias: Weather - Set Globe Blue when On and Raining 90 | id: 'weather_set_globe_blue_when_on_and_raining' 91 | 92 | triggers: 93 | - trigger: state 94 | entity_id: light.globe 95 | from: 'off' 96 | to: 'on' 97 | for: 98 | hours: 0 99 | minutes: 1 100 | seconds: 0 101 | 102 | conditions: 103 | - condition: state 104 | entity_id: group.household 105 | state: 'home' 106 | - condition: state 107 | entity_id: input_boolean.livingroom_rainbow 108 | state: 'off' 109 | - condition: state 110 | entity_id: alarm_control_panel.alarm 111 | state: 'disarmed' 112 | - condition: or 113 | conditions: 114 | - condition: state 115 | entity_id: weather.REDACTED 116 | state: 'rainy' 117 | - condition: state 118 | entity_id: weather.REDACTED 119 | state: 'lightning-rainy' 120 | - condition: or 121 | conditions: 122 | - condition: state 123 | entity_id: binary_sensor.basement_drain_water_sensor_liquid_detected 124 | state: 'off' 125 | - condition: state 126 | entity_id: binary_sensor.kitchen_sink_water_sensor 127 | state: 'off' 128 | - condition: state 129 | entity_id: binary_sensor.bathroom_sink_water_sensor 130 | state: 'off' 131 | - condition: state 132 | entity_id: binary_sensor.upstairs_bathrooom_water_sensor 133 | state: 'off' 134 | - condition: state 135 | entity_id: binary_sensor.utility_sink_water_sensor 136 | state: 'off' 137 | - condition: state 138 | entity_id: binary_sensor.washing_machine_water_sensor 139 | state: 'off' 140 | - condition: state 141 | entity_id: input_boolean.disable_rainy_day 142 | state: 'off' 143 | 144 | actions: 145 | - action: light.turn_on 146 | target: 147 | entity_id: 148 | - light.globe 149 | data: 150 | color_name: blue 151 | brightness_pct: 100 152 | transition: 15 153 | 154 | ########################################################## 155 | ## Turn USER1's Office Desk Lamp Blue when Raining 156 | ########################################################## 157 | 158 | - alias: Weather - Turn USER1's Office Desk Lamp Blue when Raining 159 | id: 'weather_turn_USER1_office_desk_lamp_blue_when_raining' 160 | 161 | triggers: 162 | - trigger: state 163 | entity_id: weather.REDACTED 164 | to: 'rainy' 165 | for: 166 | hours: 0 167 | minutes: 1 168 | seconds: 0 169 | - trigger: state 170 | entity_id: weather.REDACTED 171 | to: 'lightning-rainy' 172 | for: 173 | hours: 0 174 | minutes: 1 175 | seconds: 0 176 | 177 | conditions: 178 | - condition: state 179 | entity_id: group.household 180 | state: 'home' 181 | - condition: state 182 | entity_id: person.USER1 183 | state: 'home' 184 | - condition: state 185 | entity_id: light.USER1_office_desk_lamp 186 | state: 'on' 187 | - condition: state 188 | entity_id: input_boolean.disable_rainy_day 189 | state: 'off' 190 | - condition: state 191 | entity_id: input_boolean.USER1_s_office_do_not_disturb 192 | state: 'off' 193 | 194 | actions: 195 | - action: light.turn_on 196 | target: 197 | entity_id: 198 | - light.USER1_office_desk_lamp 199 | data: 200 | color_name: blue 201 | brightness_pct: 25 202 | 203 | ########################################################## 204 | ## Turn USER1's Office Accent Light Blue when Raining 205 | ########################################################## 206 | 207 | - alias: Weather - Turn USER1's Office Accent Light Blue when Raining 208 | id: 'weather_turn_USER1_office_accent_light_blue_when_raining' 209 | 210 | triggers: 211 | - trigger: state 212 | entity_id: weather.REDACTED 213 | to: 'rainy' 214 | for: 215 | hours: 0 216 | minutes: 1 217 | seconds: 0 218 | - trigger: state 219 | entity_id: weather.REDACTED 220 | to: 'lightning-rainy' 221 | for: 222 | hours: 0 223 | minutes: 1 224 | seconds: 0 225 | 226 | conditions: 227 | - condition: state 228 | entity_id: group.household 229 | state: 'home' 230 | - condition: state 231 | entity_id: person.USER1 232 | state: 'home' 233 | - condition: state 234 | entity_id: light.USER1_office_desk_accent 235 | state: 'on' 236 | - condition: state 237 | entity_id: input_boolean.disable_rainy_day 238 | state: 'off' 239 | - condition: state 240 | entity_id: input_boolean.USER1_s_office_do_not_disturb 241 | state: 'off' 242 | - condition: state 243 | entity_id: cover.USER1_s_office_blinds 244 | state: 'closed' 245 | 246 | actions: 247 | - action: light.turn_on 248 | target: 249 | entity_id: 250 | - light.USER1_office_desk_accent 251 | data: 252 | color_name: blue 253 | brightness_pct: 100 254 | transition: 15 255 | 256 | ########################################################## 257 | ## Reset USER1's Office Desk Lamp Color when Not Raining 258 | ########################################################## 259 | 260 | - alias: Weather - Reset USER1's Office Desk Lamp Color when Not Raining 261 | id: 'weather_reset_USER1_office_desk_lamp_color_when_not_raining' 262 | 263 | triggers: 264 | - trigger: state 265 | entity_id: weather.REDACTED 266 | from: 'rainy' 267 | - trigger: state 268 | entity_id: weather.REDACTED 269 | from: 'lightning-rainy' 270 | 271 | conditions: 272 | - condition: state 273 | entity_id: group.household 274 | state: 'home' 275 | - condition: state 276 | entity_id: person.USER1 277 | state: 'home' 278 | - condition: state 279 | entity_id: light.USER1_office_desk_lamp 280 | state: 'on' 281 | - condition: state 282 | entity_id: input_boolean.disable_rainy_day 283 | state: 'off' 284 | - condition: state 285 | entity_id: input_boolean.USER1_s_office_do_not_disturb 286 | state: 'off' 287 | 288 | actions: 289 | - action: light.turn_on 290 | target: 291 | entity_id: 292 | - light.USER1_office_desk_lamp 293 | data: 294 | brightness_pct: 25 295 | color_temp: 454 296 | 297 | ########################################################## 298 | ## Reset USER1's Office Accent Light Color when Not Raining 299 | ########################################################## 300 | 301 | - alias: Weather - Reset USER1's Office Accent Light Color when Not Raining 302 | id: 'weather_reset_USER1_office_accent_light_color_when_not_raining' 303 | 304 | triggers: 305 | - trigger: state 306 | entity_id: weather.REDACTED 307 | from: 'rainy' 308 | - trigger: state 309 | entity_id: weather.REDACTED 310 | from: 'lightning-rainy' 311 | 312 | conditions: 313 | - condition: state 314 | entity_id: group.household 315 | state: 'home' 316 | - condition: state 317 | entity_id: person.USER1 318 | state: 'home' 319 | - condition: state 320 | entity_id: light.USER1_office_desk_accent 321 | state: 'on' 322 | - condition: state 323 | entity_id: input_boolean.disable_rainy_day 324 | state: 'off' 325 | - condition: state 326 | entity_id: input_boolean.USER1_s_office_do_not_disturb 327 | state: 'off' 328 | 329 | actions: 330 | - action: light.turn_on 331 | target: 332 | entity_id: 333 | - light.USER1_office_desk_accent 334 | data: 335 | brightness_pct: 80 336 | color_temp: 370 337 | transition: 15 338 | 339 | ########################################################## 340 | ## Set USER1's Office Desk Lamp Blue when On and Raining 341 | ########################################################## 342 | 343 | - alias: Weather - Set USER1's Office Desk Lamp Blue when On and Raining 344 | id: 'weather_set_USER1_office_desk_lamp_blue_when_on_and_raining' 345 | 346 | triggers: 347 | - trigger: state 348 | entity_id: light.USER1_office_desk_lamp 349 | from: 'off' 350 | to: 'on' 351 | for: 352 | hours: 0 353 | minutes: 2 354 | seconds: 0 355 | 356 | conditions: 357 | - condition: state 358 | entity_id: group.household 359 | state: 'home' 360 | - condition: state 361 | entity_id: person.USER1 362 | state: 'home' 363 | - condition: state 364 | entity_id: input_boolean.office_rainbow 365 | state: 'off' 366 | - condition: state 367 | entity_id: input_boolean.USER1_s_office_do_not_disturb 368 | state: 'off' 369 | - condition: state 370 | entity_id: input_boolean.disable_rainy_day 371 | state: 'off' 372 | - condition: or 373 | conditions: 374 | - condition: state 375 | entity_id: weather.REDACTED 376 | state: 'rainy' 377 | - condition: state 378 | entity_id: weather.REDACTED 379 | state: 'lightning-rainy' 380 | 381 | actions: 382 | - action: light.turn_on 383 | target: 384 | entity_id: 385 | - light.USER1_office_desk_lamp 386 | data: 387 | color_name: blue 388 | brightness_pct: 25 389 | 390 | ########################################################## 391 | ## Set USER1's Office Accent Light Blue when On and Raining 392 | ########################################################## 393 | 394 | - alias: Weather - Set USER1's Office Accent Light Blue when On and Raining 395 | id: 'weather_set_USER1_office_accent_light_blue_when_on_and_raining' 396 | 397 | triggers: 398 | - trigger: state 399 | entity_id: light.USER1_office_desk_accent 400 | from: 'off' 401 | to: 'on' 402 | for: 403 | hours: 0 404 | minutes: 2 405 | seconds: 0 406 | 407 | conditions: 408 | - condition: state 409 | entity_id: group.household 410 | state: 'home' 411 | - condition: state 412 | entity_id: person.USER1 413 | state: 'home' 414 | - condition: state 415 | entity_id: input_boolean.office_rainbow 416 | state: 'off' 417 | - condition: state 418 | entity_id: input_boolean.USER1_s_office_do_not_disturb 419 | state: 'off' 420 | - condition: state 421 | entity_id: input_boolean.disable_rainy_day 422 | state: 'off' 423 | - condition: or 424 | conditions: 425 | - condition: state 426 | entity_id: weather.REDACTED 427 | state: 'rainy' 428 | - condition: state 429 | entity_id: weather.REDACTED 430 | state: 'lightning-rainy' 431 | 432 | actions: 433 | - action: light.turn_on 434 | target: 435 | entity_id: 436 | - light.USER1_office_desk_accent 437 | data: 438 | color_name: blue 439 | brightness_pct: 100 440 | transition: 15 -------------------------------------------------------------------------------- /command_line.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Command Line 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Living Room East Fan Dimmer 7 | ########################################################## 8 | 9 | #- switch: 10 | # name: Living Room East Fan Dimmer 11 | # unique_id: living_room_east_fan_dimmer 12 | # command_on: 'curl -H "BOND-Token: REDACTED" -i http://bond.network.REDACTED/v2/devices/REDACTED/actions/StartDimmer -X PUT -d "{}"' 13 | # command_off: 'curl -H "BOND-Token: REDACTED" -i http://bond.network.REDACTED/v2/devices/REDACTED/actions/Stop -X PUT -d "{}"' 14 | 15 | ########################################################## 16 | ## Living Room West Fan Dimmer 17 | ########################################################## 18 | 19 | #- switch: 20 | # name: Living Room West Fan Dimmer 21 | # unique_id: living_room_west_fan_dimmer 22 | # command_on: 'curl -H "BOND-Token: REDACTED" -i http://bond.network.REDACTED/v2/devices/REDACTED/actions/StartDimmer -X PUT -d "{}"' 23 | # command_off: 'curl -H "BOND-Token: REDACTED" -i http://bond.network.REDACTED/v2/devices/REDACTED/actions/Stop -X PUT -d "{}"' -------------------------------------------------------------------------------- /configuration.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Home Assistant Core 3 | ################################################################# 4 | 5 | homeassistant: 6 | auth_providers: 7 | - type: homeassistant 8 | #- type: trusted_networks 9 | # trusted_networks: 10 | # - REDACTED.0/24 11 | customize: !include customize.yaml 12 | default_config: 13 | http: 14 | use_x_forREDACTEDed_for: true 15 | trusted_proxies: 16 | - REDACTED09.3 17 | ssl_certificate: !secret ssl_certificate 18 | ssl_key: !secret ssl_key 19 | ip_ban_enabled: false 20 | go2rtc: 21 | debug_ui: false 22 | # login_attempts_threshold: 10 23 | #logger: 24 | # default: warning 25 | # logs: 26 | # homeassistant.components.zha: debug 27 | 28 | ################################################################# 29 | ## Components 30 | ################################################################# 31 | 32 | alarm_control_panel: 33 | - platform: manual 34 | name: Alarm 35 | code_arm_required: false 36 | arming_time: 30 37 | delay_time: 30 38 | trigger_time: 120 39 | disarmed: 40 | trigger_time: 0 41 | armed_home: 42 | arming_time: 30 43 | delay_time: 30 44 | trigger_time: 120 45 | armed_away: 46 | arming_time: 30 47 | delay_time: 15 48 | trigger_time: 120 49 | 50 | route53: 51 | aws_access_key_id: !secret aws_access_key_id_route53 52 | aws_secret_access_key: !secret aws_secret_access_key_route53 53 | zone: !secret aws_zone_route53 54 | domain: !secret aws_domain_route53 55 | records: 56 | - home 57 | 58 | weather: 59 | - platform: template 60 | name: "REDACTED, MO" 61 | unique_id: weather_REDACTED 62 | condition_template: "{{ states('sensor.weather_condition_REDACTED') }}" 63 | temperature_template: "{{ state_attr('weather.REDACTED_ecobee', 'temperature') }}" 64 | humidity_template: "{{ state_attr('weather.REDACTED_ecobee', 'humidity') }}" 65 | forecast_daily_template: "{{ state_attr('sensor.REDACTED_daily_forecast', 'forecast') }}" 66 | attribution_template: "{{ state_attr('weather.REDACTED_ecobee', 'attribution') }}" 67 | pressure_template: "{{ state_attr('weather.REDACTED_ecobee', 'pressure') }}" 68 | wind_speed_template: "{{ state_attr('weather.REDACTED_ecobee', 'wind_speed') }}" 69 | wind_bearing_template: "{{ state_attr('weather.REDACTED_ecobee', 'wind_bearing') }}" 70 | visibility_template: "{{ state_attr('weather.REDACTED_ecobee', 'visibility') }}" 71 | 72 | rest_command: 73 | pihole_login: 74 | url: '{{ api_url }}/auth' 75 | method: POST 76 | payload: '{ "password" : "{{ password }}" }' 77 | content_type: 'application/json; charset=utf-8' 78 | verify_ssl: false 79 | pihole_logout: 80 | url: '{{ api_url }}/auth' 81 | method: DELETE 82 | verify_ssl: false 83 | headers: 84 | sid: "{{ sid }}" 85 | pihole_set_blocking: 86 | url: '{{ api_url }}/dns/blocking' 87 | method: POST 88 | payload: '{ "blocking" : {{ blocking }}, "timer" : {{ timer }} }' 89 | content_type: 'application/json; charset=utf-8' 90 | verify_ssl: false 91 | headers: 92 | sid: "{{ sid }}" 93 | 94 | ################################################################# 95 | ## Notifications 96 | ################################################################# 97 | 98 | notify: 99 | - platform: group 100 | name: REDACTED_devices 101 | services: 102 | - service: mobile_app_REDACTEDs_iphone 103 | - service: mobile_app_REDACTED_s_ipad 104 | - service: mobile_app_REDACTED_s_macbook_pro 105 | 106 | - platform: group 107 | name: USER2_devices 108 | services: 109 | - service: mobile_app_USER2s_iphone 110 | - service: mobile_app_USER2s_ipad 111 | 112 | ################################################################# 113 | ## Includes 114 | ################################################################# 115 | 116 | automation manual: !include_dir_merge_list automation/ 117 | automation ui: !include automations.yaml 118 | group: !include groups.yaml 119 | script: !include scripts.yaml 120 | homekit: !include homekit.yaml 121 | emulated_hue: !include emulated_hue.yaml 122 | template: !include template.yaml 123 | command_line: !include command_line.yaml 124 | python_script: 125 | ios: !include ios.yaml -------------------------------------------------------------------------------- /customize.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Customize 3 | ################################################################# 4 | 5 | ################################################################# 6 | ## Climate 7 | ################################################################# 8 | 9 | ########################################################## 10 | ## Craft Room Temperature 11 | ########################################################## 12 | 13 | sensor.craft_room_temperature: 14 | device_class: temperature 15 | 16 | ########################################################## 17 | ## Craft Room Temperature 18 | ########################################################## 19 | 20 | sensor.craft_room_humidity: 21 | device_class: humidity 22 | 23 | ########################################################## 24 | ## Fitness Room Temperature 25 | ########################################################## 26 | 27 | sensor.fitness_room_temperature: 28 | device_class: temperature 29 | 30 | ########################################################## 31 | ## Fitness Room Temperature 32 | ########################################################## 33 | 34 | sensor.fitness_room_humidity: 35 | device_class: humidity 36 | 37 | ########################################################## 38 | ## Bathroom Temperature 39 | ########################################################## 40 | 41 | sensor.bathroom_humidity: 42 | device_class: humidity 43 | 44 | ################################################################# 45 | ## Switches 46 | ################################################################# 47 | 48 | ########################################################## 49 | ## Living Room Random Color Switch 50 | ########################################################## 51 | 52 | switch.livingroom_rainbow: 53 | icon: mdi:palette 54 | friendly_name: Living Room Random Color 55 | 56 | ########################################################## 57 | ## Bedroom Random Color Switch 58 | ########################################################## 59 | 60 | switch.bedroom_rainbow: 61 | icon: mdi:palette 62 | friendly_name: Bedroom Random Color 63 | 64 | ########################################################## 65 | ## USER1's Office Random Color Switch 66 | ########################################################## 67 | 68 | switch.office_rainbow: 69 | icon: mdi:palette 70 | friendly_name: Office Random Color 71 | 72 | ########################################################## 73 | ## Front Porch Random Color Switch 74 | ########################################################## 75 | 76 | switch.front_porch_rainbow: 77 | icon: mdi:palette 78 | friendly_name: Front Porch Random Color 79 | 80 | ########################################################## 81 | ## Bedtime Switch 82 | ########################################################## 83 | 84 | switch.bedtime: 85 | icon: mdi:bed 86 | friendly_name: Bedtime 87 | 88 | ########################################################## 89 | ## Panic Mode Switch 90 | ########################################################## 91 | 92 | switch.panic_mode: 93 | icon: mdi:alarm-light 94 | friendly_name: Panic Mode 95 | 96 | ########################################################## 97 | ## Disable Smoke Alarm Switch 98 | ########################################################## 99 | 100 | switch.disable_smoke_alarm: 101 | icon: mdi:fire-truck 102 | friendly_name: Disable Fire Alarm 103 | 104 | ########################################################## 105 | ## Bedroom Sonos Beam Speech Enhance 106 | ########################################################## 107 | 108 | switch.bedroom_sonos_speech_enhance: 109 | icon: mdi:account-voice 110 | friendly_name: Bedroom Sonos Speech Enhance 111 | 112 | ########################################################## 113 | ## Bedroom Sonos Beam Night Sound 114 | ########################################################## 115 | 116 | switch.bedroom_sonos_night_sound: 117 | icon: mdi:weather-night 118 | friendly_name: Bedroom Sonos Night Sound 119 | 120 | ########################################################## 121 | ## Fitness Room Sonos Beam Speech Enhance 122 | ########################################################## 123 | 124 | switch.fitness_room_sonos_speech_enhance: 125 | icon: mdi:account-voice 126 | friendly_name: Fitness Room Sonos Speech Enhance 127 | 128 | ########################################################## 129 | ## Fitness Room Sonos Beam Night Sound 130 | ########################################################## 131 | 132 | switch.fitness_room_sonos_night_sound: 133 | icon: mdi:weather-night 134 | friendly_name: Fitness Room Sonos Night Sound 135 | 136 | ########################################################## 137 | ## Surround Sound Sonos Speech Enhance 138 | ########################################################## 139 | 140 | switch.surround_sound_sonos_speech_enhance: 141 | icon: mdi:account-voice 142 | friendly_name: Surround Sound Speech Enhance 143 | 144 | ########################################################## 145 | ## Surround Sound Sonos Night Sound 146 | ########################################################## 147 | 148 | switch.surround_sound_sonos_night_sound: 149 | icon: mdi:weather-night 150 | friendly_name: Surround Sound Sonos Night Sound 151 | 152 | ################################################################# 153 | ## NAS 154 | ################################################################# 155 | 156 | ########################################################## 157 | ## NAS-01 Status 158 | ########################################################## 159 | 160 | sensor.nas_01_status: 161 | icon: mdi:nas 162 | friendly_name: System Status 163 | 164 | ########################################################## 165 | ## NAS-01 Drive 01 Status 166 | ########################################################## 167 | 168 | sensor.nas_01_smart_status_drive_0_1: 169 | icon: mdi:harddisk 170 | friendly_name: Drive 1 SMART Status 171 | 172 | ########################################################## 173 | ## NAS-01 Drive 02 Status 174 | ########################################################## 175 | 176 | sensor.nas_01_smart_status_drive_0_2: 177 | icon: mdi:harddisk 178 | friendly_name: Drive 2 SMART Status 179 | 180 | ########################################################## 181 | ## NAS-01 Drive 03 Status 182 | ########################################################## 183 | 184 | sensor.nas_01_smart_status_drive_0_3: 185 | icon: mdi:harddisk 186 | friendly_name: Drive 3 SMART Status 187 | 188 | ########################################################## 189 | ## NAS-01 Drive 04 Status 190 | ########################################################## 191 | 192 | sensor.nas_01_smart_status_drive_0_4: 193 | icon: mdi:harddisk 194 | friendly_name: Drive 4 SMART Status 195 | 196 | ########################################################## 197 | ## NAS-01 Volume Used 198 | ########################################################## 199 | 200 | sensor.nas_01_volume_used_storage: 201 | friendly_name: Storage Volume Used 202 | 203 | ########################################################## 204 | ## NAS-01 CPU Usage 205 | ########################################################## 206 | 207 | sensor.nas_01_cpu_usage: 208 | friendly_name: CPU Usage 209 | 210 | ########################################################## 211 | ## NAS-01 Memory Usage 212 | ########################################################## 213 | 214 | sensor.nas_01_memory_usage: 215 | friendly_name: Memory Usage 216 | 217 | ########################################################## 218 | ## NAS-02 Status 219 | ########################################################## 220 | 221 | sensor.nas_02_status: 222 | icon: mdi:nas 223 | friendly_name: System Status 224 | 225 | ########################################################## 226 | ## NAS-02 Drive 01 Status 227 | ########################################################## 228 | 229 | sensor.nas_02_smart_status_drive_0_1: 230 | icon: mdi:harddisk 231 | friendly_name: Drive 1 SMART Status 232 | 233 | ########################################################## 234 | ## NAS-02 Drive 02 Status 235 | ########################################################## 236 | 237 | sensor.nas_02_smart_status_drive_0_2: 238 | icon: mdi:harddisk 239 | friendly_name: Drive 2 SMART Status 240 | 241 | ########################################################## 242 | ## NAS-02 Drive 03 Status 243 | ########################################################## 244 | 245 | sensor.nas_02_smart_status_drive_0_3: 246 | icon: mdi:harddisk 247 | friendly_name: Drive 3 SMART Status 248 | 249 | ########################################################## 250 | ## NAS-02 Drive 04 Status 251 | ########################################################## 252 | 253 | sensor.nas_02_smart_status_drive_0_4: 254 | icon: mdi:harddisk 255 | friendly_name: Drive 4 SMART Status 256 | 257 | ########################################################## 258 | ## NAS-02 Volume Used 259 | ########################################################## 260 | 261 | sensor.nas_02_volume_used_storage: 262 | friendly_name: Storage Volume Used 263 | 264 | ########################################################## 265 | ## NAS-02 CPU Usage 266 | ########################################################## 267 | 268 | sensor.nas_02_cpu_usage: 269 | friendly_name: CPU Usage 270 | 271 | ########################################################## 272 | ## NAS-02 Memory Usage 273 | ########################################################## 274 | 275 | sensor.nas_02_memory_usage: 276 | friendly_name: Memory Usage 277 | 278 | ################################################################# 279 | ## Fans 280 | ################################################################# 281 | 282 | ########################################################## 283 | ## Living Room Fan East 284 | ########################################################## 285 | 286 | fan.living_room_east: 287 | assumed_state: false 288 | 289 | ########################################################## 290 | ## Living Room Fan West 291 | ########################################################## 292 | 293 | fan.living_room_west: 294 | assumed_state: false 295 | 296 | ########################################################## 297 | ## Living Room Ceiling Light (East) 298 | ########################################################## 299 | 300 | light.living_room_ceiling_east: 301 | assumed_state: false 302 | 303 | ########################################################## 304 | ## Living Room Ceiling Light (West) 305 | ########################################################## 306 | 307 | light.living_room_ceiling_west: 308 | assumed_state: false 309 | 310 | ########################################################## 311 | ## Living Room Fans Switch 312 | ########################################################## 313 | 314 | switch.living_room_fans: 315 | icon: mdi:fan 316 | friendly_name: Living Room Fans 317 | 318 | ########################################################## 319 | ## Living Room Fan East Dimmer 320 | ########################################################## 321 | 322 | switch.living_room_east_fan_dimmer: 323 | icon: mdi:lightbulb-on 324 | friendly_name: Living Room Ceiling East Dimmer 325 | 326 | ########################################################## 327 | ## Living Room Fan West Dimmer 328 | ########################################################## 329 | 330 | switch.living_room_west_fan_dimmer: 331 | icon: mdi:lightbulb-on 332 | friendly_name: Living Room Ceiling West Dimmer 333 | 334 | ################################################################# 335 | ## Light Level Sensors 336 | ################################################################# 337 | 338 | ########################################################## 339 | ## Bathroom Light Level Sensor 340 | ########################################################## 341 | 342 | sensor.bathroom_light_level: 343 | device_class: illuminance 344 | unit_of_measurement: 'Lux' 345 | 346 | ########################################################## 347 | ## Craft Room Light Level Sensor 348 | ########################################################## 349 | 350 | sensor.craft_room_light_level: 351 | device_class: illuminance 352 | unit_of_measurement: 'Lux' 353 | 354 | ########################################################## 355 | ## Fitness Room Light Level Sensor 356 | ########################################################## 357 | 358 | sensor.fitness_room_light_level: 359 | device_class: illuminance 360 | unit_of_measurement: 'Lux' 361 | 362 | ################################################################# 363 | ## Energy 364 | ################################################################# 365 | 366 | ########################################################## 367 | ## Total Energy Wh 368 | ########################################################## 369 | 370 | sensor.total_watts_wh: 371 | friendly_name: Electric Grid 372 | icon: mdi:transmission-tower 373 | 374 | ########################################################## 375 | ## Total Energy 376 | ########################################################## 377 | 378 | sensor.total_watts: 379 | friendly_name: Watts 380 | icon: mdi:transmission-tower 381 | 382 | ########################################################## 383 | ## Total Amps 384 | ########################################################## 385 | 386 | sensor.total_amps: 387 | friendly_name: Amps 388 | 389 | ########################################################## 390 | ## Total Volts 391 | ########################################################## 392 | 393 | sensor.total_volts: 394 | friendly_name: Volts 395 | 396 | ########################################################## 397 | ## AC Volts 398 | ########################################################## 399 | 400 | sensor.ac_volts: 401 | friendly_name: Volts 402 | 403 | ########################################################## 404 | ## AC Amps 405 | ########################################################## 406 | 407 | sensor.ac_amps: 408 | friendly_name: Amps 409 | 410 | ########################################################## 411 | ## Hot Tub Volts 412 | ########################################################## 413 | 414 | sensor.hot_tub_volts: 415 | friendly_name: Volts 416 | 417 | ########################################################## 418 | ## Hot Tub Amps 419 | ########################################################## 420 | 421 | sensor.hot_tub_amps: 422 | friendly_name: Amps 423 | 424 | ########################################################## 425 | ## Furnance Volts 426 | ########################################################## 427 | 428 | sensor.furnace_volts: 429 | friendly_name: Volts 430 | 431 | ########################################################## 432 | ## Furnance Amps 433 | ########################################################## 434 | 435 | sensor.furnace_amps: 436 | friendly_name: Amps 437 | 438 | ########################################################## 439 | ## Refrigerator Volts 440 | ########################################################## 441 | 442 | sensor.fridge_volts: 443 | friendly_name: Volts 444 | 445 | ########################################################## 446 | ## Refrigerator Amps 447 | ########################################################## 448 | 449 | sensor.fridge_amps: 450 | friendly_name: Amps -------------------------------------------------------------------------------- /emulated_hue.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Emulated Hue 3 | ################################################################# 4 | 5 | host_ip: REDACTED.21 6 | listen_port: 80 7 | off_maps_to_on_domains: 8 | - script 9 | - scene 10 | expose_by_default: false 11 | entities: 12 | switch.fireplace: 13 | hidden: false 14 | name: "Remote FRPLC" 15 | light.living_room_accent_lights: 16 | hidden: false 17 | name: "Remote LVNGRM" 18 | fan.living_room_fans: 19 | hidden: false 20 | name: "Remote LVNGRM Fans" 21 | light.living_room_fan_lights: 22 | hidden: false 23 | name: "Remote LVNGRM Fan Lights" -------------------------------------------------------------------------------- /esphome/garage_door_relay/README.MD: -------------------------------------------------------------------------------- 1 | ## Overview 2 | 3 | [ESPHome](https://esphome.io/index.html) configuration and steps used to enable auatomation of Garage Door Motor, Garage Door Open/Close Status, and temperature readings in detached garage. Integration with Home Assistant via [ESPHome integration](https://www.home-assistant.io/integrations/esphome/). 4 | 5 | The ESPHome device was built using a custom board with screw down terminals that has 4 relays built in. [ESPHome Docker](https://esphome.io/guides/getting_started_command_line.html) was utlizied to compile the initial configuration and that was uploaded onto the ESP32 board. The ESP32 board is enclosed in an ABS plastic junction box and is powered via a micro USB cable. The door sensor from honeywell are made for Garage Doors. 6 | 7 | 8 | ## Parts Used 9 | 10 | | Device | Quantity | Connection | Home Assistant | Notes | 11 | | ------------- | :---: | ------------- | ------------- | ------------- | 12 | | [4 Relay ESP32](https://amzn.to/3abd0vG) | 1 | Wi-Fi | [ESPHome](https://www.home-assistant.io/integrations/esphome/)| Automated to open / close garage door on location and auto close after specific time intervals | 13 | | [Honeywell Ademco 958 Overhead Door Contacts](https://amzn.to/33CpKZG) | 1 | [4 Relay ESP32](https://amzn.to/3abd0vG) | [ESPHome](https://www.home-assistant.io/integrations/esphome/)| Door Sensor used with ESPHome Relay | 14 | | [Temp Sensor Probe DS18b20](https://amzn.to/3bx9RGF) | 1 | [4 Relay ESP32](https://amzn.to/3abd0vG) | [ESPHome](https://www.home-assistant.io/integrations/esphome/) | Waterproof Temperature sensor, connected directly to ESPHome module | 15 | | [4.7K Ohm Metal Film Resistor](https://amzn.to/3ar95uB) | 1 | [4 Relay ESP32](https://amzn.to/3abd0vG) | [ESPHome](https://www.home-assistant.io/integrations/esphome/) | external pullup resistor | 16 | | [ABS Plastic IP65 Junction Box](https://amzn.to/3asXMCa) | 1 | NA | NA | Junction Box for ESP32 Board and wires | 17 | 18 | ## GPIO Mapping 19 | 20 | | Relay / Input | GPIO Pin | Purpose | Terminals | Terminals Used | 21 | | ------------- | :---: | ------------- | ------------- | ------------- | 22 | | **Relay1** | **GPIO21** | **Garage Door Switch** | NO, C, NC| **NO, C** | 23 | | Relay2 | GPIO22 | Unused | NO, C, NC| Unused | 24 | | Relay3 | GPIO18 | Unused | NO, C, NC| Unused | 25 | | Relay4 | GPIO19 | Unused | NO, C, NC| Unused | 26 | | AN1 | GPIO36 | Unused | AN1+, AN1- | Unused | 27 | | IN1 | GPIO05 | Unused | IN1+, IN1- | Unused | 28 | | **IN2** | **GPIO12** | **Garage Door Sensor** | IN2+, IN2- | **IN2+, IN2-** | 29 | | IN3 | GPIO13 | Unused | IN3+, IN3- | Unused | 30 | | **IN4** | **GPIO14** | **Dallas Temp Sensor (Yellow)** | IN4+, IN4- | **IN4+, 4.7K Ohm Resistor** | 31 | | **3.3V** | NA | **Dallas Temp Sensor (Red)** | 3.3v+ | **3.3v+** | 32 | | **5v** | NA | **Dallas Temp Sensor (Black**) | 5v+, 5v- | **5v-, 4.7K Ohm Resistor** | 33 | 34 | ## Images 35 | ![UI](images/4RelayESP32.jpeg?raw=true "ESP32") 36 | 37 | ## Home Assistant UI Example 38 | ![UI](images/ha-esp32.png?raw=true "HA UI Example") 39 | -------------------------------------------------------------------------------- /esphome/garage_door_relay/garage_door_relay.yaml: -------------------------------------------------------------------------------- 1 | esphome: 2 | name: garage-door 3 | platform: ESP32 4 | board: nodemcu-32s 5 | 6 | wifi: 7 | ssid: !secret wifi_ssid 8 | password: !secret wifi_password 9 | domain: !secret domain 10 | 11 | # Enable fallback hotspot (captive portal) in case wifi connection fails 12 | ap: 13 | ssid: "Garage Door Relay" 14 | password: !secret ap_password 15 | 16 | captive_portal: 17 | 18 | # Enable logging 19 | logger: 20 | 21 | # Enable Home Assistant API 22 | api: 23 | encryption: 24 | key: !secret garage_api_key 25 | 26 | ota: 27 | password: !secret ota_password 28 | 29 | # Enable Web server 30 | web_server: 31 | port: 80 32 | 33 | #Garage Door 34 | 35 | binary_sensor: 36 | - platform: gpio 37 | pin: 38 | number: GPIO12 39 | mode: INPUT_PULLUP 40 | inverted: False 41 | name: "Garage Door Sensor" 42 | id: garage_door_sensor 43 | device_class: garage_door 44 | filters: 45 | - delayed_on: 500ms 46 | - delayed_off: 500ms 47 | - delayed_on_off: 1s 48 | 49 | switch: 50 | - platform: gpio 51 | id: relay1 52 | pin: 53 | number: GPIO21 54 | inverted: False 55 | restore_mode: ALWAYS_OFF 56 | - platform: template 57 | name: "Garage Door Switch" 58 | icon: "mdi:garage" 59 | turn_on_action: 60 | - switch.turn_on: relay1 61 | - delay: 1s 62 | - switch.turn_off: relay1 63 | 64 | cover: 65 | - platform: template 66 | name: Garage Door 67 | device_class: garage 68 | lambda: !lambda |- 69 | if (id(garage_door_sensor).state) { 70 | return COVER_OPEN; 71 | } else { 72 | return COVER_CLOSED; 73 | } 74 | open_action: 75 | - switch.turn_on: relay1 76 | - delay: 1s 77 | - switch.turn_off: relay1 78 | close_action: 79 | - switch.turn_on: relay1 80 | - delay: 1s 81 | - switch.turn_off: relay1 82 | stop_action: 83 | - switch.turn_on: relay1 84 | - delay: 1s 85 | - switch.turn_off: relay1 86 | 87 | #Temperature Sensor 88 | 89 | sensor: 90 | - platform: dallas 91 | address: 0x8B01192D506AD828 92 | name: "Garage Temperature" 93 | 94 | dallas: 95 | - pin: 14 -------------------------------------------------------------------------------- /esphome/garage_door_relay/images/4RelayESP32.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/esphome/garage_door_relay/images/4RelayESP32.jpeg -------------------------------------------------------------------------------- /esphome/garage_door_relay/images/ha-esp32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/esphome/garage_door_relay/images/ha-esp32.png -------------------------------------------------------------------------------- /groups.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Groups 3 | ################################################################# 4 | 5 | Household: 6 | - person.USER1 7 | - person.USER2 -------------------------------------------------------------------------------- /homekit.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## HomeKit 3 | ################################################################# 4 | 5 | ################################################################# 6 | ## HomeKit bridge Mode 7 | ################################################################# 8 | 9 | - name: Lights 10 | mode: bridge 11 | port: 21078 12 | filter: 13 | include_entities: 14 | - light.living_room_lamps 15 | - light.globe 16 | - light.media_center_lighting 17 | - light.living_room_ceiling_east 18 | - light.living_room_ceiling_west 19 | - light.dining_room_table 20 | - light.dining_room_ceiling 21 | - light.kitchen_ceiling 22 | - light.kitchen_cabinets 23 | - light.kitchen_sink 24 | - light.hallway_light 25 | - light.bathroom_vanity 26 | - light.bathroom_shower 27 | - light.bedroom_ceiling 28 | - light.USER1s_nightstand 29 | - light.USER2s_nightstand 30 | - light.bedroom_lamp 31 | - light.bedroom_closet_ceiling 32 | - light.closet_lamp 33 | - light.stairs_light 34 | - light.office_lamp 35 | - light.USER1_s_office_ceiling 36 | - light.USER1_office_desk_lamp 37 | - light.USER1_office_desk_accent 38 | - light.moon_globe 39 | - light.USER2_s_office_ceiling 40 | - light.guest_bedroom_ceiling 41 | - light.guest_bedroom_nightstand 42 | - light.upstairs_bathroom_vanity 43 | - light.basement_lights 44 | - light.basement_lamp 45 | - light.basement_stairs 46 | - light.work_bench_light 47 | - light.laundry_room_light 48 | - light.craft_room_ceiling 49 | - light.jupitier_globe 50 | - light.fitness_room_ceiling 51 | - light.front_porch 52 | - light.back_door 53 | - light.backyard_deck 54 | - light.backyard_patio 55 | - light.garage_light 56 | - light.garage_interior 57 | 58 | - name: Covers 59 | mode: bridge 60 | port: 21079 61 | filter: 62 | include_entities: 63 | - cover.garage_door 64 | - cover.USER1_s_office_blinds 65 | - cover.USER2_s_office_blinds 66 | - cover.stairs_blinds 67 | - cover.kitchen_blinds 68 | - cover.bedroom_closet_blinds 69 | 70 | - name: Switches 71 | mode: bridge 72 | port: 21080 73 | filter: 74 | include_entities: 75 | - switch.front_yard_lighting 76 | - switch.backyard_lighting 77 | - switch.USER1s_office_air_purifier 78 | - switch.fountain 79 | - switch.fireplace 80 | 81 | - name: Vacuums 82 | mode: bridge 83 | port: 21081 84 | filter: 85 | include_entities: 86 | - vacuum.main_floor_roomba 87 | - vacuum.upstairs_roomba 88 | - vacuum.basement_roomba 89 | 90 | - name: Fans 91 | mode: bridge 92 | port: 21082 93 | filter: 94 | include_entities: 95 | - fan.USER1s_office_fan 96 | - fan.living_room_east 97 | - fan.living_room_west 98 | 99 | - name: Binary Sensors 100 | mode: bridge 101 | port: 21084 102 | filter: 103 | include_entities: 104 | - binary_sensor.living_room_motion 105 | - binary_sensor.dining_room_motion 106 | - binary_sensor.kitchen_motion 107 | - binary_sensor.bathroom_motion 108 | - binary_sensor.USER1s_office_motion 109 | - binary_sensor.USER2s_office_motion 110 | - binary_sensor.stairs_motion 111 | - binary_sensor.upstairs_bathroom_motion 112 | - binary_sensor.basement_motion 113 | - binary_sensor.craft_room_motion 114 | - binary_sensor.fitness_room_motion 115 | - binary_sensor.front_door_opened 116 | - binary_sensor.back_door_opened 117 | - binary_sensor.basement_door_opened 118 | 119 | - name: Sensors 120 | mode: bridge 121 | port: 21085 122 | filter: 123 | include_entities: 124 | - sensor.living_room_temperature 125 | - sensor.main_floor_temperature 126 | - sensor.kitchen_temperature 127 | - sensor.bedroom_temperature 128 | - sensor.bathroom_temperature 129 | - sensor.office_temperature 130 | - sensor.USER2_office_temperature 131 | - sensor.guest_bedroom_temperature 132 | - sensor.basement_temperature 133 | - sensor.laundry_room_temperature 134 | - sensor.garage_temperature 135 | - sensor.office_fan_humidity 136 | - sensor.craft_room_temperature 137 | - sensor.fitness_room_temperature 138 | - sensor.bathroom_humidity 139 | - sensor.craft_room_humidity 140 | - sensor.fitness_room_humidity 141 | - sensor.main_floor_humidity 142 | - sensor.office_fan_humidity 143 | 144 | - name: Input Boolean 145 | mode: bridge 146 | port: 21086 147 | filter: 148 | include_entities: 149 | - input_boolean.bedtime 150 | 151 | ################################################################# 152 | ## HomeKit Accessory Mode 153 | ################################################################# 154 | 155 | - name: Front Door Camera 156 | mode: accessory 157 | port: 21077 158 | filter: 159 | include_entities: 160 | - camera.front_door 161 | entity_config: 162 | camera.front_door: 163 | video_codec: copy 164 | linked_motion_sensor: binary_sensor.front_door_camera_person_detected 165 | linked_doorbell_sensor: binary_sensor.front_door_camera_doorbell 166 | 167 | - name: Front Porch Camera 168 | mode: accessory 169 | port: 21064 170 | filter: 171 | include_entities: 172 | - camera.front_porch 173 | entity_config: 174 | camera.front_porch: 175 | video_codec: copy 176 | 177 | - name: Driveway Camera 178 | mode: accessory 179 | port: 21065 180 | filter: 181 | include_entities: 182 | - camera.driveway 183 | entity_config: 184 | camera.driveway: 185 | video_codec: copy 186 | 187 | - name: Backyard Gate Camera 188 | mode: accessory 189 | port: 21066 190 | filter: 191 | include_entities: 192 | - camera.backyard_gate 193 | entity_config: 194 | camera.backyard_gate: 195 | video_codec: copy 196 | 197 | - name: Backyard Camera 198 | mode: accessory 199 | port: 21067 200 | filter: 201 | include_entities: 202 | - camera.backyard 203 | entity_config: 204 | camera.backyard: 205 | video_codec: copy 206 | 207 | - name: Side Yard Camera 208 | mode: accessory 209 | port: 21068 210 | filter: 211 | include_entities: 212 | - camera.side_yard 213 | entity_config: 214 | camera.side_yard: 215 | video_codec: copy 216 | 217 | - name: Garage Camera 218 | mode: accessory 219 | port: 21069 220 | filter: 221 | include_entities: 222 | - camera.garage 223 | entity_config: 224 | camera.garage: 225 | video_codec: copy 226 | linked_motion_sensor: binary_sensor.garage_camera_object_detected 227 | 228 | - name: Front Yard Camera 229 | mode: accessory 230 | port: 21070 231 | filter: 232 | include_entities: 233 | - camera.front_yard 234 | entity_config: 235 | camera.front_yard: 236 | video_codec: copy 237 | 238 | - name: Front Door Lock 239 | mode: accessory 240 | port: 21071 241 | filter: 242 | include_entities: 243 | - lock.front_door 244 | entity_config: 245 | lock.front_door: 246 | linked_battery_sensor: sensor.front_door_lock_batt 247 | 248 | - name: Back Door Lock 249 | mode: accessory 250 | port: 21072 251 | filter: 252 | include_entities: 253 | - lock.back_door 254 | entity_config: 255 | lock.back_door: 256 | linked_battery_sensor: sensor.back_door_lock_batt 257 | 258 | - name: Basement Door Lock 259 | mode: accessory 260 | port: 21073 261 | filter: 262 | include_entities: 263 | - lock.basement_door 264 | entity_config: 265 | lock.basement_door: 266 | linked_battery_sensor: sensor.basement_door_lock_batt 267 | 268 | - name: Living Room TV 269 | mode: accessory 270 | port: 21074 271 | filter: 272 | include_entities: 273 | - remote.living_room_tv 274 | 275 | - name: Bedroom TV 276 | mode: accessory 277 | port: 21075 278 | filter: 279 | include_entities: 280 | - remote.bedroom_tv 281 | 282 | - name: USER1's Office TV 283 | mode: accessory 284 | port: 21076 285 | filter: 286 | include_entities: 287 | - remote.USER1_s_office_tv 288 | 289 | - name: Alarm 290 | mode: accessory 291 | port: 21087 292 | filter: 293 | include_entities: 294 | - alarm_control_panel.alarm 295 | 296 | - name: Thermostat 297 | mode: accessory 298 | port: 21089 299 | filter: 300 | include_entities: 301 | - climate.main_floor 302 | 303 | - name: USER1's Office Heater 304 | mode: accessory 305 | port: 21090 306 | filter: 307 | include_entities: 308 | - climate.USER1s_office_fan -------------------------------------------------------------------------------- /images/3d-print-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/3d-print-screenshot.jpg -------------------------------------------------------------------------------- /images/alarm-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/alarm-screenshot.jpg -------------------------------------------------------------------------------- /images/basement-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/basement-screenshot.jpg -------------------------------------------------------------------------------- /images/bath-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/bath-screenshot.jpg -------------------------------------------------------------------------------- /images/bedrooms-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/bedrooms-screenshot.jpg -------------------------------------------------------------------------------- /images/dining-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/dining-screenshot.jpg -------------------------------------------------------------------------------- /images/home-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/home-screenshot.jpg -------------------------------------------------------------------------------- /images/living-room-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/living-room-screenshot.jpg -------------------------------------------------------------------------------- /images/offices-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/offices-screenshot.jpg -------------------------------------------------------------------------------- /images/outdoor-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/outdoor-screenshot.jpg -------------------------------------------------------------------------------- /images/power-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/power-screenshot.jpg -------------------------------------------------------------------------------- /images/system-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/system-screenshot.jpg -------------------------------------------------------------------------------- /images/upstairs-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/upstairs-screenshot.jpg -------------------------------------------------------------------------------- /images/water-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/water-screenshot.jpg -------------------------------------------------------------------------------- /images/weather-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekofweek/homeassistant/5200bc1e92d544650c77d1923d73f458c9ae159f/images/weather-screenshot.jpg -------------------------------------------------------------------------------- /ios.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## iOS Actions 3 | ################################################################# 4 | 5 | actions: 6 | 7 | ################################################################# 8 | ## Bedtime 9 | ################################################################# 10 | 11 | - name: Bedtime 12 | background_color: "#ffffff" 13 | label: 14 | text: "Bedtime" 15 | color: "#000000" 16 | icon: 17 | icon: bed 18 | color: "#46A7F3" 19 | show_in_carplay: false 20 | show_in_watch: true 21 | use_custom_colors: true 22 | 23 | ################################################################# 24 | ## Disarm Alarm 25 | ################################################################# 26 | 27 | - name: Disarm Alarm 28 | background_color: "#ffffff" 29 | label: 30 | text: "Disable Alarm" 31 | color: "#000000" 32 | icon: 33 | icon: shield_home 34 | color: "#ff0000" 35 | show_in_carplay: true 36 | show_in_watch: true 37 | use_custom_colors: true 38 | 39 | ################################################################# 40 | ## Toggle Fireplace 41 | ################################################################# 42 | 43 | - name: Toggle Fireplace 44 | background_color: "#ffffff" 45 | label: 46 | text: "Fireplace" 47 | color: "#000000" 48 | icon: 49 | icon: fire 50 | color: "#FFA500" 51 | show_in_carplay: false 52 | show_in_watch: true 53 | use_custom_colors: true 54 | 55 | ################################################################# 56 | ## Toggle Garage Door 57 | ################################################################# 58 | 59 | - name: Toggle Garage Door 60 | background_color: "#ffffff" 61 | label: 62 | text: "Garage" 63 | color: "#000000" 64 | icon: 65 | icon: garage 66 | color: "#8E6EC6" 67 | show_in_carplay: true 68 | show_in_watch: true 69 | use_custom_colors: true 70 | 71 | ################################################################# 72 | ## Unlock Front Door 73 | ################################################################# 74 | 75 | - name: Unlock Front Door 76 | background_color: "#ffffff" 77 | label: 78 | text: "Unlock Front Door" 79 | color: "#000000" 80 | icon: 81 | icon: lock-open 82 | color: "#ff0000" 83 | show_in_carplay: true 84 | show_in_watch: true 85 | use_custom_colors: true 86 | 87 | ################################################################# 88 | ## Unlock Back Door 89 | ################################################################# 90 | 91 | - name: Unlock Back Door 92 | background_color: "#ffffff" 93 | label: 94 | text: "Back Door" 95 | color: "#000000" 96 | icon: 97 | icon: lock-open 98 | color: "#ff0000" 99 | show_in_carplay: true 100 | show_in_watch: true 101 | use_custom_colors: true 102 | 103 | ################################################################# 104 | ## Unlock Basement Door 105 | ################################################################# 106 | 107 | - name: Unlock Basement Door 108 | background_color: "#ffffff" 109 | label: 110 | text: "Basement Door" 111 | color: "#000000" 112 | icon: 113 | icon: lock-open 114 | color: "#ff0000" 115 | show_in_carplay: true 116 | show_in_watch: true 117 | use_custom_colors: true 118 | 119 | ################################################################# 120 | ## Lock Doors 121 | ################################################################# 122 | 123 | - name: Lock Doors 124 | background_color: "#ffffff" 125 | label: 126 | text: "Lock Doors" 127 | color: "#000000" 128 | icon: 129 | icon: lock 130 | color: "#61AC51" 131 | show_in_carplay: true 132 | show_in_watch: true 133 | use_custom_colors: true 134 | 135 | ################################################################# 136 | ## Toggle Living Room Fans 137 | ################################################################# 138 | 139 | - name: Toggle Living Room Fans 140 | background_color: "#ffffff" 141 | label: 142 | text: "Fans On/Off" 143 | color: "#000000" 144 | icon: 145 | icon: fan 146 | color: "#4DB9D3" 147 | show_in_carplay: false 148 | show_in_watch: true 149 | use_custom_colors: true 150 | 151 | ################################################################# 152 | ## Living Room Fans Increase Speed 153 | ################################################################# 154 | 155 | - name: Living Room Fans Increase Speed 156 | background_color: "#ffffff" 157 | label: 158 | text: "Fans Up" 159 | color: "#000000" 160 | icon: 161 | icon: fan-chevron-up 162 | color: "#4DB9D3" 163 | show_in_carplay: false 164 | show_in_watch: true 165 | use_custom_colors: true 166 | 167 | ################################################################# 168 | ## Living Room Fans Decrease Speed 169 | ################################################################# 170 | 171 | - name: Living Room Fans Decrease Speed 172 | background_color: "#ffffff" 173 | label: 174 | text: "Fans Down" 175 | color: "#000000" 176 | icon: 177 | icon: fan-chevron-down 178 | color: "#4DB9D3" 179 | show_in_carplay: false 180 | show_in_watch: true 181 | use_custom_colors: true 182 | 183 | ################################################################# 184 | ## Party Mode 185 | ################################################################# 186 | 187 | - name: Party Mode 188 | background_color: "#ffffff" 189 | label: 190 | text: "Party Mode" 191 | color: "#000000" 192 | icon: 193 | icon: party-popper 194 | color: "#a83295" 195 | show_in_carplay: false 196 | show_in_watch: true 197 | use_custom_colors: true -------------------------------------------------------------------------------- /python_scripts/basement_roomba.py: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Basement Roomba Room Clean Script 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Region ID / Room Type 7 | ########################################################## 8 | 9 | regions = { 10 | 'utility_area': {'region_id': '9', 'type': 'rid'}, 11 | 'fitness_room': {'region_id': '5', 'type': 'rid'}, 12 | 'craft_room': {'region_id': '1', 'type': 'rid'}, 13 | 'laundry_room': {'region_id': '8', 'type': 'rid'}, 14 | 'workbench': {'region_id': '7', 'type': 'rid'} 15 | } 16 | 17 | ########################################################## 18 | ## List Selection 19 | ########################################################## 20 | 21 | selection_list = [] 22 | regions_list = [] 23 | 24 | ########################################################## 25 | ## Add Input Boolean to List 26 | ########################################################## 27 | 28 | if hass.states.get('input_boolean.roomba_clean_utility_area').state == 'on': 29 | selection_list.append(hass.states.get('input_boolean.roomba_clean_utility_area')) 30 | if hass.states.get('input_boolean.roomba_clean_fitness_room').state == 'on': 31 | selection_list.append(hass.states.get('input_boolean.roomba_clean_fitness_room')) 32 | if hass.states.get('input_boolean.roomba_clean_craft_room').state == 'on': 33 | selection_list.append(hass.states.get('input_boolean.roomba_clean_craft_room')) 34 | if hass.states.get('input_boolean.roomba_clean_laundry_room').state == 'on': 35 | selection_list.append(hass.states.get('input_boolean.roomba_clean_laundry_room')) 36 | if hass.states.get('input_boolean.roomba_clean_workbench').state == 'on': 37 | selection_list.append(hass.states.get('input_boolean.roomba_clean_workbench')) 38 | 39 | ########################################################## 40 | ## Sort by Timestamp 41 | ########################################################## 42 | 43 | selection_list.sort(key=lambda x:x.last_updated) 44 | 45 | ########################################################## 46 | ## Add Data to List 47 | ########################################################## 48 | 49 | for selection in selection_list: 50 | if selection == hass.states.get('input_boolean.roomba_clean_utility_area'): 51 | regions_list.append(regions['utility_area']) 52 | if selection == hass.states.get('input_boolean.roomba_clean_fitness_room'): 53 | regions_list.append(regions['fitness_room']) 54 | if selection == hass.states.get('input_boolean.roomba_clean_craft_room'): 55 | regions_list.append(regions['craft_room']) 56 | if selection == hass.states.get('input_boolean.roomba_clean_laundry_room'): 57 | regions_list.append(regions['laundry_room']) 58 | if selection == hass.states.get('input_boolean.roomba_clean_workbench'): 59 | regions_list.append(regions['workbench']) 60 | 61 | ########################################################## 62 | ## Clear Input Boolean Selection 63 | ########################################################## 64 | 65 | hass.states.set('input_boolean.roomba_clean_utility_area', 'off', '') 66 | hass.states.set('input_boolean.roomba_clean_fitness_room', 'off', '') 67 | hass.states.set('input_boolean.roomba_clean_craft_room', 'off', '') 68 | hass.states.set('input_boolean.roomba_clean_laundry_room', 'off', '') 69 | hass.states.set('input_boolean.roomba_clean_workbench', 'off', '') 70 | 71 | ########################################################## 72 | ## Data to Send 73 | ########################################################## 74 | 75 | service_data = { 76 | 'entity_id': 'vacuum.basement_roomba', 77 | 'command': 'start', 78 | 'params': { 79 | 'pmap_id': 'REDACTED', 80 | 'regions': regions_list, 81 | 'ordered': 1, 82 | } 83 | } 84 | 85 | ########################################################## 86 | ## Send Command to Roomba 87 | ########################################################## 88 | 89 | hass.services.call('vacuum', 'send_command', service_data, False) -------------------------------------------------------------------------------- /python_scripts/main_floor_roomba.py: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Main Floor Roomba Room Clean Script 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Region ID / Room Type 7 | ########################################################## 8 | 9 | regions = { 10 | 'living_room': {'region_id': '7', 'type': 'rid'}, 11 | 'dining_room': {'region_id': '11', 'type': 'rid'}, 12 | 'kitchen': {'region_id': '9', 'type': 'rid'}, 13 | 'hallway': {'region_id': '0', 'type': 'rid'}, 14 | 'bathroom': {'region_id': '4', 'type': 'rid'}, 15 | 'bedroom': {'region_id': '2', 'type': 'rid'}, 16 | 'bedroom_closet': {'region_id': '10', 'type': 'rid'}, 17 | 'front_door': {'region_id': '1', 'type': 'zid'}, 18 | 'back_door': {'region_id': '0', 'type': 'zid'}, 19 | 'dining_room_table': {'region_id': '2', 'type': 'zid'} 20 | } 21 | 22 | ########################################################## 23 | ## List Selection 24 | ########################################################## 25 | 26 | selection_list = [] 27 | regions_list = [] 28 | 29 | ########################################################## 30 | ## Add Input Boolean to List 31 | ########################################################## 32 | 33 | if hass.states.get('input_boolean.roomba_clean_living_room').state == 'on': 34 | selection_list.append(hass.states.get('input_boolean.roomba_clean_living_room')) 35 | if hass.states.get('input_boolean.roomba_clean_dining_room').state == 'on': 36 | selection_list.append(hass.states.get('input_boolean.roomba_clean_dining_room')) 37 | if hass.states.get('input_boolean.roomba_clean_kitchen').state == 'on': 38 | selection_list.append(hass.states.get('input_boolean.roomba_clean_kitchen')) 39 | if hass.states.get('input_boolean.roomba_clean_hallway').state == 'on': 40 | selection_list.append(hass.states.get('input_boolean.roomba_clean_hallway')) 41 | if hass.states.get('input_boolean.roomba_clean_bathroom').state == 'on': 42 | selection_list.append(hass.states.get('input_boolean.roomba_clean_bathroom')) 43 | if hass.states.get('input_boolean.roomba_clean_bedroom').state == 'on': 44 | selection_list.append(hass.states.get('input_boolean.roomba_clean_bedroom')) 45 | if hass.states.get('input_boolean.roomba_clean_bedroom_closet').state == 'on': 46 | selection_list.append(hass.states.get('input_boolean.roomba_clean_bedroom_closet')) 47 | if hass.states.get('input_boolean.roomba_clean_front_door').state == 'on': 48 | selection_list.append(hass.states.get('input_boolean.roomba_clean_front_door')) 49 | if hass.states.get('input_boolean.roomba_clean_back_door').state == 'on': 50 | selection_list.append(hass.states.get('input_boolean.roomba_clean_back_door')) 51 | if hass.states.get('input_boolean.roomba_clean_dining_room_table').state == 'on': 52 | selection_list.append(hass.states.get('input_boolean.roomba_clean_dining_room_table')) 53 | 54 | ########################################################## 55 | ## Sort by Timestamp 56 | ########################################################## 57 | 58 | selection_list.sort(key=lambda x:x.last_updated) 59 | 60 | ########################################################## 61 | ## Data into List Sorted 62 | ########################################################## 63 | 64 | for selection in selection_list: 65 | if selection == hass.states.get('input_boolean.roomba_clean_living_room'): 66 | regions_list.append(regions['living_room']) 67 | if selection == hass.states.get('input_boolean.roomba_clean_dining_room'): 68 | regions_list.append(regions['dining_room']) 69 | if selection == hass.states.get('input_boolean.roomba_clean_kitchen'): 70 | regions_list.append(regions['kitchen']) 71 | if selection == hass.states.get('input_boolean.roomba_clean_hallway'): 72 | regions_list.append(regions['hallway']) 73 | if selection == hass.states.get('input_boolean.roomba_clean_bathroom'): 74 | regions_list.append(regions['bathroom']) 75 | if selection == hass.states.get('input_boolean.roomba_clean_bedroom'): 76 | regions_list.append(regions['bedroom']) 77 | if selection == hass.states.get('input_boolean.roomba_clean_bedroom_closet'): 78 | regions_list.append(regions['bedroom_closet']) 79 | if selection == hass.states.get('input_boolean.roomba_clean_front_door'): 80 | regions_list.append(regions['front_door']) 81 | if selection == hass.states.get('input_boolean.roomba_clean_back_door'): 82 | regions_list.append(regions['back_door']) 83 | if selection == hass.states.get('input_boolean.roomba_clean_dining_room_table'): 84 | regions_list.append(regions['dining_room_table']) 85 | 86 | ########################################################## 87 | ## Clear Input Boolean Selection 88 | ########################################################## 89 | 90 | hass.states.set('input_boolean.roomba_clean_living_room', 'off', '') 91 | hass.states.set('input_boolean.roomba_clean_dining_room', 'off', '') 92 | hass.states.set('input_boolean.roomba_clean_kitchen', 'off', '') 93 | hass.states.set('input_boolean.roomba_clean_hallway', 'off', '') 94 | hass.states.set('input_boolean.roomba_clean_bathroom', 'off', '') 95 | hass.states.set('input_boolean.roomba_clean_bedroom', 'off', '') 96 | hass.states.set('input_boolean.roomba_clean_bedroom_closet', 'off', '') 97 | hass.states.set('input_boolean.roomba_clean_front_door', 'off', '') 98 | hass.states.set('input_boolean.roomba_clean_back_door', 'off', '') 99 | hass.states.set('input_boolean.roomba_clean_dining_room_table', 'off', '') 100 | 101 | ########################################################## 102 | ## Data to Send 103 | ########################################################## 104 | 105 | service_data = { 106 | 'entity_id': 'vacuum.main_floor_roomba', 107 | 'command': 'start', 108 | 'params': { 109 | 'pmap_id': 'REDACTED', 110 | 'regions': regions_list, 111 | 'ordered': 1, 112 | } 113 | } 114 | 115 | ########################################################## 116 | ## Send Command to Roomba 117 | ########################################################## 118 | 119 | hass.services.call('vacuum', 'send_command', service_data, False) -------------------------------------------------------------------------------- /python_scripts/upstairs_roomba.py: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Upstairs Roomba Room Clean Script 3 | ################################################################# 4 | 5 | ########################################################## 6 | ## Region ID / Room Type 7 | ########################################################## 8 | 9 | regions = { 10 | 'USER1_office': {'region_id': '2', 'type': 'rid'}, 11 | 'USER2_office': {'region_id': '7', 'type': 'rid'}, 12 | 'guest_bedroom': {'region_id': '1', 'type': 'rid'}, 13 | 'upstairs_hallway': {'region_id': '8', 'type': 'rid'} 14 | } 15 | 16 | ########################################################## 17 | ## List Selection 18 | ########################################################## 19 | 20 | selection_list = [] 21 | regions_list = [] 22 | 23 | ########################################################## 24 | ## Add Input Boolean to List 25 | ########################################################## 26 | 27 | if hass.states.get('input_boolean.roomba_clean_USER1_office').state == 'on': 28 | selection_list.append(hass.states.get('input_boolean.roomba_clean_USER1_office')) 29 | if hass.states.get('input_boolean.roomba_clean_USER2_office').state == 'on': 30 | selection_list.append(hass.states.get('input_boolean.roomba_clean_USER2_office')) 31 | if hass.states.get('input_boolean.roomba_clean_guest_bedroom').state == 'on': 32 | selection_list.append(hass.states.get('input_boolean.roomba_clean_guest_bedroom')) 33 | if hass.states.get('input_boolean.roomba_clean_upstairs_hallway').state == 'on': 34 | selection_list.append(hass.states.get('input_boolean.roomba_clean_upstairs_hallway')) 35 | 36 | ########################################################## 37 | ## Sort by Timestamp 38 | ########################################################## 39 | 40 | selection_list.sort(key=lambda x:x.last_updated) 41 | 42 | ########################################################## 43 | ## Data into List Sorted 44 | ########################################################## 45 | 46 | for selection in selection_list: 47 | if selection == hass.states.get('input_boolean.roomba_clean_USER1_office'): 48 | regions_list.append(regions['USER1_office']) 49 | if selection == hass.states.get('input_boolean.roomba_clean_USER2_office'): 50 | regions_list.append(regions['USER2_office']) 51 | if selection == hass.states.get('input_boolean.roomba_clean_guest_bedroom'): 52 | regions_list.append(regions['guest_bedroom']) 53 | if selection == hass.states.get('input_boolean.roomba_clean_upstairs_hallway'): 54 | regions_list.append(regions['upstairs_hallway']) 55 | 56 | ########################################################## 57 | ## Clear Input Boolean Selection 58 | ########################################################## 59 | 60 | hass.states.set('input_boolean.roomba_clean_USER1_office', 'off', '') 61 | hass.states.set('input_boolean.roomba_clean_USER2_office', 'off', '') 62 | hass.states.set('input_boolean.roomba_clean_guest_bedroom', 'off', '') 63 | hass.states.set('input_boolean.roomba_clean_upstairs_hallway', 'off', '') 64 | 65 | ########################################################## 66 | ## Data to Send 67 | ########################################################## 68 | 69 | service_data = { 70 | 'entity_id': 'vacuum.upstairs_roomba', 71 | 'command': 'start', 72 | 'params': { 73 | 'pmap_id': 'REDACTED', 74 | 'regions': regions_list, 75 | 'ordered': 1, 76 | } 77 | } 78 | 79 | ########################################################## 80 | ## Send Command to Roomba 81 | ########################################################## 82 | 83 | hass.services.call('vacuum', 'send_command', service_data, False) -------------------------------------------------------------------------------- /recorder.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Recorder 3 | ################################################################# 4 | 5 | db_url: !secret db_url -------------------------------------------------------------------------------- /sensors.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Sensors 3 | ################################################################# 4 | 5 | ################################################################# 6 | ## RESTful Sensors 7 | ################################################################# 8 | 9 | ########################################################## 10 | ## Prusa MK3 API Version 11 | ########################################################## 12 | 13 | - platform: rest 14 | resource: http://prusa-mk3.network.REDACTED/api/version 15 | unique_id: prusa_mk3_api_version 16 | name: Prusa MK3 API Version 17 | username: !secret prusalink_mk3_user 18 | password: !secret prusalink_mk3_pass 19 | authentication: digest 20 | method: GET 21 | scan_interval: 3 22 | headers: 23 | Content-Type: application/json 24 | value_template: "{{value_json['api'] | lower }}" 25 | json_attributes: 26 | - "api" 27 | - "server" 28 | - "firmware" 29 | - "sdk" 30 | 31 | ########################################################## 32 | ## Prusa MK3 Legacy Job 33 | ########################################################## 34 | 35 | - platform: rest 36 | resource: http://prusa-mk3.network.REDACTED/api/job 37 | unique_id: prusa_mk3_api_legacy_job 38 | name: Prusa MK3 API Legacy Job 39 | username: !secret prusalink_mk3_user 40 | password: !secret prusalink_mk3_pass 41 | authentication: digest 42 | method: GET 43 | scan_interval: 3 44 | headers: 45 | Content-Type: application/json 46 | value_template: "{{ value_json.state | lower }}" 47 | json_attributes: 48 | - "job" 49 | - "progress" 50 | - "file" 51 | - "state" 52 | 53 | ########################################################## 54 | ## Prusa MK3 Legacy Telemetry 55 | ########################################################## 56 | 57 | - platform: rest 58 | resource: http://prusa-mk3.network.REDACTED/api/printer 59 | unique_id: prusa_mk3_api_legacy_telemetry 60 | name: Prusa MK3 API Legacy Telemetry 61 | username: !secret prusalink_mk3_user 62 | password: !secret prusalink_mk3_pass 63 | authentication: digest 64 | method: GET 65 | scan_interval: 3 66 | headers: 67 | Content-Type: application/json 68 | value_template: "OK" 69 | json_attributes: 70 | - "telemetry" 71 | - "temperature" 72 | - "state" 73 | 74 | ########################################################## 75 | ## Prusa MK3 Job 76 | ########################################################## 77 | 78 | - platform: rest 79 | resource: http://prusa-mk3.network.REDACTED/api/v1/job 80 | unique_id: prusa_mk3_api_job 81 | name: Prusa MK3 API Job 82 | username: !secret prusalink_mk3_user 83 | password: !secret prusalink_mk3_pass 84 | authentication: digest 85 | method: GET 86 | scan_interval: 3 87 | headers: 88 | Content-Type: application/json 89 | value_template: "{{ value_json.state | lower }}" 90 | json_attributes: 91 | - "state" 92 | - "progress" 93 | - "time_remaining" 94 | - "time_printing" 95 | - "file" 96 | 97 | ########################################################## 98 | ## Prusa MK3 Info 99 | ########################################################## 100 | 101 | - platform: rest 102 | resource: http://prusa-mk3.network.REDACTED/api/v1/info 103 | unique_id: prusa_mk3_api_info 104 | name: Prusa MK3 API Info 105 | username: !secret prusalink_mk3_user 106 | password: !secret prusalink_mk3_pass 107 | authentication: digest 108 | method: GET 109 | scan_interval: 3 110 | headers: 111 | Content-Type: application/json 112 | value_template: "OK" 113 | json_attributes: 114 | - "name" 115 | - "nozzle_diameter" 116 | - "min_extrusion_temp" 117 | 118 | ########################################################## 119 | ## Prusa MK3 Status 120 | ########################################################## 121 | 122 | - platform: rest 123 | resource: http://prusa-mk3.network.REDACTED/api/v1/status 124 | unique_id: prusa_mk3_api_status 125 | name: Prusa MK3 API Status 126 | username: !secret prusalink_mk3_user 127 | password: !secret prusalink_mk3_pass 128 | authentication: digest 129 | method: GET 130 | scan_interval: 3 131 | headers: 132 | Content-Type: application/json 133 | value_template: "{{value_json['printer'].state | lower }}" 134 | json_attributes: 135 | - "storage" 136 | - "printer" -------------------------------------------------------------------------------- /switch.yaml: -------------------------------------------------------------------------------- 1 | ################################################################# 2 | ## Switches 3 | ################################################################# 4 | 5 | ################################################################# 6 | ## Template Switches 7 | ################################################################# 8 | 9 | ########################################################## 10 | ## Living Room Random Light Color 11 | ########################################################## 12 | 13 | - platform: template 14 | switches: 15 | livingroom_rainbow: 16 | value_template: "{{ is_state('input_boolean.livingroom_rainbow', 'on') }}" 17 | turn_on: 18 | service: homeassistant.turn_on 19 | data: 20 | entity_id: input_boolean.livingroom_rainbow 21 | turn_off: 22 | service: homeassistant.turn_off 23 | data: 24 | entity_id: input_boolean.livingroom_rainbow 25 | 26 | ########################################################## 27 | ## Bedroom Random Light Color 28 | ########################################################## 29 | 30 | - platform: template 31 | switches: 32 | bedroom_rainbow: 33 | value_template: "{{ is_state('input_boolean.bedroom_rainbow', 'on') }}" 34 | turn_on: 35 | service: homeassistant.turn_on 36 | data: 37 | entity_id: input_boolean.bedroom_rainbow 38 | turn_off: 39 | service: homeassistant.turn_off 40 | data: 41 | entity_id: input_boolean.bedroom_rainbow 42 | 43 | ########################################################## 44 | ## Office Random Light Color 45 | ########################################################## 46 | 47 | - platform: template 48 | switches: 49 | office_rainbow: 50 | value_template: "{{ is_state('input_boolean.office_rainbow', 'on') }}" 51 | turn_on: 52 | service: homeassistant.turn_on 53 | data: 54 | entity_id: input_boolean.office_rainbow 55 | turn_off: 56 | service: homeassistant.turn_off 57 | data: 58 | entity_id: input_boolean.office_rainbow 59 | 60 | ########################################################## 61 | ## Front Porch Random Light Color 62 | ########################################################## 63 | 64 | - platform: template 65 | switches: 66 | front_porch_rainbow: 67 | value_template: "{{ is_state('input_boolean.front_porch_rainbow', 'on') }}" 68 | turn_on: 69 | service: homeassistant.turn_on 70 | data: 71 | entity_id: input_boolean.front_porch_rainbow 72 | turn_off: 73 | service: homeassistant.turn_off 74 | data: 75 | entity_id: input_boolean.front_porch_rainbow 76 | 77 | ########################################################## 78 | ## Bedtime Switch 79 | ########################################################## 80 | 81 | - platform: template 82 | switches: 83 | bedtime: 84 | value_template: "{{ is_state('input_boolean.bedtime', 'on') }}" 85 | turn_on: 86 | service: homeassistant.turn_on 87 | data: 88 | entity_id: input_boolean.bedtime 89 | turn_off: 90 | service: homeassistant.turn_off 91 | data: 92 | entity_id: input_boolean.bedtime 93 | 94 | ########################################################## 95 | ## Panic Mode 96 | ########################################################## 97 | 98 | - platform: template 99 | switches: 100 | panic_mode: 101 | value_template: "{{ is_state('input_boolean.panic_mode', 'on') }}" 102 | turn_on: 103 | service: homeassistant.turn_on 104 | data: 105 | entity_id: input_boolean.panic_mode 106 | turn_off: 107 | service: homeassistant.turn_off 108 | data: 109 | entity_id: input_boolean.panic_mode 110 | 111 | ########################################################## 112 | ## Disable Smoke Alarm 113 | ########################################################## 114 | 115 | - platform: template 116 | switches: 117 | disable_smoke_alarm: 118 | value_template: "{{ is_state('input_boolean.disable_smoke_alarm', 'on') }}" 119 | turn_on: 120 | service: homeassistant.turn_on 121 | data: 122 | entity_id: input_boolean.disable_smoke_alarm 123 | turn_off: 124 | service: homeassistant.turn_off 125 | data: 126 | entity_id: input_boolean.disable_smoke_alarm 127 | 128 | ########################################################## 129 | ## Living Room Fans 130 | ########################################################## 131 | 132 | - platform: template 133 | switches: 134 | living_room_fans: 135 | value_template: "{{ is_state('fan.living_room_fans', 'on') }}" 136 | turn_on: 137 | service: homeassistant.turn_on 138 | data: 139 | entity_id: fan.living_room_fans 140 | turn_off: 141 | service: homeassistant.turn_off 142 | data: 143 | entity_id: fan.living_room_fans 144 | -------------------------------------------------------------------------------- /tools/README.MD: -------------------------------------------------------------------------------- 1 | The [Home Assistant Management Tool](https://github.com/geekofweek/homeassistant/blob/master/tools/ha-mgmt-docker.sh) is something I built for my personal use, but can easily be modified to suite different setups. Adjust the variables to your settings and setup shared SSH keys (if desired). Probably a million other more efficient ways to do this, but it has worked out so far for me. I had a previous version that I was using before converting to a Docker based installation. That one works with a more traditional installation. You can check out that version [here]( https://github.com/geekofweek/homeassistant/blob/master/tools/ha-mgmt-bash.sh) 2 | 3 | #### Overview: 4 | 5 | - Bash Shell script, should work anywhere you can use Bash 6 | - All HA configs are stored on my local workstation within Dropbox (doesn’t have to be but I like the versioning and access to it from any machine). 7 | - Edit locally with Text Editor. Currently using [Visual Studio Code](https://code.visualstudio.com) and VIM 8 | 9 | #### Options: 10 | 11 | 1. Deploy Home Assistant Configs 12 | - Creates tar file of current configs 13 | - Backs up tar file to local workstation (I use a Dropbox Folder) 14 | - rsyncs config directory from local workstation (Dropbox Folder) 15 | 2. Restart Home Assistant 16 | - Restarts the Home Assistant Docker container, thus restarting Home Assistant 17 | 3. Stop Home Assistant 18 | - Stops the Home Assistant Docker Container 19 | 4. Start Home Assistant 20 | - Starts the Home Assistant Docker Container 21 | 5. Upgrade Home Assistant 22 | - Does a docker pull for the latest version of Home Assistant 23 | - Stops the Home Assistant Docker Container 24 | - Deletes the Home Assistant Docker Container 25 | - Creates a new Home Assistant Docker Container 26 | 6. Check Database Size 27 | - Check the size of the MySQL Database 28 | 7. Validate Home Assistant Config 29 | - Runs a config check using a Docker Container 30 | 8. Backup Home Assistant 31 | - Creates tar file of current configs 32 | - Backs up tar file to local workstation (Dropbox Folder) 33 | 9. Copy Configs to GitHub 34 | - Copy’s current config to local workstation Github, scrubs any data that is listed in [redacted.txt]( https://github.com/geekofweek/homeassistant/blob/master/tools/redacted.txt) using [ha-github-scrub.sh]( https://github.com/geekofweek/homeassistant/blob/master/tools/ha-github-scrub.sh). 35 | 10. Renew SSL Certificate 36 | - Runs a certbot (Let's Encrypt) Docker container that generates a new SSL certificate 37 | 38 | x) Exit 39 | – I shouldn’t need to explain that one 40 | 41 | #### Variables: 42 | 43 | hauser=“USER_ACCOUNT” **<-- Home Assistant User Account** 44 | 45 | habin="/usr/local/bin/hass" **<-- Home Assistant Binary** 46 | 47 | haconfigdir="/home/USER/.homeassistant" **<-- Home Assistant Config Directory** 48 | 49 | hahost=“HOSTNAME/IP” **<-- Home Assistant Hostname or IP address** 50 | 51 | localuser=“USER_ACCOUNT” **<-- Local Computer Username, account from where this shell script will run** 52 | 53 | localhost=“HOSTNAME/IP” **<-- Local Computer Hostname or IP address** 54 | 55 | localpath=“PATH_TO_LOCAL_HA_CONFIGS” **<-- Where I store my local HA configs and backups** 56 | 57 | docker="/PATH/TO/DOCKER/bin " **<-- Docker Binary** 58 | 59 | 60 | Within the local folder, variable localpath="PATH_TO_LOCAL_HA_CONFIGS", I have two folders: 61 | 62 | **Config:** All of the .yaml files for Home Assistant 63 | 64 | **Backup:** Place for backup tar file 65 | -------------------------------------------------------------------------------- /tools/ha-github-scrub.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ########################################################## 4 | ## Variables 5 | ########################################################## 6 | 7 | filename='PATH_TO_FILE_WITH_REDACTED_WORDS_redacted.txt' 8 | directory='PATH_TO_LOCAL_GITHUB_DIRECTORY' 9 | haconfigdir='PATH_TO_LOCAL_HA_CONFIG_DIR' 10 | user1=USERNAME_TO_BE_REPLACED_WITH_USER1 11 | user2=USERNAME_TO_BE_REPLACED_WITH_USER2 12 | user1C=USERNAME_TO_BE_REPLACED_WITH_USER1 13 | user2C=USERNAME_TO_BE_REPLACED_WITH_USER2 14 | user1device=USERDEVICE_TO_BE_REPLACED_WITH_USERDEVICE1 15 | user2device=USERDEVICE_TO_BE_REPLACED_WITH_USERDEVICE2 16 | 17 | ########################################################## 18 | ## Execute 19 | ########################################################## 20 | clear 21 | echo " " 22 | echo "Copying Latest Configs" 23 | echo " " 24 | rsync -au --exclude=".*" --exclude ".*/" $haconfigdir/Config/ $directory/ 25 | echo " " 26 | echo Scrubbing Files 27 | echo " " 28 | #scrub configration.yaml first to purge user accounts 29 | cat $filename | while read redacted; do 30 | sed -i '' "s/"$redacted"/REDACTED/g" $directory/configuration.yaml 31 | done 32 | #scrub sensors.yaml second to purge user accounts 33 | cat $filename | while read redacted; do 34 | sed -i '' "s/"$redacted"/REDACTED/g" $directory/sensors.yaml 35 | done 36 | #scrub out names 37 | find $directory -name \*.yaml -exec sed -i '' "s/"$user1"/USER1/g" {} \; 38 | find $directory -name \*.yaml -exec sed -i '' "s/"$user2"/USER2/g" {} \; 39 | #lame fix for uppercase names 40 | find $directory -name \*.yaml -exec sed -i '' "s/"$user1C"/USER1/g" {} \; 41 | find $directory -name \*.yaml -exec sed -i '' "s/"$user2C"/USER2/g" {} \; 42 | #scrub out devices 43 | find $directory -name \*.yaml -exec sed -i '' "s/"$user1device"/USER1DEVICE/g" {} \; 44 | find $directory -name \*.yaml -exec sed -i '' "s/"$user2device"/USER2DEVICE/g" {} \; 45 | #loop through and scrub any file with .yaml 46 | cat $filename | while read redacted; do 47 | find $directory -name \*.yaml -exec sed -i '' "s/"$redacted"/REDACTED/g" {} \; 48 | done 49 | #lame fix for butchering of Weekends 50 | find $directory -name \*.yaml -exec sed -i '' "s/"WeeREDACTEDds"/Weekends/g" {} \; 51 | echo "GitHub Files Scrubbed" 52 | echo " " 53 | exit 54 | -------------------------------------------------------------------------------- /tools/ha-mgmt-bash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################################# 4 | ## Home Assistant Managment Tool Old 5 | ################################################################# 6 | 7 | ########################################################## 8 | ## Variables 9 | ########################################################## 10 | 11 | hauser="HA_USER_ACCOUNT" 12 | habin="/usr/local/bin/hass" 13 | haconfigdir="/home/USER/.homeassistant" 14 | hahost="HOSTNAME/IP" 15 | localuser="LOCAL_USER_ACCOUNT" 16 | localhost="LOCAL_HOSTNAME/IP" 17 | localpath="PATH_TO_LOCAL_HA_CONFIGS" 18 | 19 | 20 | ########################################################## 21 | ## Execute 22 | ########################################################## 23 | 24 | answer=1 25 | while [ "$answer" = 1 ] 26 | do 27 | 28 | clear 29 | echo "This Script Will Modify Home Assistant" 30 | echo "Proceed with Caution!" 31 | echo "" 32 | echo "What would you like to do?" 33 | echo " " 34 | echo "1) Deploy Home Assistant Configs" 35 | echo "2) Restart Home Assistant - (sudo Required)" 36 | echo "3) Stop Home Assistant - (sudo Required)" 37 | echo "4) Start Home Assistant - (sudo Required)" 38 | echo "5) Upgrade Home Assistant - (sudo Required)" 39 | echo "6) Check Database Size - (sudo Required)" 40 | echo "7) Validate Home Assistant Config" 41 | echo "8) Backup Home Assistant" 42 | echo "9) Copy Configs to GitHub" 43 | echo "10) Renew SSL Certificate" 44 | echo "x) Exit" 45 | echo " " 46 | read action 47 | 48 | if [ "$action" != "1" -a "$action" != "2" -a "$action" != "3" -a "$action" != "4" -a "$action" != "5" -a "$action" != "6" -a "$action" != "7" -a "$action" != "8" -a "$action" != "9" -a "$action" != "10" -a "$action" != "x" ];then 49 | echo ":-(" 50 | echo "Error!" 51 | echo "Invalid Option Stupid" 52 | exit 53 | fi 54 | 55 | if [ "$action" == "1" ];then 56 | clear 57 | echo "Backing Up Home Assistant..." 58 | echo "Creating Tar File..." 59 | echo " " 60 | ssh -t $hauser@$hahost "mkdir /home/$hauser/temp; cd $haconfigdir; tar -czf /home/$hauser/temp/ha-backup-`date +"%m-%d-%Y-%H-%M"`.tar.gz *" 61 | echo " " 62 | echo "Moving Backup to Local Host" 63 | echo " " 64 | ssh -t $hauser@$hahost "scp /home/$hauser/temp/*.tar.gz $localuser@$localhost:$localpath/Backups" 65 | echo " " 66 | echo "Deploying Home Assistant Configs..." 67 | echo " " 68 | rsync -au --exclude=".*" --exclude ".*/" $localpath/Config/ $hauser@$hahost:/$haconfigdir 69 | echo " " 70 | echo "Validating Home Assistant Configs..." 71 | echo " " 72 | ssh -t $hauser@$hahost "$habin --script check_config" 73 | echo " " 74 | echo "Home Assistant Config Validation Complete" 75 | echo " " 76 | echo "Cleaning Up..." 77 | echo " " 78 | ssh -t $hauser@$hahost "rm -rf /home/$hauser/temp;" 79 | echo " " 80 | echo "Home Assistant Config Deployment Complete" 81 | fi 82 | 83 | if [ "$action" == "2" ];then 84 | clear 85 | echo "Restarting Home Assistant..." 86 | echo " " 87 | ssh -t $hauser@$hahost "sudo systemctl restart home-assistant@ha" 88 | echo " " 89 | echo "Home Assistant Restart Complete" 90 | echo " " 91 | fi 92 | 93 | if [ "$action" == "3" ];then 94 | clear 95 | echo "Stopping Home Assistant..." 96 | echo " " 97 | ssh -t $hauser@$hahost "sudo systemctl stop home-assistant@ha" 98 | echo " " 99 | echo "Home Assistant Stop Complete" 100 | echo " " 101 | fi 102 | 103 | if [ "$action" == "4" ];then 104 | clear 105 | echo "Starting Home Assistant..." 106 | echo " " 107 | ssh -t $hauser@$hahost "sudo systemctl start home-assistant@ha" 108 | echo " " 109 | echo "Home Assistant Start Complete" 110 | echo " " 111 | fi 112 | 113 | if [ "$action" == "5" ];then 114 | clear 115 | echo "Upgrading Home Assistant..." 116 | echo " " 117 | ssh -t $hauser@$hahost "sudo pip3 install --upgrade homeassistant" 118 | echo " " 119 | echo "Upgrade Complete" 120 | echo " " 121 | fi 122 | 123 | if [ "$action" == "6" ];then 124 | clear 125 | echo "Checking Size of Home Assistant Database..." 126 | echo " " 127 | ssh -t $hauser@$hahost "sudo du -sh /var/lib/mysql | cut -c -5" 128 | echo " " 129 | echo "Home Assistant Size Check Complete" 130 | echo " " 131 | fi 132 | 133 | if [ "$action" == "7" ];then 134 | clear 135 | echo "Validating Home Assistant Configs..." 136 | echo " " 137 | ssh -t $hauser@$hahost "$habin --script check_config" 138 | echo " " 139 | echo "Home Assistant Config Validation Complete" 140 | echo " " 141 | fi 142 | 143 | if [ "$action" == "8" ];then 144 | clear 145 | echo "Backing Up Home Assistant..." 146 | echo "Creating Tar File..." 147 | echo " " 148 | ssh -t $hauser@$hahost "mkdir /home/$hauser/temp; cd $haconfigdir; tar -czf /home/$hauser/temp/ha-backup-`date +"%m-%d-%Y-%H-%M"`.tar.gz *" 149 | echo " " 150 | echo "Moving Backup to Local Host" 151 | echo " " 152 | ssh -t $hauser@$hahost "scp /home/$hauser/temp/*.tar.gz $localuser@$localhost:$localpath/Backups" 153 | echo " " 154 | echo "Cleaning Up..." 155 | echo " " 156 | ssh -t $hauser@$hahost "rm -rf /home/$hauser/temp;" 157 | echo " " 158 | echo "Backup Complete" 159 | echo " " 160 | fi 161 | 162 | if [ "$action" == "9" ];then 163 | clear 164 | echo "Copy Files for GitHub Publishing" 165 | echo " " 166 | ./ha-github-scrub.sh 167 | echo " " 168 | echo "Files Copied to GitHub Directory" 169 | echo " " 170 | fi 171 | 172 | if [ "$action" == "10" ];then 173 | clear 174 | echo "Renewing SSL Certificate..." 175 | echo " " 176 | ssh -t $hauser@$hahost "./certbot/certbot-auto renew --quiet --no-self-upgrade --standalone \ 177 | --standalone-supported-challenges http-01" 178 | echo " " 179 | echo "Home Assistant SSL Ceretificate Renewal Complete" 180 | echo " " 181 | fi 182 | 183 | if [ "$action" == "x" ];then 184 | clear 185 | echo " " 186 | echo ":-(" 187 | echo "Exiting" 188 | echo " " 189 | exit 190 | fi 191 | 192 | echo " " 193 | echo "Do You Want to Perform Another Task?" 194 | echo " " 195 | echo "1) Yes" 196 | echo "2) No" 197 | echo " " 198 | read answer 199 | 200 | if [ "$answer" = 1 ] 201 | then "run script again" 202 | fi 203 | 204 | done 205 | 206 | clear 207 | echo " " 208 | echo ":-(" 209 | echo "Exiting" 210 | echo " " 211 | -------------------------------------------------------------------------------- /tools/ha-mgmt-docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################################################# 4 | ## Home Assistant Managment Tool 5 | ################################################################# 6 | 7 | ########################################################## 8 | ## Variables 9 | ########################################################## 10 | 11 | hauser="SERVER_DOCKER_USER_ACCOUNT" 12 | haconfigdir="/PATH/TO/SERVER/HA/CONFIG" 13 | hahost="HA_SERVER_HOSTNAME/IP" 14 | localuser="LOCAL_USER_ACCOUNT" 15 | localhost="LOCAL_HOSTNAME/IP" 16 | localpath="PATH_TO_LOCAL_HA_CONFIGS" 17 | scripts="/SERVER/SCRIPTS/DIRECTORY" 18 | mgmtscripts='/LOCAL/SCRIPTS/DIRECTORY' 19 | 20 | ########################################################## 21 | ## Execute 22 | ########################################################## 23 | 24 | answer=1 25 | while [ "$answer" = 1 ] 26 | do 27 | 28 | clear 29 | echo "This Script Will Modify Home Assistant" 30 | echo "Proceed with Caution!" 31 | echo "Home (LOCATION)" 32 | echo "" 33 | echo "What would you like to do?" 34 | echo " " 35 | echo "1) Deploy Home Assistant Configs" 36 | echo "2) Restart Home Assistant" 37 | echo "3) Stop Home Assistant" 38 | echo "4) Start Home Assistant" 39 | echo "5) Upgrade Home Assistant" 40 | echo "6) Check Database Size" 41 | echo "7) Validate Home Assistant Config" 42 | echo "8) View Logs" 43 | echo "9) Backup Home Assistant" 44 | echo "10) Copy Configs to GitHub" 45 | echo "11) Renew SSL Certificate" 46 | echo "x) Exit" 47 | echo " " 48 | read action 49 | 50 | if [ "$action" != "1" -a "$action" != "2" -a "$action" != "3" -a "$action" != "4" -a "$action" != "5" -a "$action" != "6" \ 51 | -a "$action" != "7" -a "$action" != "8" -a "$action" != "9" -a "$action" != "10" -a "$action" != "11" -a "$action" != "x" ];then 52 | echo ":-(" 53 | echo "Error!" 54 | echo "Invalid Option Stupid" 55 | exit 56 | fi 57 | 58 | if [ "$action" == "1" ];then 59 | clear 60 | echo "Backing Up Home Assistant..." 61 | echo "Creating Tar File..." 62 | echo " " 63 | ssh -t $hauser@$hahost "mkdir $haconfigdir/temp; cd $haconfigdir/config; tar -czf $haconfigdir/temp/ha-backup-`date +"%m-%d-%Y-%H-%M"`.tar.gz ." 64 | echo " " 65 | echo "Moving Backup to Local Host" 66 | echo " " 67 | ssh -t $hauser@$hahost "scp $haconfigdir/temp/*.tar.gz $localuser@$localhost:$localpath/Backups" 68 | echo " " 69 | echo "Deploying Home Assistant Configs..." 70 | echo " " 71 | rsync -rzvu --exclude=".*" --exclude ".*/" $localpath/Config/ $hauser@$hahost:/$haconfigdir/config 72 | echo " " 73 | echo "Cleaning Up..." 74 | echo " " 75 | ssh -t $hauser@$hahost "rm -rf $haconfigdir/temp;" 76 | echo " " 77 | echo "Home Assistant Config Deployment Complete" 78 | echo " " 79 | echo "Choose Option 7 to Validate Configs" 80 | echo " " 81 | fi 82 | 83 | if [ "$action" == "2" ];then 84 | clear 85 | echo "Restarting Home Assistant..." 86 | echo " " 87 | ssh -t $hauser@$hahost "$scripts/restart/ha-docker-restart.sh" 88 | echo " " 89 | echo "Home Assistant Restart Complete" 90 | echo " " 91 | fi 92 | 93 | if [ "$action" == "3" ];then 94 | clear 95 | echo "Stopping Home Assistant..." 96 | echo " " 97 | ssh -t $hauser@$hahost "$scripts/stop/ha-docker-stop.sh" 98 | echo " " 99 | echo "Home Assistant Stop Complete" 100 | echo " " 101 | fi 102 | 103 | if [ "$action" == "4" ];then 104 | clear 105 | echo "Starting Home Assistant..." 106 | echo " " 107 | ssh -t $hauser@$hahost "$scripts/start/ha-docker-start.sh" 108 | echo " " 109 | echo "Home Assistant Start Complete" 110 | echo " " 111 | fi 112 | 113 | if [ "$action" == "5" ];then 114 | clear 115 | echo "Upgrading Home Assistant..." 116 | echo " " 117 | echo " " 118 | echo "Downloading Latest Docker Image" 119 | echo " " 120 | ssh -t $hauser@$hahost "$scripts/update/ha-docker-update.sh" 121 | echo " " 122 | echo "Stopping Home Assistant Container" 123 | echo " " 124 | ssh -t $hauser@$hahost "$scripts/stop/ha-docker-stop.sh" 125 | echo " " 126 | echo "Deleting Home Assistant Container" 127 | echo " " 128 | ssh -t $hauser@$hahost "$scripts/remove/ha-docker-remove.sh" 129 | echo " " 130 | echo "Initializing Home Assistant Container" 131 | echo " " 132 | ssh -t $hauser@$hahost "$scripts/create/ha-docker-create.sh" 133 | echo " " 134 | echo "Upgrade Complete" 135 | echo " " 136 | fi 137 | 138 | if [ "$action" == "6" ];then 139 | clear 140 | echo "Checkign Size of Home Assistant Databae..." 141 | echo " " 142 | ssh -t $hauser@$hahost "du -sh /data/containers/mysql/data | cut -c -5" 143 | echo " " 144 | echo "Home Assistant Size Check Complete" 145 | echo " " 146 | fi 147 | 148 | if [ "$action" == "7" ];then 149 | clear 150 | echo "Validating Home Assistant Configs..." 151 | echo " " 152 | ssh -t $hauser@$hahost "$scripts/other/ha-docker-validate.sh" 153 | echo " " 154 | echo "Home Assistant Config Validation Complete" 155 | echo " " 156 | fi 157 | 158 | if [ "$action" == "8" ];then 159 | clear 160 | echo "Tailing Home Assistant Logs ctrl+c to Exit..." 161 | echo " " 162 | ssh -t $hauser@$hahost "tail -f $haconfigdir/config/home-assistant.log" 163 | echo " " 164 | fi 165 | 166 | if [ "$action" == "9" ];then 167 | clear 168 | echo "Backing Up Home Assistant..." 169 | echo "Creating Tar File..." 170 | echo " " 171 | ssh -t $hauser@$hahost "mkdir $haconfigdir/temp; cd $haconfigdir/config; tar -czf $haconfigdir/temp/ha-backup-`date +"%m-%d-%Y-%H-%M"`.tar.gz ." 172 | echo " " 173 | echo "Moving Backup to Local Host" 174 | echo " " 175 | ssh -t $hauser@$hahost "scp $haconfigdir/temp/*.tar.gz $localuser@$localhost:$localpath/Backups" 176 | echo " " 177 | echo "Cleaning Up..." 178 | echo " " 179 | ssh -t $hauser@$hahost "rm -rf $haconfigdir/temp;" 180 | echo " " 181 | echo "Backup Complete" 182 | echo " " 183 | fi 184 | 185 | if [ "$action" == "10" ];then 186 | clear 187 | echo "Copy Files for GitHub Publishing" 188 | echo " " 189 | $mgmtscripts/ha-github-scrub.sh 190 | echo " " 191 | echo "Files Copied to GitHub Directory" 192 | echo " " 193 | fi 194 | 195 | if [ "$action" == "11" ];then 196 | clear 197 | echo "Renewing SSL Certificate..." 198 | echo " " 199 | ssh -t $hauser@$hahost "$scripts/create/certbot-docker-create.sh" 200 | echo " " 201 | echo "Home Assistant SSL Ceretificate Renewal Complete" 202 | echo " " 203 | fi 204 | 205 | if [ "$action" == "x" ];then 206 | clear 207 | echo " " 208 | echo ":-(" 209 | echo "Exiting" 210 | echo " " 211 | sleep .4 212 | exit 213 | fi 214 | 215 | echo " " 216 | echo "Do You Want to Perform Another Task?" 217 | echo " " 218 | echo "1) Yes" 219 | echo "2) No" 220 | echo " " 221 | read answer 222 | 223 | done 224 | 225 | clear 226 | echo " " 227 | echo ":-(" 228 | echo "Exiting" 229 | echo " " 230 | sleep .4 231 | -------------------------------------------------------------------------------- /tools/redacted.txt: -------------------------------------------------------------------------------- 1 | example 2 | redacted 3 | file 4 | words 5 | in 6 | this 7 | file 8 | will 9 | be 10 | scrubbed 11 | ENDOFFILE 12 | --------------------------------------------------------------------------------