Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: System Check Status Pump (Other idea)
- sequence:
- - variables:
- pr_entiteit: |
- {{ "pr"+ entiteit }}
- pa_entiteit: |
- {{ "pa"+ entiteit }}
- alias: variables
- - variables:
- return_info: |
- {% if (return_running == "{'value': 'on'}" ) and
- (return_status == "{'value': Active}" ) and
- (return_activated == "{'value': 'on'}" ) %}
- {% set condition = 'OK' %}
- {% elif (return_running == "{'value': 'off'}" ) and
- (return_status == "{'value': 'Active'}" ) and
- (return_activated == "{'value': 'off'}" ) %}
- {% set condition = 'OK' %}
- {% elif (return_running == "{'value': 'off'}" ) and
- (return_status == "{'value': 'Non Active'}" ) %}
- {% set condition = 'OK' %}
- {% else %}
- {% set condition = 'KO' %}
- {% endif %}
- {{ {'value': condition } }}
- alias: variables
- enabled: false
- - action: script.status_of_entity_v0_1
- metadata: {}
- data:
- id: "{{ pr_entiteit }}"
- response_variable: return_running
- - variables:
- return_running: "{{ return_run.value }}"
- enabled: false
- - action: notify.notify
- metadata: {}
- data:
- title: Running
- message: Code "{{ return_running }}"
- enabled: false
- - action: script.status_of_entity_v0_1
- metadata: {}
- data:
- id: "{{ entiteit }}"
- response_variable: return_status
- - variables:
- return_status: "{{ return_stat.value }}"
- enabled: false
- - action: notify.notify
- metadata: {}
- data:
- title: Status
- message: Code "{{ return_status }}"
- enabled: false
- - action: script.status_of_entity_v0_1
- metadata: {}
- data:
- id: "{{ pa_entiteit }}"
- response_variable: return_activated
- - variables:
- return_activated: "{{ return_activat.value }}"
- enabled: false
- - action: notify.notify
- metadata: {}
- data:
- title: Activated
- message: Code "{{ return_activated }}"
- enabled: false
- - action: notify.notify
- metadata: {}
- data:
- title: Return_info
- message: Code "{{ return_info }}"
- enabled: false
- - variables:
- return_info: |
- {% if (return_running == {'value': 'on'} ) and
- (return_status == {'value': 'on'} ) and
- (return_activated == {'value': 'Active'} ) %}
- {% set condition = 'OK' %}
- {% elif (return_running == {'value': 'off'} ) and
- (return_status == {'value': 'off'} ) and
- (return_activated == {'value': 'Active'} ) %}
- {% set condition = 'OK' %}
- {% elif (return_running == {'value': 'off'} ) and
- (return_status == {'value': 'Non Active'} ) %}
- {% set condition = 'OK' %}
- {% else %}
- {% set condition = 'KO' %}
- {% endif %}
- {{ {'value': condition } }}
- alias: variables
- - variables:
- return_info: |
- {% if (return_running.value == 'on' ) and
- (return_status.value == 'on' ) and
- (return_activated.value == 'Active' ) %}
- {% set condition = 'OK' %}
- {% elif (return_running.value == 'off' ) and
- (return_status.value == 'off' ) and
- (return_activated.value == 'Active' ) %}
- {% set condition = 'OK' %}
- {% elif (return_running.value == 'off' ) and
- (return_status.value == 'Non Active' ) %}
- {% set condition = 'OK' %}
- {% else %}
- {% set condition = 'KO' %}
- {% endif %}
- {{ {'value': condition } }}
- alias: variables
- - action: system_log.write
- metadata: {}
- data:
- level: debug
- message: |-
- return_running: {{ return_running }}
- return_status: {{ return_status }}
- return_activated: {{ return_activated }}
- - stop: end
- response_variable: return_info
- description: ""
- fields:
- entiteit:
- selector:
- text: {}
- name: Entiteit
- required: true
- description: Id of entity state to retrieve
- default: tank_4
- mode: parallel
- max: 10
- icon: mdi:pump
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement