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
| // =========================================================================== | |
| // Garage door <-> car-trunk safety interlock | |
| // Runs ON the garage Shelly (Gen2+ JS scripting). No Home Assistant involved. | |
| // | |
| // Goal: while the car TRUNK is open, the garage motor must NOT move, | |
| // to prevent the closing/opening door from hitting the raised lid. | |
| // | |
| // Trunk sensor: Shelly BLU Door/Window (BLE / BTHome v2) | |
| // MAC b0:c7:de:7a:9d:23 (window=1 -> open, window=0 -> closed) | |
| // Garage relay: one Switch output that pulses the opener's button input |
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
| let switchId = 0; | |
| let url = 'http://10.10.10.10:8123'; | |
| function check(event) { | |
| Shelly.call("HTTP.GET", {url: url, body:{}, timeout: 2 }, function(resp) { | |
| let reachable = (resp && resp.code === 200); | |
| if (!reachable) { | |
| print("override switch behaviour"); | |
| Shelly.call("Switch.Set", { id: event.id, on: event.info.state }, function(){}); | |
| } | |
| }); |
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
| template: | |
| - sensor: | |
| - name: "Prusa Print Graph Span" | |
| state: > | |
| {% set val = states('sensor.prusamini_print_start') %} | |
| {% if val in ['unknown', 'unavailable', ''] %} | |
| 1h | |
| {% else %} | |
| {%- set hours = (now() - as_datetime(val)).total_seconds() / 3600 -%} | |
| {%- set base = hours | int -%} |
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
| type: grid | |
| cards: | |
| - type: heading | |
| heading_style: title | |
| heading: 3D-Drucker Nerd-Stats | |
| icon: mdi:printer-3d-nozzle | |
| - type: custom:config-template-card | |
| grid_options: | |
| columns: full | |
| entities: |
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
| type: grid | |
| cards: | |
| - type: heading | |
| heading_style: title | |
| heading: 3D-Drucker Überblick | |
| icon: mdi:printer-3d-nozzle | |
| - type: tile | |
| entity: switch.3d_drucker | |
| icon: carbon:chart-3d | |
| vertical: false |