smiley
Octobre 26, 2023, 5:49
21
merci, j’ai fait cela pour comparer et envoyer le webhook comme il se doit, mais cela n’a pas l’air de fonctionner une idée?
sequence:
- condition: template
value_template: >-
{{ states('input_text.keypad_input') ==
states('input_text.alarme_eliott')}}
- service: netatmo.set_persons_home
target:
entity_id: camera.camera_entree
data:
persons: Eliott
Edit: j’ai rien dit, fallait juste que je me rappel le code que j’avais crée!
smiley
Octobre 26, 2023, 6:38
22
bon, en fait ça ne fonctionne qu’avec ma première condition du script:
alias: Alarme
sequence:
- condition: template
value_template: >-
{{ states('input_text.keypad_input') == states('input_text.alarme_eliott')
}}
- service: netatmo.set_persons_home
target:
entity_id: camera.camera_entree
data:
persons: Eliott
- condition: template
value_template: >-
{{ states('input_text.keypad_input') == states('input_text.alarme_adrien')
}}
- service: netatmo.set_persons_home
target:
entity_id: camera.camera_entree
data:
persons: Adrien
- condition: template
value_template: >-
{{ states('input_text.keypad_input') ==
states('input_text.alarme_aurelie') }}
- service: netatmo.set_persons_home
target:
entity_id: camera.camera_entree
data:
persons: Aurélie
mode: single
en faisant des recherches j’ai vu qu’il fallait mettre un condition: or mais ça veut pas!
alias: Alarme
sequence:
- condition: or
conditions:
- condition: template
value_template: >-
{{ states('input_text.keypad_input') == states('input_text.alarme_eliott')
}}
- service: netatmo.set_persons_home
target:
entity_id: camera.camera_entree
data:
persons: Eliott
- condition: template
value_template: >-
{{ states('input_text.keypad_input') == states('input_text.alarme_adrien')
}}
- service: netatmo.set_persons_home
target:
entity_id: camera.camera_entree
data:
persons: Adrien
- condition: template
value_template: >-
{{ states('input_text.keypad_input') ==
states('input_text.alarme_aurelie') }}
- service: netatmo.set_persons_home
target:
entity_id: camera.camera_entree
data:
persons: Aurélie
mode: single
une idée? problème d’indentation?
smiley
Octobre 29, 2023, 4:42
23
alors c’est bon ça fonctionne!
j’utilise cette card:
le code:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:button-card
name: Retour
icon: mdi:arrow-left
size: 10%
color_type: card
color: white
tap_action:
action: navigate
navigation_path: /dashboard-couloir
- type: custom:button-card
name: ' '
icon: ' '
size: 10%
color_type: card
color: white
show_state: true
show_icon: false
entity: input_text.keypad_input
- type: custom:button-card
color_type: card
color: red
icon: ' '
size: 10%
name: Activer l'alarme
tap_action:
action: call-service
service: script.activation_alarme
- type: vertical-stack
cards:
- type: grid
columns: 3
square: false
cards:
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '1'
icon: mdi:numeric-1-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '2'
icon: mdi:numeric-2-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '3'
icon: mdi:numeric-3-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '4'
icon: mdi:numeric-4-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '5'
icon: mdi:numeric-5-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '6'
icon: mdi:numeric-6-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '7'
icon: mdi:numeric-7-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '8'
icon: mdi:numeric-8-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '9'
icon: mdi:numeric-9-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: input_text.set_value
service_data:
entity_id: input_text.keypad_input
value: Tapez un code
icon: mdi:alpha-x-circle-outline
color: '#f87272'
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.1698339536455
service_data:
number: '0'
icon: mdi:numeric-0-circle
color: grey
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
- type: custom:button-card
show_name: false
show_icon: true
aspect_ratio: 1/.75
tap_action:
action: call-service
service: script.alarme
icon: mdi:check-circle-outline
color: '#8dc869'
size: 100%
styles:
card:
- background: none
- border: none
- '--mdc-ripple-press-opacity': 0
les bouton me lancent ces scripts:
activation alarme:
alias: activation_alarme
sequence:
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: netatmo.set_person_away
data: {}
target:
device_id: xxxxx
mode: single
indentation des numéros:
alias: Keypad_Input
sequence:
- service: input_text.set_value
data_template:
entity_id: input_text.keypad_input
value: >
{% set current_value = states('input_text.keypad_input') %} {% if
current_value != 'Tapez un code' and current_value != 'unknown' %}
{{ current_value ~ number | string }}
{% else %}
{{ number | string }}
{% endif %}
mode: single
validation des codes:
alias: Alarme
sequence:
- choose:
- conditions:
- condition: template
value_template: >-
{{ states('input_text.keypad_input') ==
states('input_text.alarme_xxx') }}
sequence:
- service: netatmo.set_persons_home
data:
persons:xxx
target:
device_id: xxx
- conditions:
- condition: template
value_template: >-
{{ states('input_text.keypad_input') ==
states('input_text.alarme_xxx') }}
sequence:
- service: netatmo.set_persons_home
data:
persons: xxx
target:
device_id: xxx
- conditions:
- condition: template
value_template: >-
{{ states('input_text.keypad_input') ==
states('input_text.alarme_xxx') }}
sequence:
- service: netatmo.set_persons_home
data:
persons: xxx
target:
device_id: xxx
- service: input_text.set_value
data:
value: Tapez un code
target:
entity_id: input_text.keypad_input
enabled: true
mode: single
il me reste plus qu’ trouver comment réduire la taille du clavier je trouve les espaces entre les boutons trop important, quelqu’un aurait une idée?
car je n’arrive à rien de concluant hélas!
1 « J'aime »
Super.
Mets ton sujet en résolu pour que ça serve aux autres.
@+