Last active
February 25, 2025 13:16
-
-
Save atallo/3ad4ff79f0c234e17f9a08dd61e0892f to your computer and use it in GitHub Desktop.
Adios vampiros de la luz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Adapted from https://community.home-assistant.io/t/refresh-zwave-device-status-after-consuming-power-workaround-fibaro-roller-shutter-3-position-update-issue/257541 | |
| # Original at: https://github.com/Christoph-Wagner/homeassistant-blueprints/blob/6afc3c396232d35760f190337e6771d10b583aea/standby-off.yaml | |
| blueprint: | |
| name: Turn off device after a certain time with little power draw | |
| description: This is a blueprint to turn off a smart plug after the power draw has been low for a certain time. It’s useful for devices that draw significant power in standby, like PCs. | |
| domain: automation | |
| input: | |
| power_sensor: | |
| name: Electric Power Sensor | |
| description: This sensor used to identify when the target device has been shut off. | |
| selector: | |
| entity: | |
| domain: sensor | |
| device_class: power | |
| power_threshold: | |
| name: Power Threshold in Watts | |
| description: When the device is not used is should draw less power than the power threshold so that the automation kicks in when that action of the device has finished. It should be set above the standby power of the device and below the power when is actively used. For reliability set the value with headroom. For example in the range of 5 Watts more than the constantly used power and 5 Watts less than the power that indicates your device activity. The default value is set to 20 Watts. | |
| default: 20 | |
| smart_plug_switch: | |
| name: Target Smart Plug | |
| description: This smart plug will be turned off once the treshold is reached for the configured amount of minutes. | |
| selector: | |
| entity: | |
| domain: switch | |
| off_delay: | |
| name: Wait time | |
| description: Time the plug need to be below the threshold for the automation to trigger | |
| default: 10 | |
| selector: | |
| number: | |
| min: 1 | |
| max: 60 | |
| unit_of_measurement: minutes | |
| trigger: | |
| - below: !input power_threshold | |
| entity_id: !input power_sensor | |
| for: | |
| minutes: !input off_delay | |
| platform: numeric_state | |
| condition: | |
| - condition: state | |
| entity_id: !input smart_plug_switch | |
| state: 'on' | |
| action: | |
| - data: | |
| entity_id: !input smart_plug_switch | |
| service: switch.turn_off | |
| mode: single |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment