OK all, I have taken this as far as I can go … I promise now I will pull it togther and post on Git, you have much of it above.
The code for GUI is now this (of course you will need many of the code behind like sensors, automations, scripts) …
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
entity: sensor.random_pokemon
primary: Previous Pokemon
secondary: Show Previous Pokemon
icon: mdi:backburger
icon_color: red
tap_action:
action: none
hold_action:
action: call-service
service: script.get_pokemon
data:
pokemode: Decrement
target: {}
- type: custom:mushroom-template-card
entity: sensor.random_pokemon
primary: Grab a Pokemon!
secondary: Hold to Grab a random Pokemon
icon: mdi:pokeball
icon_color: red
tap_action:
action: none
hold_action:
action: call-service
service: script.get_pokemon
data:
pokemode: Random
target: {}
- type: custom:mushroom-select-card
entity: input_select.pokedex
icon: mdi:pokemon-go
icon_color: red
name: Select A Pokemon
layout: horizontal
hold_action:
action: call-service
service: script.get_pokemon
data:
pokemode: Name
target: {}
- type: custom:mushroom-template-card
entity: sensor.random_pokemon
primary: Next Pokemon
secondary: Show Next Pokemon
icon: mdi:forwardburger
icon_color: red
tap_action:
action: none
hold_action:
action: call-service
service: script.get_pokemon
data:
pokemode: Increment
target: {}
- type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: custom:mushroom-title-card
entity: sensor.random_pokemon
title: '{{state_attr(''sensor.random_pokemon'',''name'') | capitalize}}'
subtitle: ''
title_tap_action:
action: none
- type: markdown
content: >
{% set fv = namespace(engfv=[]) %} {% for fte in
state_attr('sensor.pokemon_species','flavor_text_entries') -%} {%
if fte.language.name == 'en' -%}
{% set fv.engfv = fv.engfv + [fte.flavor_text | replace('\n',' ') | replace('\f',' ')] %}
{% endif %} {%- endfor %} {{ fv.engfv[0] }}
- type: custom:config-template-card
entities:
- sensor.random_pokemon
card:
type: picture-entity
entity: sensor.random_pokemon
show_name: false
show_state: false
image: >-
${'http://192.168.2.245:8123/local/Pokemon/Sprites/Master/' +
states['sensor.random_pokemon'].attributes.id + '.png'}
- type: markdown
content: |
Pokémon Images & Names © 1995-2023 Nintendo/Game Freak.
- type: vertical-stack
cards:
- type: custom:mushroom-title-card
title: Data
subtitle: ''
title_tap_action:
action: none
- type: horizontal-stack
cards:
- type: markdown
content: >-
## Information
National No: {{state_attr('sensor.random_pokemon','id') }}
Height: {{state_attr('sensor.random_pokemon','height')/10}} m
Weight: {{state_attr('sensor.random_pokemon','weight')/10 }}
kg
Base Experience:
{{state_attr('sensor.random_pokemon','base_experience') }}
## Held Items
{% if state_attr("sensor.random_pokemon","held_items") | count
> 0 %} {% for hi in
state_attr("sensor.random_pokemon","held_items") -%}
{{ hi.item.name }}
{%- endfor %} {% else %}
{{'No Held Items'}}
{% endif %}
- type: markdown
content: >-
## Types
{% for tp in state_attr("sensor.random_pokemon","types") -%}
{{ tp.type.name }}
{% endfor %}
## Abilities
{% for ab in state_attr("sensor.random_pokemon","abilities")
-%}
{{ ab.ability.name }}
{% endfor %}
- type: custom:mushroom-title-card
title: Moves
subtitle: ''
title_tap_action:
action: none
- type: custom:stack-in-card
mode: vertical
style: 'ha-card {overflow-y: scroll!important; height: 350px}'
cards:
- type: custom:auto-entities
card:
type: grid
square: false
columns: 4
card_param: cards
filter:
template: |-
{% for mv in state_attr("sensor.random_pokemon","moves") -%}
{{
{
'type': 'custom:mushroom-template-card',
'primary': mv.move.name,
'secondary': '',
'icon_type': 'none',
'tap_action': 'none',
'style': 'ha-card {text-align: center; box-shadow: none}'
}
}},
{%- endfor %}
- type: vertical-stack
cards:
- type: custom:mushroom-title-card
title: Statistics
subtitle: ''
title_tap_action:
action: none
- type: custom:stack-in-card
mode: vertical
cards:
- type: horizontal-stack
cards:
- type: custom:card-templater
entities:
- sensor.random_pokemon
card:
type: custom:gauge-card
entity: sensor.pokemon_base_stats
attribute: hp
measurement: ''
title: HP
min: 0
max_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 1.1 }}
severity:
red_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.8 }}
green_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.3 }}
amber_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.6 }}
- type: custom:card-templater
entities:
- sensor.random_pokemon
card:
type: custom:gauge-card
entity: sensor.pokemon_base_stats
attribute: attack
measurement: ''
title: Attack
min: 0
max_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 1.1 }}
severity:
red_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.8 }}
green_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.3 }}
amber_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.6 }}
- type: horizontal-stack
cards:
- type: custom:card-templater
entities:
- sensor.random_pokemon
card:
type: custom:gauge-card
entity: sensor.pokemon_base_stats
attribute: defense
measurement: ''
title: Defense
min: 0
max_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 1.1 }}
severity:
red_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.8 }}
green_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.3 }}
amber_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.6 }}
- type: custom:card-templater
entities:
- sensor.random_pokemon
card:
type: custom:gauge-card
entity: sensor.pokemon_base_stats
attribute: special-attack
measurement: ''
title: Special Attack
min: 0
max_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 1.1 }}
severity:
red_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.8 }}
green_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.3 }}
amber_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.6 }}
- type: horizontal-stack
cards:
- type: custom:card-templater
entities:
- sensor.random_pokemon
card:
type: custom:gauge-card
entity: sensor.pokemon_base_stats
attribute: special-defense
measurement: ''
title: Special Defense
min: 0
max_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 1.1 }}
severity:
red_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.8 }}
green_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.3 }}
amber_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.6 }}
- type: custom:card-templater
entities:
- sensor.random_pokemon
card:
type: custom:gauge-card
entity: sensor.pokemon_base_stats
attribute: speed
measurement: ''
title: Speed
min: 0
max_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 1.1 }}
severity:
red_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.8 }}
green_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.3 }}
amber_template: >-
{{ (state_attr("sensor.random_pokemon","stats") |
map(attribute="base_stat") | max) * 0.6 }}
- type: custom:mushroom-title-card
title: Sprites
subtitle: ''
title_tap_action:
action: none
- type: vertical-stack
cards:
- type: custom:stack-in-card
mode: vertical
cards:
- type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: custom:mushroom-template-card
picture: >
/local/Pokemon/Sprites/front/{{state_attr('sensor.random_pokemon','id')}}.png
primary: Front
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
- type: custom:mushroom-template-card
picture: >
/local/Pokemon/Sprites/back/{{state_attr('sensor.random_pokemon','id')}}.png
primary: Back
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
- type: custom:mushroom-template-card
picture: >
/local/Pokemon/Sprites/front/shiny/{{state_attr('sensor.random_pokemon','id')}}.png
primary: Front Shiny
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
- type: custom:mushroom-template-card
picture: >
/local/Pokemon/Sprites/back/shiny/{{state_attr('sensor.random_pokemon','id')}}.png
primary: Back Shiny
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
- type: vertical-stack
cards:
- type: custom:mushroom-template-card
picture: >
{% if
state_attr("sensor.random_pokemon","sprites").front_female[0]
is defined %}
/local/Pokemon/Sprites/front/female/{{state_attr("sensor.random_pokemon","id")}}.png
{% else %}
/local/Pokemon/Sprites/0.png
{% endif %}
primary: Front Female
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
- type: custom:mushroom-template-card
picture: >
{% if
state_attr("sensor.random_pokemon","sprites").back_female[0]
is defined %}
/local/Pokemon/Sprites/back/female/{{state_attr("sensor.random_pokemon","id")}}.png
{% else %}
/local/Pokemon/Sprites/0.png
{% endif %}
primary: Back Female
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
- type: custom:mushroom-template-card
picture: >
{% if
state_attr("sensor.random_pokemon","sprites").front_shiny_female[0]
is defined %}
/local/Pokemon/Sprites/back/female/shiny/{{state_attr("sensor.random_pokemon","id")}}.png
{% else %}
/local/Pokemon/Sprites/0.png
{% endif %}
primary: Front Shiny Female
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
- type: custom:mushroom-template-card
picture: >
{% if
state_attr("sensor.random_pokemon","sprites").back_shiny_female[0]
is defined %}
/local/Pokemon/Sprites/back/female/shiny/{{state_attr("sensor.random_pokemon","id")}}.png
{% else %}
/local/Pokemon/Sprites/0.png
{% endif %}
primary: Back Shiny Female
secondary: ''
layout: horizontal
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none