Advertisement
Hoekeren75

Styrring af udelys baseret på solop-/nedgang, tid og tryk på kontakt

Sep 25th, 2023
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.37 KB | None | 0 0
  1. alias: Lys_pæretræet - sol - tid -tryk
  2. description: >-
  3.   Tænder og slukker lyset ved pæretræet afhængig af solop-/nedgang, tidsrum,
  4.   samt tryk på kontakt.
  5. trigger:
  6.   - platform: sun
  7.     event: sunrise
  8.     offset: 0
  9.     id: Solopgang
  10.   - platform: sun
  11.     event: sunset
  12.     offset: 0
  13.     id: Solnedgang
  14.   - platform: time
  15.     at: "06:45:00"
  16.     id: "06:45"
  17.   - platform: time
  18.     at: "22:00:00"
  19.     id: "22:00"
  20.   - platform: device
  21.     domain: mqtt
  22.     device_id: cebb103a11aa3764d7f0570e5d204168
  23.     type: action
  24.     subtype: release_1
  25.     discovery_id: 0x000000000171af27 action_release_1
  26.     id: 1- Sluk
  27.   - platform: device
  28.     domain: mqtt
  29.     device_id: cebb103a11aa3764d7f0570e5d204168
  30.     type: action
  31.     subtype: release_2
  32.     discovery_id: 0x000000000171af27 action_release_2
  33.     id: 1 - Tænd
  34.   - platform: device
  35.     domain: mqtt
  36.     device_id: cebb103a11aa3764d7f0570e5d204168
  37.     type: action
  38.     subtype: release_3
  39.     discovery_id: 0x000000000171af27 action_release_3
  40.     id: 2 - Sluk
  41.   - platform: device
  42.     domain: mqtt
  43.     device_id: cebb103a11aa3764d7f0570e5d204168
  44.     type: action
  45.     subtype: press_4
  46.     discovery_id: 0x000000000171af27 action_press_4
  47.     id: 2 - Tænd
  48. condition: []
  49. action:
  50.   - choose:
  51.       - conditions:
  52.           - condition: and
  53.             conditions:
  54.               - condition: trigger
  55.                 id:
  56.                  - Solnedgang
  57.               - condition: time
  58.                 before: "22:00:00"
  59.               - condition: state
  60.                 entity_id: light.paeretraeet
  61.                 state: "off"
  62.             alias: Solen går ned før 22:00 og lyset er slukket
  63.         sequence:
  64.           - service: light.turn_on
  65.             data: {}
  66.             target:
  67.               entity_id: light.paeretraeet
  68.       - conditions:
  69.           - condition: and
  70.             conditions:
  71.               - condition: trigger
  72.                 id:
  73.                  - Solopgang
  74.               - condition: state
  75.                 entity_id: light.paeretraeet
  76.                 state: "on"
  77.             alias: Solen står op og lyset er tændt
  78.         sequence:
  79.           - service: light.turn_off
  80.             data: {}
  81.       - conditions:
  82.           - condition: and
  83.             conditions:
  84.               - condition: trigger
  85.                 id:
  86.                  - "06:45"
  87.               - condition: state
  88.                 entity_id: light.paeretraeet
  89.                 state: "off"
  90.               - condition: sun
  91.                 before: sunrise
  92.             alias: 06:45, før solopgang, lyset er slukket
  93.         sequence:
  94.           - service: light.turn_on
  95.             data: {}
  96.             target:
  97.               entity_id: light.paeretraeet
  98.       - conditions:
  99.           - condition: and
  100.             conditions:
  101.               - condition: state
  102.                 entity_id: light.paeretraeet
  103.                 state: "off"
  104.               - condition: or
  105.                 conditions:
  106.                   - condition: trigger
  107.                     id:
  108.                      - 1 - Tænd
  109.                   - condition: trigger
  110.                     id:
  111.                      - 2 - Tænd
  112.             alias: Knap 1 eller 2 - Tænd, når lyset er slukket
  113.         sequence:
  114.           - service: light.turn_on
  115.             data: {}
  116.             target:
  117.               entity_id: light.paeretraeet
  118.       - conditions:
  119.           - condition: and
  120.             conditions:
  121.               - condition: state
  122.                 entity_id: light.paeretraeet
  123.                 state: "on"
  124.               - condition: or
  125.                 conditions:
  126.                   - condition: trigger
  127.                     id:
  128.                      - 1- Sluk
  129.                       - 2 - Sluk
  130.             alias: Knap 1 eller 2 - SLUK, når lyset tændt
  131.         sequence:
  132.           - service: light.turn_off
  133.             data: {}
  134.             target:
  135.               entity_id: light.paeretraeet
  136.       - conditions:
  137.           - condition: and
  138.             conditions:
  139.               - condition: trigger
  140.                 id:
  141.                  - "22:00"
  142.               - condition: state
  143.                 entity_id: light.paeretraeet
  144.                 state: "on"
  145.             alias: 22:00, lyset er tændt
  146.         sequence:
  147.           - service: light.turn_off
  148.             data: {}
  149.             target:
  150.               entity_id: light.paeretraeet
  151. mode: single
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement