shutter script open mid, close mid
This commit is contained in:
		
							
								
								
									
										48
									
								
								shutter.yaml
									
									
									
									
									
								
							
							
						
						
									
										48
									
								
								shutter.yaml
									
									
									
									
									
								
							@@ -31,23 +31,6 @@ wifi:
 | 
				
			|||||||
  networks:
 | 
					  networks:
 | 
				
			||||||
    - ssid: !secret wifi_ssid3
 | 
					    - ssid: !secret wifi_ssid3
 | 
				
			||||||
      password: !secret wifi_password3
 | 
					      password: !secret wifi_password3
 | 
				
			||||||
    - ssid: !secret wifi_ssid
 | 
					 | 
				
			||||||
      password: !secret wifi_password
 | 
					 | 
				
			||||||
      manual_ip:
 | 
					 | 
				
			||||||
        static_ip: 192.168.1.56
 | 
					 | 
				
			||||||
        gateway: 192.168.0.1
 | 
					 | 
				
			||||||
        subnet: 255.255.255.0
 | 
					 | 
				
			||||||
        dns1: 9.9.9.9
 | 
					 | 
				
			||||||
        dns2: 149.112.112.112
 | 
					 | 
				
			||||||
    - ssid: !secret wifi_ssid2
 | 
					 | 
				
			||||||
      password: !secret wifi_password2
 | 
					 | 
				
			||||||
      manual_ip:
 | 
					 | 
				
			||||||
        static_ip: 192.168.4.56
 | 
					 | 
				
			||||||
        gateway: 192.168.4.1
 | 
					 | 
				
			||||||
        subnet: 255.255.255.0
 | 
					 | 
				
			||||||
        dns1: 9.9.9.9
 | 
					 | 
				
			||||||
        dns2: 149.112.112.112
 | 
					 | 
				
			||||||
  use_address: 192.168.1.56
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Enable fallback hotspot (captive portal) in case wifi connection fails
 | 
					  # Enable fallback hotspot (captive portal) in case wifi connection fails
 | 
				
			||||||
  ap:
 | 
					  ap:
 | 
				
			||||||
@@ -67,32 +50,51 @@ output:
 | 
				
			|||||||
    id: transistor_3
 | 
					    id: transistor_3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
script:
 | 
					script:
 | 
				
			||||||
  - id: pulse_transistor_1
 | 
					  - id: shutter_up
 | 
				
			||||||
    then:
 | 
					    then:
 | 
				
			||||||
      - output.turn_on: transistor_1
 | 
					      - output.turn_on: transistor_1
 | 
				
			||||||
      - delay: 500ms
 | 
					      - delay: 500ms
 | 
				
			||||||
      - output.turn_off: transistor_1
 | 
					      - output.turn_off: transistor_1
 | 
				
			||||||
  - id: pulse_transistor_2
 | 
					  - id: shutter_down
 | 
				
			||||||
    then:
 | 
					    then:
 | 
				
			||||||
      - output.turn_on: transistor_2
 | 
					      - output.turn_on: transistor_2
 | 
				
			||||||
      - delay: 500ms
 | 
					      - delay: 500ms
 | 
				
			||||||
      - output.turn_off: transistor_2
 | 
					      - output.turn_off: transistor_2
 | 
				
			||||||
  - id: pulse_transistor_3
 | 
					  - id: shutter_stop
 | 
				
			||||||
    then:
 | 
					    then:
 | 
				
			||||||
      - output.turn_on: transistor_3
 | 
					      - output.turn_on: transistor_3
 | 
				
			||||||
      - delay: 500ms
 | 
					      - delay: 500ms
 | 
				
			||||||
      - output.turn_off: transistor_3
 | 
					      - output.turn_off: transistor_3
 | 
				
			||||||
 | 
					  - id: script_open_mid
 | 
				
			||||||
 | 
					    then:
 | 
				
			||||||
 | 
					      - script.execute: shutter_up
 | 
				
			||||||
 | 
					      - delay: 12000ms
 | 
				
			||||||
 | 
					      - script.execute: shutter_stop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - id: script_close_mid
 | 
				
			||||||
 | 
					    then:
 | 
				
			||||||
 | 
					      - script.execute: shutter_down
 | 
				
			||||||
 | 
					      - delay: 5500ms
 | 
				
			||||||
 | 
					      - script.execute: shutter_stop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
button:
 | 
					button:
 | 
				
			||||||
  - platform: template
 | 
					  - platform: template
 | 
				
			||||||
    name: "Shutter Up"
 | 
					    name: "Shutter Up"
 | 
				
			||||||
    on_press:
 | 
					    on_press:
 | 
				
			||||||
      - script.execute: pulse_transistor_1
 | 
					      - script.execute: shutter_up
 | 
				
			||||||
  - platform: template
 | 
					  - platform: template
 | 
				
			||||||
    name: "Shutter Down"
 | 
					    name: "Shutter Down"
 | 
				
			||||||
    on_press:
 | 
					    on_press:
 | 
				
			||||||
      - script.execute: pulse_transistor_2
 | 
					      - script.execute: shutter_down
 | 
				
			||||||
  - platform: template
 | 
					  - platform: template
 | 
				
			||||||
    name: "Shutter Stop"
 | 
					    name: "Shutter Stop"
 | 
				
			||||||
    on_press:
 | 
					    on_press:
 | 
				
			||||||
      - script.execute: pulse_transistor_3
 | 
					      - script.execute: shutter_stop
 | 
				
			||||||
 | 
					  - platform: template
 | 
				
			||||||
 | 
					    name: "Shutter open mid"
 | 
				
			||||||
 | 
					    on_press:
 | 
				
			||||||
 | 
					      - script.execute: script_open_mid
 | 
				
			||||||
 | 
					  - platform: template
 | 
				
			||||||
 | 
					    name: "Shutter close mid"
 | 
				
			||||||
 | 
					    on_press:
 | 
				
			||||||
 | 
					      - script.execute: script_close_mid
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user