Hi guy’s , im close to giving up on my issues.
It’s probably over 3 days (even more) I’m trying to fix it without success.
- I’m having a script called from my Dashboard to Open and Close the store
Those 2 scripts are working nicely.
The last one is the Set the position to xx which I just cannot make it to work based on the Position to set the store (roller)
The message below are the value passed when I press the button and received by the script. Evything seems to be OK, from my Point of view. The value is 89 in that case.
POSITIONNEMENT d'un store [ Paramètre ]
Action: Positionner Pièce: Salle à manger Position: 89 Entité: cover.fenetre Senseur: binary_sensor.ewe_fenetre_sam_opening
Il y a 17 minutes
Positionnement du store cover.fenetre à la position de 89 est soumis...
The errors are :
23-08-28 18:48:51.120 ERROR (MainThread) [homeassistant.components.script.positionnement_dun_store_parametre] POSITIONNEMENT d'un store [ Paramètre ] : Error executing script. Invalid data for if at pos 2: expected int for dictionary value @ data['position']
2023-08-28 18:52:54.391 ERROR (MainThread) [homeassistant.components.script.positionnement_dun_store_parametre] POSITIONNEMENT d'un store [ Paramètre ] : POSITIONNEMENT d'un store: Error executing script. Invalid data for call_service at pos 2: expected int for dictionary value @ data['position']
2023-08-28 18:52:54.551 ERROR (MainThread) [homeassistant.components.script.positionnement_dun_store_parametre] POSITIONNEMENT d'un store [ Paramètre ] : Error executing script. Invalid data for if at pos 2: expected int for dictionary value @ data['position']
2023-08-28 18:59:05.643 ERROR (MainThread) [frontend.js.latest.202308021] https://ha-mlambert.duckdns.org:8123/frontend_latest/app-pdfsSFVCtsE.js:2:10695 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "mushroom-select" has already been used with this registry
2023-08-28 18:59:05.662 ERROR (MainThread) [frontend.js.latest.202308021] https://ha-mlambert.duckdns.org:8123/hacsfiles/light-entity-row/light-entity-row.js?hacstag=151318225025:10:47 ReferenceError: Can't find variable: Polymer
I'm calling the script this way
**Opening -Closing**
**----------------------------**
type: custom:mushroom-template-card
secondary: Bureau
icon: >-
{% set _Ent = 'cover.bureau' %} {% set _Att = 'current_position' %} {% if
((state_attr(_Ent, _Att) / 10) <= 1) %}
phu:shutter-100
{% elif ((state_attr(_Ent, _Att) / 10) <= 2) %}
phu:shutter-90
{% elif ((state_attr(_Ent, _Att) / 10) <= 3) %}
phu:shutter-80
{% elif ((state_attr(_Ent, _Att) / 10) <= 4) %}
phu:shutter-70
{% elif ((state_attr(_Ent, _Att) / 10) <= 5) %}
phu:shutter-60
{% elif ((state_attr(_Ent, _Att) / 10) <= 6) %}
phu:shutter-50
{% elif ((state_attr(_Ent, _Att) / 10) <= 7) %}
phu:shutter-40
{% elif ((state_attr(_Ent, _Att) / 10) <= 8) %}
phu:shutter-30
{% elif ((state_attr(_Ent, _Att) / 10) <= 9) %}
phu:shutter-20
{% elif ((state_attr(_Ent, _Att) / 10) <= 9.9) %}
phu:shutter-10
{% elif ((state_attr(_Ent, _Att) / 10) <= 10) %}
phu:shutter-0
{% endif %}
layout: vertical
double_tap_action:
action: call-service
service: cover.stop_cover
target:
entity_id: cover.bureau
data: {}
hold_action:
action: call-service
service: script.1693003922896
data:
_actionStore: Fermer
_pieceStore: Bureau
_storeEntity: cover.bureau
_eweEntity: binary_sensor.ewe_fenetre_bureau_opening_2
tap_action:
action: call-service
service: script.1689978205320
data:
_actionStore: Ouvrir
_pieceStore: Bureau
_storeEntity: cover.bureau
_eweEntity: binary_sensor.ewe_fenetre_bureau_opening_2
badge_icon: none
badge_color: transparent
icon_color: transparent
primary: ''
card_mod:
style: |
:host {
--mush-icon-symbol-size: 1em;
}
mushroom-badge-icon:after {
content: "{{ state_attr('cover.bureau','current_position') }}%";
position: absolute;
display: flex;
justify-content: center;
align-items: center;
background: rgb(var(--rgb-green));
color: var(--card-background-color);
font-weight: bolder;
border-radius: 75%;
top: 0;
width: 150%;
height: 150%;
font-size: 0.6em;
}
Positionning
tap_action:
action: call-service
service: script.positionnement_dun_store_parametre
data:
_actionStore: Positionner
_pieceStore: Salle à manger
_storePos: '{{ states(''input_number.store_ouverture_bureau'') | int }}'
_storeEntity: cover.fenetre
_eweEntity: binary_sensor.ewe_fenetre_sam_opening
entity: input_number.store_ouverture_bureau
1.1 SCRIPT: Opening
alias: OUVERTURE d'un store [ Paramètre ]
sequence:
- service: notify.persistent_notification
data:
message: >-
l'action a poser est {{ _actionStore }} - La piece ou est le store est:
{{ _eweStore }} - Le nom du store est: {{_storeEntity }}
- if:
- condition: template
value_template: "{{ _actionStore == 'Ouvrir' }}"
alias: "[ _ationStore ] = Ouvrir"
enabled: true
- condition: template
value_template: "{{ is_state(_eweEntity,'off') }}"
alias: Vérifier si la fenêtre est fermé
enabled: true
then:
- service: notify.persistent_notification
data:
message: Ouverture
- service: cover.open_cover
data: {}
target:
entity_id: "{{_storeEntity}}"
enabled: true
alias: OUVERTURE d'un store
else:
- service: notify.persistent_notification
data:
message: fermeture
mode: single
icon: mdi:roller-shade
**1.2 SCRIPT: Closing**
alias: FERMETURE d'un store [ Paramètre ]
sequence:
- service: notify.persistent_notification
data:
message: >-
l'action a poser est {{ _actionStore }} - La piece ou est le store est:
{{ _eweStore }} - Le nom du store est: {{_storeEntity }}
- if:
- condition: template
value_template: "{{ _actionStore == 'Fermer' }}"
alias: "[ _ationStore ] = Fermer"
enabled: true
- condition: template
value_template: "{{ is_state(_eweEntity,'off') }}"
alias: Vérifier si la fenêtre est fermé
enabled: true
then:
- service: notify.persistent_notification
data:
message: Fermeture
- service: cover.close_cover
data: {}
target:
entity_id: "{{_storeEntity}}"
enabled: true
alias: FERMETURE d'un store
else:
- service: notify.persistent_notification
data:
message: fermeture
mode: single
icon: mdi:roller-shade
**1.3 POSITIONING SCRIPT:**
alias: "POSITIONNEMENT d'un store [ Paramètre ] "
sequence:
- service: notify.persistent_notification
data:
message: >-
POSITIONNEMENT d'un store [ Paramètre ]
Action: {{_actionStore}} Pièce: {{_pieceStore}} Position:
{{_storePos}} Entité: {{_storeEntity}} Senseur: {{_eweEntity}}
- if:
- condition: template
value_template: "{{ _actionStore == 'Positionner' }}"
alias: "[ _ationStore ] = Positionner"
enabled: true
- condition: template
value_template: "{{ is_state(_eweEntity,'off') }}"
alias: Vérifier si la fenêtre est fermé
enabled: true
then:
- service: notify.persistent_notification
data:
message: >-
Positionnement du store {{_storeEntity}} à la position de
{{_storePos}} est soumis...
- service: cover.set_cover_position
data:
position: "{{_storePos}}"
target:
entity_id: "{{_storeEntity}}"
enabled: true
alias: POSITIONNEMENT d'un store
else:
- service: notify.persistent_notification
data:
message: La fenêtre est possiblement ouverte {{_eweStore}}
mode: single
icon: mdi:roller-shade
Your help will be more than appreciate