Salve a tutti.
Avrei bisogno di “triggare” un evento geneato da un click del mouse in una determinata card per gestire una card condizionale.
Chi mi può dare una dritta ? Grazie
Ciao Sandro - benvenuto!
Please keep it in English. According to google translate, you want to capture the click on a specific card to be able to show a conditional card? The easiest way to do so is with an input_boolean.
If that’s your goal, you can drop your card config for the existing card (where the tap needs to be captured) and the new conditional card you want to be shown - and I will show you how to proceed.
Thank you for your help. I await indications.
@viesse — M1ke is asking you to include the code for:
- the card that you want to click on
- the conditional card you want to show
type: vertical-stack
cards:
- type: thermostat
entity: climate.termostato_caldaiamb
name: Termostato Montebello - type: conditional
conditions: []
card:
type: history-graph
entities:
- entity: climate.termostato_caldaiamb
hours_to_show: 36
refresh_interval: 0
I hope whoever is of help to you
- create an input_boolean (impostazioni/aiutante/aggiungi aiutante/commutatore) [configuration/helpers/add helper/toggle], called “Corso Termostato Caldaiamb”
- go to impostazioni/controlli del server [configuration/server controls] and click “riciarica input booleani” [reload input booleans]
Then you can use the following code:
type: vertical-stack
cards:
- type: thermostat
entity: climate.termostato_caldaiamb
name: Termostato Montebello
hold_action:
action: call-service
service: input_boolean.toggle
service_data:
entity_id: input_boolean.corso_termostato_caldaiamb
- type: conditional
conditions:
- entity: input_boolean.corso_termostato_caldaiamb
state: 'on'
card:
type: history-graph
entities:
- entity: climate.termostato_caldaiamb
hours_to_show: 36
refresh_interval: 0
Now, when you long-press the thermostat card it shows/hides the history-graph card.
Thanks for mediating, @Troon
No problem. I’m always amazed by people who manage to get anything working at all when the system is not in their first language, but I think your “you can drop your card config for the existing card” didn’t get understood.
Absolutely! Might use different words next time
I do not understand
thank you, but it doesn’t work. Where should I do the long click?
type: vertical-stack
cards:
- type: thermostat
entity: climate.termostato_caldaiamb
name: Termostato Montebello
hold_action:
action: call-service
service: input_boolean.toggle
service_data:
entity_id: input_boolean.pippo - type: conditional
conditions:- entity: input_boolean.pippo
state: ‘on’
card:
type: history-graph
entities:- entity: climate.termostato_caldaiamb
hours_to_show: 36
refresh_interval: 0
- entity: climate.termostato_caldaiamb
- entity: input_boolean.pippo
Hmm shit, I just realized that the thermostat card does not support tap_action/hold_action…
lo, lo faro ? Grazie
can I add a button under the tab or do you have another solution?
yes, try this (there are many options):
type: vertical-stack
cards:
- type: thermostat
entity: climate.termostato_caldaiamb
name: Termostato Montebello
- type: entities
entities:
- type: buttons
entities:
- entity: input_boolean.pippo
name: whatever you want
- type: conditional
conditions:
- entity: input_boolean.pippo
state: 'on'
card:
type: history-graph
entities:
- entity: climate.termostato_caldaiamb
hours_to_show: 36
refresh_interval: 0
this works perfectly. It would have been interesting if it also worked with long press. Anyway many thanks
1000 thanks to you too
type: vertical-stack
cards:
- type: thermostat
entity: climate.termostato_caldaiamb
- type: horizontal-stack
cards:
- type: button
tap_action:
action: toggle
entity: input_boolean.setup
show_name: false
icon_height: 20px
show_icon: true
icon: 'mdi:hammer-wrench'
- type: button
tap_action:
action: toggle
entity: input_boolean.graph
show_name: false
icon_height: 20px
show_icon: true
show_state: false
icon: 'mdi:chart-line'
- type: conditional
conditions:
- entity: input_boolean.graph
state: 'on'
card:
type: history-graph
entities:
- entity: climate.termostato_caldaiamb
hours_to_show: 24
refresh_interval: 0
- type: conditional
conditions:
- entity: input_boolean.setup
state: 'on'
card:
type: entities
entities:
- entity: input_datetime.orario_giorno
- entity: input_number.temperatura_giorno
- entity: input_datetime.orario_notte
- entity: input_number.temperatura_notte
Many thanks