Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script:
- - id: update_state
- then:
- - if:
- condition:
- and:
- - switch.is_on: valve_is_open
- - switch.is_on: valve_is_closed
- then:
- - text_sensor.template.publish:
- id: valve_position
- state: "ERROR: BOTH VALVE STATES HIGH"
- - switch.turn_on: close_the_valve
- - if:
- condition:
- and:
- - switch.is_off: valve_is_open
- - switch.is_off: valve_is_closed
- then:
- - text_sensor.template.publish:
- id: valve_position
- state: "Moving"
- - script.stop: error_check
- - if:
- condition:
- and:
- - switch.is_on: valve_is_open
- - switch.is_off: valve_is_closed
- then:
- - text_sensor.template.publish:
- id: valve_position
- state: "Open"
- - if:
- condition:
- and:
- - switch.is_off: valve_is_open
- - switch.is_on: valve_is_closed
- then:
- - text_sensor.template.publish:
- id: valve_position
- state: "Closed"
- - id: error
- then:
- - delay: 10s
- - if:
- condition:
- and:
- - switch.is_off: valve_is_open
- - switch.is_off: valve_is_closed
- then:
- - text_sensor.template.publish:
- id: valve_position
- state: "ERROR: BOTH VALVE STATES LOW FOR 10S"
- - switch.turn_on: close_the_valve
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement