Initialize docker stack repo

This commit is contained in:
g4st3r
2026-03-07 17:28:59 +00:00
commit 319d4eeb3e
458 changed files with 67215 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
# Folder used for combining card templates
# - from HACS
# - from /config/ui_lovelace_minimalist/cards
# - Setting correct language file
__ui_minimalist__/
.installed

View File

@@ -0,0 +1,215 @@
"""Custom Integration to setup UI Lovelace Minimalist."""
from __future__ import annotations
import logging
from pathlib import Path
import shutil
from typing import TYPE_CHECKING, Any, cast
from aiogithubapi import AIOGitHubAPIException, GitHubAPI, GitHubClientKwarg
from homeassistant.components.frontend import async_remove_panel
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.loader import async_get_integration
import voluptuous as vol
if TYPE_CHECKING:
from homeassistant.core import HomeAssistant
from .base import UlmBase
from .const import DOMAIN, NAME
from .enums import ConfigurationType, UlmDisabledReason
_LOGGER: logging.Logger = logging.getLogger(__package__)
CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA)
async def async_initialize_integration(
hass: HomeAssistant,
*,
config_entry: ConfigEntry | None = None,
config: dict[str, Any] | None = None,
) -> bool:
"""Initialize the integration."""
hass.data[DOMAIN] = ulm = UlmBase()
ulm.enable_ulm()
if config is not None:
if DOMAIN not in config:
return True
if ulm.configuration.config_type == ConfigurationType.CONFIG_ENTRY:
return True
ulm.configuration.update_from_dict(
{
"config_type": ConfigurationType.YAML,
**config[DOMAIN],
"config": config[DOMAIN],
}
)
if config_entry is not None:
if config_entry.source == SOURCE_IMPORT:
# not sure about this one
hass.async_create_task(
hass.config_entries.async_remove(config_entry.entry_id)
)
return False
ulm.configuration.update_from_dict(
{
"config_entry": config_entry,
"config_type": ConfigurationType.CONFIG_ENTRY,
**config_entry.data,
**config_entry.options,
}
)
integration = await async_get_integration(hass, DOMAIN)
clientsession = async_get_clientsession(hass)
ulm.integration = integration
ulm.version = integration.version
ulm.hass = hass
ulm.system.running = True
ulm.githubapi = GitHubAPI(
token=ulm.configuration.token,
session=clientsession,
**cast("dict[GitHubClientKwarg, Any]", {"client_name": "ULM"}),
)
async def async_startup() -> bool:
"""ULM Startup tasks."""
if (
ulm.configuration.community_cards_enabled
and ulm.configuration.token is None
):
ulm.disable_ulm(UlmDisabledReason.INVALID_TOKEN)
ulm.log.error(
"Github token is not set up yet, please reconfigure the integration."
)
return False
if ulm.configuration.community_cards_enabled:
await ulm.fetch_cards()
await ulm.configure_community_cards()
response_configure = await ulm.configure_ulm()
response_plugins = await ulm.configure_plugins()
response_dashboard = await ulm.configure_dashboard()
if not response_configure or not response_plugins or not response_dashboard:
return False
ulm.enable_ulm()
return not ulm.system.disabled
try:
startup_result = await async_startup()
except AIOGitHubAPIException:
startup_result = False
if not startup_result:
return False
ulm.enable_ulm()
return True
async def async_setup(hass: HomeAssistant, config: dict) -> bool:
"""Set up this integration using UI."""
return await async_initialize_integration(hass=hass, config=config)
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Set up this integration using UI."""
config_entry.async_on_unload(
config_entry.add_update_listener(config_entry_update_listener)
)
return await async_initialize_integration(hass=hass, config_entry=config_entry)
async def async_remove_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Remove Integration."""
_LOGGER.debug("%s is now uninstalled", NAME)
# Remove the Frontend Panels
async_remove_panel(hass, "ui-lovelace-minimalist")
dashboard_url = "ui-lovelace-minimalist"
is_registered = dashboard_url in hass.data.get("frontend_panels", {})
sidepanel_enabled = config_entry.options.get("sidepanel_enabled", False)
# Check config entry options and if sidepanel is enabled
if is_registered or sidepanel_enabled:
_LOGGER.debug("Removing Minimalist dashboard panel: %s", dashboard_url)
# Remove minimalist panel from the sidebar
async_remove_panel(hass, dashboard_url)
# Clean up the Lovelace YAML object if it exists in memory
if (
"lovelace" in hass.data
and dashboard_url in hass.data["lovelace"].dashboards
):
hass.data["lovelace"].dashboards.pop(dashboard_url)
adaptive_url = "adaptive-dash"
is_registered = adaptive_url in hass.data.get("frontend_panels", {})
adaptive_enabled = config_entry.options.get("adaptive_ui_enabled", False)
# Check config entry options and if sidepanel is enabled
if is_registered or adaptive_enabled:
_LOGGER.debug("Removing Minimalist adaptive panel: %s", adaptive_url)
# Remove adaptive panel from the sidebar
async_remove_panel(hass, adaptive_url)
# Clean up the Lovelace YAML object if it exists in memory
if "lovelace" in hass.data and adaptive_url in hass.data["lovelace"].dashboards:
hass.data["lovelace"].dashboards.pop(adaptive_url)
# Identify theme and blueprint paths for cleanup
theme_path = config_entry.options.get("theme_path", "themes")
paths_to_remove = [
Path(hass.config.path(theme_path)) / "minimalist-desktop",
Path(hass.config.path(theme_path)) / "minimalist-mobile",
Path(hass.config.path(theme_path)) / "minimalist-ios-tapbar",
Path(hass.config.path(theme_path)) / "minimalist-mobile-tapbar",
Path(
hass.config.path(
"custom_components/ui_lovelace_minimalist/__ui_minimalist__"
)
),
]
def _cleanup_files(paths: list[Path]):
"""Sync cleanup task for the executor."""
for path in paths:
if path.exists():
if path.is_dir():
shutil.rmtree(path, ignore_errors=True)
else:
path.unlink(missing_ok=True)
# Run cleanup in executor
await hass.async_add_executor_job(_cleanup_files, paths_to_remove)
async def config_entry_update_listener(
hass: HomeAssistant, config_entry: ConfigEntry
) -> None:
"""Update listener, called when the config entry options are changed."""
_LOGGER.debug("Start config_entry_update async_reload")
await hass.config_entries.async_reload(config_entry.entry_id)
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Unload Integration."""
_LOGGER.debug("Unload the config entry")
return True

View File

@@ -0,0 +1,611 @@
"""Base UI Lovelace Minimalist class."""
from __future__ import annotations
import asyncio
from dataclasses import asdict, dataclass, field
import logging
from pathlib import Path
import shutil
from typing import TYPE_CHECKING, Any
from aiogithubapi import (
GitHubAPI,
GitHubAuthenticationException,
GitHubContentsModel,
GitHubException,
GitHubNotModifiedException,
GitHubRatelimitException,
)
from homeassistant.components.frontend import add_extra_js_url, async_remove_panel
from homeassistant.components.http import StaticPathConfig
from homeassistant.components.lovelace import _register_panel
from homeassistant.components.lovelace.dashboard import LovelaceYAML
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
if TYPE_CHECKING:
from collections.abc import Awaitable, Callable
from homeassistant.core import HomeAssistant
from homeassistant.loader import Integration
from .const import (
COMMUNITY_CARDS_FOLDER,
DEFAULT_COMMUNITY_CARDS_ENABLED,
DEFAULT_INCLUDE_OTHER_CARDS,
DEFAULT_LANGUAGE,
DEFAULT_SIDEPANEL_ENABLED,
DEFAULT_SIDEPANEL_ICON,
DEFAULT_SIDEPANEL_TITLE,
DEFAULT_THEME,
DEFAULT_THEME_PATH,
DOMAIN,
GITHUB_REPO,
LANGUAGES,
TV,
)
from .enums import ConfigurationType, UlmDisabledReason
from .utils.decode import decode_content
_LOGGER: logging.Logger = logging.getLogger(__name__)
class MinimalistException(Exception):
"""Base exception for UI Lovelace Minimalist."""
class InvalidConfigurationError(MinimalistException):
"""Raised when the configuration is not a dictionary."""
@dataclass
class UlmSystem:
"""ULM System info."""
disabled_reason: UlmDisabledReason | None = None
running: bool = False
@property
def disabled(self) -> bool:
"""Return if ULM is disabled."""
return self.disabled_reason is not None
@dataclass
class UlmConfiguration:
"""UlmConfiguration class."""
config: dict[str, Any] = field(default_factory=dict)
config_entry: ConfigEntry | None = None
config_type: ConfigurationType | None = None
sidepanel_enabled: bool = DEFAULT_SIDEPANEL_ENABLED
sidepanel_icon: str = DEFAULT_SIDEPANEL_ICON
sidepanel_title: str = DEFAULT_SIDEPANEL_TITLE
adaptive_ui_enabled: bool = DEFAULT_SIDEPANEL_ENABLED
adaptive_ui_icon: str = DEFAULT_SIDEPANEL_ICON
adaptive_ui_title: str = DEFAULT_SIDEPANEL_TITLE
theme_path: str = DEFAULT_THEME_PATH
theme: str = DEFAULT_THEME
plugin_path: str = "www/community/"
include_other_cards: bool = DEFAULT_INCLUDE_OTHER_CARDS
language: str = DEFAULT_LANGUAGE
community_cards_enabled = bool = DEFAULT_COMMUNITY_CARDS_ENABLED
community_cards: list = field(default_factory=list)
all_community_cards: list = field(default_factory=list)
token: str = ""
def to_dict(self) -> dict:
"""Return Dict."""
return self.__dict__
def to_json(self) -> str:
"""Return a json string."""
return str(asdict(self))
def update_from_dict(self, data: dict) -> None:
"""Set attributes from dicts."""
if not isinstance(data, dict):
raise InvalidConfigurationError("Configuration is not valid.")
for key, value in data.items():
self.__setattr__(key, value)
class UlmBase:
"""Base UI Lovelace Minimalist."""
integration: Integration | None = None
configuration = UlmConfiguration()
hass: HomeAssistant | None = None
log: logging.Logger = _LOGGER
githubapi: GitHubAPI | None = None
system = UlmSystem()
version: str | None = None
@property
def integration_dir(self) -> Path:
"""Return the ULM integration dir."""
return self.integration.file_path
@property
def templates_dir(self) -> Path:
"""Return the Button Cards Template dir."""
return Path(f"{self.integration_dir}/__ui_minimalist__/ulm_templates")
@property
def community_cards_dir(self) -> Path:
"""Return the Comminty cards dir inside Template dir."""
return Path(f"{self.templates_dir}/community_cards")
def disable_ulm(self, reason: UlmDisabledReason) -> None:
"""Disable Ulm."""
if self.system.disabled_reason == reason:
return
self.system.disabled_reason = reason
if reason == UlmDisabledReason.INVALID_TOKEN:
self.configuration.config_entry.state = ConfigEntryState.SETUP_ERROR
self.configuration.config_entry.reason = "Authentiation Failed"
self.hass.add_job(
self.configuration.config_entry.async_start_reauth, self.hass
)
def enable_ulm(self) -> None:
"""Enable Ulm."""
if self.system.disabled_reason is not None:
self.system.disabled_reason = None
self.log.info("ULM is enabled")
async def async_save_file(self, file_path: str, content: Any) -> bool:
"""Save a file."""
self.log.debug("Saving file: %s", file_path)
def _write_file() -> bool:
path = Path(file_path)
try:
path.parent.mkdir(parents=True, exist_ok=True)
if isinstance(content, str):
path.write_text(content, encoding="utf-8", errors="ignore")
else:
path.write_bytes(content)
return path.exists()
except OSError:
self.log.exception("Could not write data to %s", file_path)
return False
return await self.hass.async_add_executor_job(_write_file)
async def async_github_get_file(self, filename: str) -> str:
"""Get the content of a file."""
self.log.debug("Fetching github file: %s", filename)
response = await self.async_github_api_method(
method=self.githubapi.repos.contents.get,
repository=GITHUB_REPO,
path=filename,
)
if response and hasattr(response, "data"):
if isinstance(response.data, GitHubContentsModel) and response.data.content:
return decode_content(response.data.content)
return ""
async def async_github_get_tree(self, path: str) -> list[GitHubContentsModel]:
"""Get the content of a directory."""
self.log.debug("Fetching github tree: %s", path)
response = await self.async_github_api_method(
method=self.githubapi.repos.contents.get, repository=GITHUB_REPO, path=path
)
if response and hasattr(response, "data"):
if isinstance(response.data, list) and response.data:
return response.data
return []
async def async_github_api_method(
self,
method: Callable[[], Awaitable[TV]],
*args,
raise_exception: bool = True,
**kwargs,
) -> TV | None:
"""Call a GitHub API method."""
_exception = None
try:
return await method(*args, **kwargs)
except GitHubAuthenticationException as exception:
self.disable_ulm(UlmDisabledReason.INVALID_TOKEN)
_exception = exception
except GitHubRatelimitException as exception:
_exception = exception
except GitHubNotModifiedException:
raise
except GitHubException as exception:
_exception = exception
except MinimalistException as exception:
_exception = exception
if raise_exception and _exception is not None:
raise MinimalistException(_exception)
return None
def list_dirs(self) -> list[Path]:
"""Return a list of directory Path objects."""
self.log.debug("Listing directories in %s", self.community_cards_dir)
if not self.community_cards_dir.is_dir():
return []
return [path for path in self.community_cards_dir.iterdir() if path.is_dir()]
async def fetch_cards(self) -> None:
"""Fetch list of cards."""
response = await self.async_github_api_method(
method=self.githubapi.repos.contents.get,
repository=GITHUB_REPO,
path=COMMUNITY_CARDS_FOLDER,
)
if response and hasattr(response, "data"):
if isinstance(response.data, list) and response.data:
self.configuration.all_community_cards = [
c.name for c in response.data if c.type == "dir"
]
async def download_and_save(self, github_path, local_path):
"""Download and save selected community cards."""
content = await self.async_github_get_file(filename=github_path)
await self.async_save_file(file_path=str(local_path), content=content)
async def configure_community_cards(self) -> None:
"""Configure selected community cards."""
self.log.info("Configuring selected community cards")
# Handle full cleanup if disabled or no cards selected
if (
not self.configuration.community_cards_enabled
or self.configuration.community_cards == []
):
if self.community_cards_dir.exists():
await self.hass.async_add_executor_job(
shutil.rmtree, str(self.community_cards_dir), True
)
return
# Ensure base directory exists for next steps
self.community_cards_dir.mkdir(parents=True, exist_ok=True)
language = LANGUAGES[self.configuration.language]
# Identify folders to delete (Unselected or missing from GitHub)
existing_dirs = await self.hass.async_add_executor_job(self.list_dirs)
all_github_cards = self.configuration.all_community_cards
delete_tasks = []
for path_str in existing_dirs:
path = Path(path_str)
card_name = path.name
if card_name not in self.configuration.community_cards:
self.log.debug(
"Deleting community card folder %s, not selected anymore.",
card_name,
)
delete_tasks.append(path)
elif card_name not in all_github_cards:
self.log.debug(
"Deleting community card folder %s, that is not existing anymore on Github.",
card_name,
)
delete_tasks.append(path)
# Batch delete unneeded folders to minimize executor overhead
if delete_tasks:
def _batch_delete(paths):
for p in paths:
shutil.rmtree(str(p), ignore_errors=True)
await self.hass.async_add_executor_job(_batch_delete, delete_tasks)
# Download selected cards
if self.configuration.community_cards_enabled:
for card in self.configuration.community_cards:
if card not in self.configuration.all_community_cards:
self.configuration.community_cards.remove(card)
else:
card_files = await self.async_github_get_tree(
path=f"{COMMUNITY_CARDS_FOLDER}/{card}"
)
download_tasks = []
for f in card_files:
if f.type == "file":
target_path: Path = self.community_cards_dir / card / f.name
# Pathlib check for existence and size
if (
not target_path.exists()
or target_path.stat().st_size != f.size
):
download_tasks.append(
self.download_and_save(f.path, target_path)
)
elif f.type == "dir" and f.name == "languages":
language_files = await self.async_github_get_tree(
path=f.path
)
for lang in language_files:
# Only download if the stem matches the target language
if Path(lang.name).stem == language:
target_path: Path = (
self.community_cards_dir
/ card
/ "languages"
/ lang.name
)
if (
not target_path.exists()
or target_path.stat().st_size != lang.size
):
download_tasks.append(
self.download_and_save(
lang.path, target_path
)
)
# Execute all downloads concurrently
if download_tasks:
await asyncio.gather(*download_tasks)
async def configure_plugins(self) -> bool:
"""Configure the Plugins ULM depends on."""
self.log.debug("Checking Dependencies.")
self.log.info("Setup ULM Plugins")
try:
browser_mod_path = Path(
self.hass.config.path("custom_components/browser_mod")
)
if not browser_mod_path.exists():
self.log.error('HACS Integration repo "Browser Mod" is not installed.')
depenceny_resource_paths = [
"button-card",
"light-entity-card",
"lovelace-card-mod",
"lovelace-auto-entities",
"mini-graph-card",
"mini-media-player",
"my-cards",
"simple-weather-card",
"lovelace-layout-card",
"lovelace-state-switch",
"weather-radar-card",
]
for p in depenceny_resource_paths:
frontend_repo_path = Path(self.hass.config.path(f"www/community/{p}"))
if not self.configuration.include_other_cards:
if not frontend_repo_path.exists():
self.log.error(
'HACS Frontend repo "%s" is not installed, '
"See Integration Configuration.",
p,
)
elif frontend_repo_path.exists():
self.log.error(
'HACS Frontend repo "%s" is already installed, '
"Remove it or disable include custom cards.",
p,
)
if self.configuration.include_other_cards:
for c in depenceny_resource_paths:
add_extra_js_url(
self.hass, f"/ui_lovelace_minimalist/cards/{c}/{c}.js"
)
# Register
await self.hass.http.async_register_static_paths(
[
StaticPathConfig(
"/ui_lovelace_minimalist/cards",
self.hass.config.path(f"{self.integration_dir}/cards"),
True,
)
]
)
except MinimalistException as exception:
self.log.error(exception)
self.disable_ulm(UlmDisabledReason.LOAD_ULM)
return False
return True
async def configure_dashboard(self) -> bool:
"""Configure the ULM Dashboards."""
self.log.info("Setup ULM Dashboard")
dashboard_url = "ui-lovelace-minimalist"
dashboard_config = {
"mode": "yaml",
"icon": self.configuration.sidepanel_icon,
"title": self.configuration.sidepanel_title,
"filename": "ui_lovelace_minimalist/dashboard/ui-lovelace.yaml",
"show_in_sidebar": True,
"require_admin": False,
}
adv_dashboard_url = "adaptive-dash"
adv_dashboard_config = {
"mode": "yaml",
"icon": self.configuration.adaptive_ui_icon,
"title": self.configuration.adaptive_ui_title,
"filename": "ui_lovelace_minimalist/dashboard/adaptive-dash/adaptive-ui.yaml",
"show_in_sidebar": True,
"require_admin": False,
}
# Optoinal override can be done with config_flow?
# if not dashboard_url in hass.data["lovelace"].dashboards:
try:
if self.configuration.sidepanel_enabled:
self.hass.data["lovelace"].dashboards[dashboard_url] = LovelaceYAML(
self.hass, dashboard_url, dashboard_config
)
_register_panel(
self.hass, dashboard_url, "yaml", dashboard_config, True
)
elif dashboard_url in self.hass.data["lovelace"].dashboards:
async_remove_panel(self.hass, "ui-lovelace-minimalist")
if self.configuration.adaptive_ui_enabled:
self.hass.data["lovelace"].dashboards[adv_dashboard_url] = LovelaceYAML(
self.hass, adv_dashboard_url, adv_dashboard_config
)
_register_panel(
self.hass, adv_dashboard_url, "yaml", adv_dashboard_config, True
)
elif adv_dashboard_url in self.hass.data["lovelace"].dashboards:
async_remove_panel(self.hass, "adaptive-dash")
except MinimalistException as exception:
self.log.error(exception)
self.disable_ulm(UlmDisabledReason.LOAD_ULM)
return False
return True
async def configure_ulm(self) -> bool:
"""Configure initial dashboard & cards directory."""
self.log.info("Setup ULM Configuration")
# Define Path objects
base_dir = Path(self.hass.config.path(DOMAIN))
integration_lovelace = Path(self.integration_dir) / "lovelace"
dashboard_file = base_dir / "dashboard" / "ui-lovelace.yaml"
adaptive_dir = base_dir / "dashboard" / "adaptive-dash"
actions_file = base_dir / "custom_actions" / "custom_actions.yaml"
def _sync_file_operations():
"""Grouped synchronous I/O to run in one executor job."""
# Cleanup legacy folders
for folder in ["configs", "addons"]:
shutil.rmtree(base_dir / folder, ignore_errors=True)
# Create necessary directories
for folder in ["dashboard", "custom_cards", "custom_actions"]:
(base_dir / folder).mkdir(parents=True, exist_ok=True)
# Proceed if dashboard dir exists (it should, we just created it)
if (base_dir / "dashboard").exists():
self.templates_dir.mkdir(parents=True, exist_ok=True)
# Translations
language = LANGUAGES[self.configuration.language]
# Copy default language file over to config dir
shutil.copy2(
integration_lovelace / "translations" / "default.yaml",
self.templates_dir / "default.yaml",
)
# Copy chosen language file over to config dir
shutil.copy2(
integration_lovelace / "translations" / f"{language}.yaml",
self.templates_dir / "language.yaml",
)
# Copy example dashboard file over to user config dir if not exists
if self.configuration.sidepanel_enabled and not dashboard_file.exists():
shutil.copy2(
integration_lovelace / "ui-lovelace.yaml", dashboard_file
)
if self.configuration.adaptive_ui_enabled and not adaptive_dir.exists():
shutil.copytree(
integration_lovelace / "adaptive-dash", adaptive_dir
)
# Copy example custom actions file over to user config dir if not exists
if not actions_file.exists():
shutil.copy2(
integration_lovelace / "custom_actions.yaml", actions_file
)
# Copy over cards from integration
shutil.copytree(
integration_lovelace / "ulm_templates",
self.templates_dir,
dirs_exist_ok=True,
)
# Copy over manually installed custom_cards from user
shutil.copytree(
base_dir / "custom_cards",
self.templates_dir / "custom_cards",
dirs_exist_ok=True,
)
# Copy over manually installed custom_actions from user
shutil.copytree(
base_dir / "custom_actions",
self.templates_dir / "custom_actions",
dirs_exist_ok=True,
)
# Copy over themes to defined themes folder
theme_target = Path(
self.hass.config.path(self.configuration.theme_path)
)
shutil.copytree(
integration_lovelace / "themefiles",
theme_target,
dirs_exist_ok=True,
)
try:
# Run all disk I/O in a single block
await self.hass.async_add_executor_job(_sync_file_operations)
# UI Reload and Service Registration
self.hass.bus.async_fire("ui_lovelace_minimalist_reload")
async def handle_reload(call):
self.log.debug("Reload UI Lovelace Minimalist Configuration")
await self.reload_configuration()
# Register servcie ui_lovelace_minimalist.reload
self.hass.services.async_register(DOMAIN, "reload", handle_reload)
except MinimalistException as exception:
self.log.error(exception)
self.disable_ulm(UlmDisabledReason.LOAD_ULM)
return False
return True
async def reload_configuration(self):
"""Reload Configuration."""
self.log.info("Reloading ULM Configuration")
# Define Path objects
base_path = Path(self.hass.config.path(DOMAIN))
def _sync_custom_folders():
"""Internal helper to group I/O operations."""
# Copy over manually installed custom_cards from user
folders = ["custom_cards", "custom_actions"]
for folder in folders:
source = base_path / folder
if source.exists():
shutil.copytree(
source, self.templates_dir / folder, dirs_exist_ok=True
)
# Run all I/O in one executor thread
await self.hass.async_add_executor_job(_sync_custom_folders)
# Notify the system
self.hass.bus.async_fire("ui_lovelace_minimalist_reload")

View File

@@ -0,0 +1,40 @@
---
blueprint:
name: "System Set Default Theme"
description: >-
Set the default themes on start.
domain: "automation"
input:
theme:
name: "Which Theme"
description: "Which theme would you like to set as default on reload / start-up?"
selector:
select:
options:
- "minimalist-desktop"
- "minimalist-mobile"
- "minimalist-mobile-tapbar"
mode:
name: "Which Mode should it be default in"
description: "Default in Dark or Light mode?"
selector:
select:
options:
# based on sun can be added later
- "light"
- "dark"
mode: "single"
trigger:
- platform: "homeassistant"
event: "start"
- platform: "event"
event_type: "automation_reload"
action:
- service: "frontend.set_theme"
data:
name: !input "theme"
mode: !input "mode"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,324 @@
"""Adds Config Flow to UI Lovelace Minimalist Integration."""
from __future__ import annotations
import logging
from typing import Any, cast
from aiogithubapi import (
GitHubClientKwarg,
GitHubDeviceAPI,
GitHubException,
GitHubLoginDeviceModel,
GitHubLoginOauthModel,
)
from aiogithubapi.common.const import OAUTH_USER_LOGIN
from awesomeversion import AwesomeVersion
from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
)
from homeassistant.const import __version__ as HAVERSION
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_call_later
from homeassistant.loader import async_get_integration
import voluptuous as vol
from .base import UlmBase
from .const import (
CLIENT_ID, # CONF_COMMUNITY_CARDS_ALL,
CONF_COMMUNITY_CARDS,
CONF_COMMUNITY_CARDS_ENABLED,
CONF_INCLUDE_OTHER_CARDS,
CONF_LANGUAGE,
CONF_LANGUAGES,
CONF_SIDEPANEL_ADV_ENABLED,
CONF_SIDEPANEL_ADV_ICON,
CONF_SIDEPANEL_ADV_TITLE,
CONF_SIDEPANEL_ENABLED,
CONF_SIDEPANEL_ICON,
CONF_SIDEPANEL_TITLE,
CONF_THEME,
CONF_THEME_OPTIONS,
CONF_THEME_PATH,
DEFAULT_COMMUNITY_CARDS,
DEFAULT_COMMUNITY_CARDS_ENABLED,
DEFAULT_INCLUDE_OTHER_CARDS,
DEFAULT_LANGUAGE,
DEFAULT_SIDEPANEL_ADV_ENABLED,
DEFAULT_SIDEPANEL_ADV_ICON,
DEFAULT_SIDEPANEL_ADV_TITLE,
DEFAULT_SIDEPANEL_ENABLED,
DEFAULT_SIDEPANEL_ICON,
DEFAULT_SIDEPANEL_TITLE,
DEFAULT_THEME,
DEFAULT_THEME_PATH,
DOMAIN,
NAME,
)
from .enums import ConfigurationType
_LOGGER: logging.Logger = logging.getLogger(__name__)
# Version threshold for config_entry setting in options flow
# See: https://github.com/home-assistant/core/pull/129562
HA_OPTIONS_FLOW_VERSION_THRESHOLD = "2024.11.99"
async def ulm_config_option_schema(options: dict[str, Any]) -> dict:
"""Return a schema for ULM configuration options."""
# Also update base.py UlmConfiguration
return {
vol.Optional(
CONF_LANGUAGE, default=options.get(CONF_LANGUAGE, DEFAULT_LANGUAGE)
): vol.In(CONF_LANGUAGES),
vol.Optional(
CONF_SIDEPANEL_ENABLED,
default=options.get(CONF_SIDEPANEL_ENABLED, DEFAULT_SIDEPANEL_ENABLED),
): bool,
vol.Optional(
CONF_SIDEPANEL_TITLE,
default=options.get(CONF_SIDEPANEL_TITLE, DEFAULT_SIDEPANEL_TITLE),
): str,
vol.Optional(
CONF_SIDEPANEL_ICON,
default=options.get(CONF_SIDEPANEL_ICON, DEFAULT_SIDEPANEL_ICON),
): str,
vol.Optional(
CONF_SIDEPANEL_ADV_ENABLED,
default=options.get(
CONF_SIDEPANEL_ADV_ENABLED, DEFAULT_SIDEPANEL_ADV_ENABLED
),
): bool,
vol.Optional(
CONF_SIDEPANEL_ADV_TITLE,
default=options.get(CONF_SIDEPANEL_ADV_TITLE, DEFAULT_SIDEPANEL_ADV_TITLE),
): str,
vol.Optional(
CONF_SIDEPANEL_ADV_ICON,
default=options.get(CONF_SIDEPANEL_ADV_ICON, DEFAULT_SIDEPANEL_ADV_ICON),
): str,
vol.Optional(
CONF_THEME, default=options.get(CONF_THEME, DEFAULT_THEME)
): vol.In(CONF_THEME_OPTIONS),
vol.Optional(
CONF_THEME_PATH,
default=options.get(CONF_THEME_PATH, DEFAULT_THEME_PATH),
): str,
vol.Optional(
CONF_INCLUDE_OTHER_CARDS,
default=options.get(CONF_INCLUDE_OTHER_CARDS, DEFAULT_INCLUDE_OTHER_CARDS),
): bool,
vol.Optional(
CONF_COMMUNITY_CARDS_ENABLED,
default=options.get(
CONF_COMMUNITY_CARDS_ENABLED, DEFAULT_COMMUNITY_CARDS_ENABLED
),
): bool,
}
class UlmFlowHandler(ConfigFlow, domain=DOMAIN):
"""Config flow for UI Lovelace Minimalist."""
VERSION = 1
def __init__(self) -> None:
"""Initialize."""
self._errors = {}
self.device: GitHubDeviceAPI | None = None
self.activation: GitHubLoginOauthModel | None = None
self.log = _LOGGER
self._progress_task = None
self._login_device: GitHubLoginDeviceModel | None = None
self._reauth = False
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a flow initialized by the user."""
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
if self.hass.data.get(DOMAIN):
return self.async_abort(reason="single_instance_allowed")
if user_input is not None:
if user_input["community_cards_enabled"]:
return await self.async_step_device(user_input)
return self.async_create_entry(title="", data=user_input)
# Initial form
return await self._show_config_form(user_input)
async def async_step_device(
self, _user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle device steps."""
async def _wait_for_activation(_=None) -> None:
if (
self._login_device is None
or self._login_device.expires_in is None
or self._login_device.device_code is None
):
async_call_later(self.hass, 1, _wait_for_activation)
return
response = await self.device.activation(
device_code=self._login_device.device_code
)
self.activation = response.data
self.hass.async_create_task(
self.hass.config_entries.flow.async_configure(flow_id=self.flow_id)
)
if not self.activation:
integration = await async_get_integration(self.hass, DOMAIN)
if not self.device:
self.device = GitHubDeviceAPI(
client_id=CLIENT_ID,
session=aiohttp_client.async_get_clientsession(self.hass),
**cast(
"dict[GitHubClientKwarg, Any]",
{"client_name": f"ULM/{integration.version}"},
),
)
async_call_later(self.hass, 1, _wait_for_activation)
try:
response = await self.device.register()
self._login_device = response.data
return self.async_show_progress(
step_id="device",
progress_action="wait_for_device",
description_placeholders={
"url": OAUTH_USER_LOGIN,
"code": cast("str", self._login_device.user_code),
},
)
except GitHubException:
self.log.exception("GitHub device registration not successful")
return self.async_abort(reason="github")
return self.async_show_progress_done(next_step_id="device_done")
async def _show_config_form(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Show the configuration form to edit options."""
if not user_input:
user_input = {}
# Emtpy schema on startup.
schema = {
vol.Optional(
CONF_COMMUNITY_CARDS_ENABLED,
default=user_input.get(
CONF_COMMUNITY_CARDS_ENABLED, DEFAULT_COMMUNITY_CARDS_ENABLED
),
): bool,
}
return self.async_show_form(
step_id="user", data_schema=vol.Schema(schema), errors=self._errors
)
async def async_step_device_done(
self, _user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle device steps."""
if self._reauth:
existing_entry = self.hass.config_entries.async_get_entry(
self.context["entry_id"]
)
self.hass.config_entries.async_update_entry(
existing_entry, data={"token": self.activation.access_token}
)
return self.async_abort(reason="reauth_successful")
return self.async_create_entry(
title=NAME, data={"token": self.activation.access_token}
)
async def async_step_reauth(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Perform reauth upon an API authentication error."""
return await self.async_step_reauth_confirm()
async def async_step_reauth_confirm(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Dialog that informs the user that reauth is required."""
if user_input is None:
return self.async_show_form(
step_id="reauth_confirm",
data_schema=vol.Schema({}),
)
self._reauth = True
return await self.async_step_device(None)
@staticmethod
@callback
def async_get_options_flow(config_entry):
"""ULM config flow options hanlder."""
return UlmOptionFlowHandler(config_entry)
class UlmOptionFlowHandler(OptionsFlow):
"""ULM config flow option handler (Edit Flow)."""
def __init__(self, config_entry: ConfigEntry) -> None:
"""Initialize."""
self.options = dict(config_entry.options)
# See: https://github.com/home-assistant/core/pull/129562
if AwesomeVersion(HAVERSION) < HA_OPTIONS_FLOW_VERSION_THRESHOLD:
self.config_entry = config_entry
async def async_step_init(
self, _user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Manage the options."""
return await self.async_step_user()
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a flow initilized by the user."""
ulm: UlmBase = self.hass.data.get(DOMAIN)
errors: dict[str, str] = {}
if user_input is not None:
if user_input.get(CONF_COMMUNITY_CARDS):
for card in user_input[CONF_COMMUNITY_CARDS]:
if card not in ulm.configuration.all_community_cards:
user_input[CONF_COMMUNITY_CARDS].remove(card)
return self.async_create_entry(title=NAME, data=user_input)
if ulm is None or ulm.configuration is None:
return self.async_abort(reason="not_setup")
if ulm.configuration.config_type == ConfigurationType.YAML:
schema = {vol.Optional("not_in_use", default=""): str}
else:
schema = await ulm_config_option_schema(ulm.configuration.to_dict())
if ulm.configuration.community_cards_enabled:
await ulm.fetch_cards()
schema |= {
vol.Optional(
CONF_COMMUNITY_CARDS,
default=list(
ulm.configuration.to_dict().get(
CONF_COMMUNITY_CARDS, DEFAULT_COMMUNITY_CARDS
)
),
): cv.multi_select(ulm.configuration.all_community_cards)
}
return self.async_show_form(
step_id="user", data_schema=vol.Schema(schema), errors=errors
)

View File

@@ -0,0 +1,128 @@
"""Constants for UI Lovelace Minimalist."""
from typing import TypeVar
# Base component constants
NAME = "UI Lovelace Minimalist"
DOMAIN = "ui_lovelace_minimalist"
DOMAIN_DATA = f"{DOMAIN}_data"
VERSION = "0.0.1"
CLIENT_ID = "c1603968d9d29a2492df"
TV = TypeVar("TV")
PACKAGE_NAME = "custom_components.ui_lovelace_minimlist"
ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/"
ISSUE_URL = "https://github.com/stokkie90/ui-lovelace-minimalist/issues"
GITHUB_REPO = "UI-Lovelace-Minimalist/UI"
COMMUNITY_CARDS_FOLDER = "custom_cards"
LANGUAGES = {
"Català": "ca",
"Czech": "cs",
"Danish": "da",
"German": "de",
"English (GB)": "en",
"Spanish": "es",
"French": "fr",
"Hebrew": "he",
"Italian": "it",
"한국어": "ko-KR",
"Dutch": "nl",
"Norwegian": "no",
"Polish": "pl",
"Portuguese": "pt",
"Portuguese (Brazil)": "pt-BR",
"Russian": "ru",
"Slovak": "sk",
"Slovenian": "sl",
"Swedish": "sv",
"Turkish": "tr",
"Ukrainian": "uk",
"中文(简体)": "zh-CN",
}
CONF_LANGUAGE = "language"
CONF_LANGUAGES = [
"Català",
"Czech",
"Danish",
"German",
"English (GB)",
"Spanish",
"French",
"Hebrew",
"Italian",
"한국어",
"Dutch",
"Norwegian",
"Polish",
"Portuguese",
"Portuguese (Brazil)",
"Russian",
"Slovak",
"Slovenian",
"Swedish",
"Turkish",
"Ukrainian",
"中文(简体)",
]
CONF_SIDEPANEL_ENABLED = "sidepanel_enabled"
CONF_SIDEPANEL_TITLE = "sidepanel_title"
CONF_SIDEPANEL_ICON = "sidepanel_icon"
CONF_SIDEPANEL_ADV_ENABLED = "adaptive_ui_enabled"
CONF_SIDEPANEL_ADV_TITLE = "adaptive_ui_title"
CONF_SIDEPANEL_ADV_ICON = "adaptive_ui_icon"
CONF_THEME = "theme"
CONF_THEME_PATH = "theme_path"
CONF_THEME_OPTIONS = [
"minimalist-mobile",
"minimalist-desktop",
"minimalist-mobile-tapbar",
"HA selected theme",
]
CONF_INCLUDE_OTHER_CARDS = "include_other_cards"
CONF_COMMUNITY_CARDS_ENABLED = "community_cards_enabled"
CONF_COMMUNITY_CARDS = "community_cards"
CONF_COMMUNITY_CARDS_ALL = [
"card-1",
"card-2",
"card-3",
"card-4",
"card-5",
"card-6",
"card-7",
"card-8",
"card-9",
"card-9",
"card-0",
"card-11",
"card-12",
]
# Defaults
DEFAULT_NAME = DOMAIN
DEFAULT_LANGUAGE = "English (GB)"
DEFAULT_SIDEPANEL_ENABLED = True
DEFAULT_SIDEPANEL_TITLE = NAME
DEFAULT_SIDEPANEL_ICON = "mdi:flower"
DEFAULT_SIDEPANEL_ADV_ENABLED = False
DEFAULT_SIDEPANEL_ADV_TITLE = NAME
DEFAULT_SIDEPANEL_ADV_ICON = "mdi:flower"
DEFAULT_THEME = "minimalist-desktop"
DEFAULT_THEME_PATH = "themes/"
DEFAULT_INCLUDE_OTHER_CARDS = False
DEFAULT_COMMUNITY_CARDS_ENABLED = False
DEFAULT_COMMUNITY_CARDS = []
STARTUP_MESSAGE = f"""
-------------------------------------------------------------------
{NAME}
Version: {VERSION}
This is a custom integration!
If you have any issues with this you need to open an issue here:
{ISSUE_URL}
-------------------------------------------------------------------
"""

View File

@@ -0,0 +1,19 @@
"""Helper constants."""
# pylint: disable=missing-class-docstring
from enum import Enum
class ConfigurationType(str, Enum):
"""What typ of config is used."""
YAML = "yaml"
CONFIG_ENTRY = "config_entry"
class UlmDisabledReason(str, Enum):
"""Reasons to disable ULM."""
RATE_LIMIT = "rate_limit"
INVALID_TOKEN = "invalid_token" # nosec B105
LOAD_ULM = "load_ulm"

View File

@@ -0,0 +1,40 @@
---
button_card_templates: !include_dir_merge_named "../../../custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/"
title: "UI Lovelace Minimalist"
theme: "minimalist-desktop"
background: "var(--background-image)"
views:
- type: "custom:grid-layout"
title: "home"
icon: "mdi:home"
path: "0"
layout:
grid-template-columns: "1fr 1fr"
grid-template-rows: "min-content"
grid-template-areas: |
"main popup"
mediaquery:
"(max-width: 1100px), (orientation: portrait)":
grid-template-columns: "100%"
grid-template-areas: "main"
cards:
- !include "views/main.yaml"
- !include "popup/popup.yaml"
- type: "custom:grid-layout"
title: "Livingroom"
icon: "mdi:sofa"
path: "Livingroom"
layout:
grid-template-columns: "1fr 1fr"
grid-template-rows: "min-content"
grid-template-areas: |
"livingroom popup"
mediaquery:
"(max-width: 1100px), (orientation: portrait)":
grid-template-columns: "100%"
grid-template-areas: "livingroom"
cards:
- !include "views/livingroom.yaml"
- !include "popup/popup.yaml"

View File

@@ -0,0 +1,149 @@
---
type: "custom:state-switch"
view_layout:
grid-area: "popup"
show:
# only show when screen-width is larger than 1100px
mediaquery: "(min-width: 1100px)"
# add your input_select
entity:
default: "default"
transition: "slide-down"
transition_time: 500
# options set in the input_select
states:
# Devices
## Lights
# light 1:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 2:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 3:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 4:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 5:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 6:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 7:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 8:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 9:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
# light 10:
# type: "custom:button-card"
# template: "popup_light_brightness"
# entity: <your_entity>
#
### Mediaplayers
# mediaplayer 1:
# type: "custom:button-card"
# template: "popup_media_player_infos"
# entity: <your_entity>
# mediaplayer 2:
# type: "custom:button-card"
# template: "popup_media_player_infos"
# entity: <your_entity>
# mediaplayer 3:
# type: "custom:button-card"
# template: "popup_media_player_infos"
# entity: <your_entity>
# mediaplayer 4:
# type: "custom:button-card"
# template: "popup_media_player_infos"
# entity: <your_entity>
# mediaplayer 5:
# type: "custom:button-card"
# template: "popup_media_player_infos"
# entity: <your_entity>
#
### Thermostats
# climate 1:
# type: "custom:button-card"
# template: "popup_thermostat_temperature"
# entity: <your_entity>
# climate 2:
# type: "custom:button-card"
# template: "popup_thermostat_temperature"
# entity: <your_entity>
# climate 3:
# type: "custom:button-card"
# template: "popup_thermostat_temperature"
# entity: <your_entity>
# climate 4:
# type: "custom:button-card"
# template: "popup_thermostat_temperature"
# entity: <your_entity>
# climate 5:
# type: "custom:button-card"
# template: "popup_thermostat_temperature"
# entity: <your_entity>
#
### Power
# power 1:
# type: "custom:button-card"
# template: "popup_power_outlet_stats"
# entity: <your_entity>
# variables:
# ulm_popup_power_outlet_sensor1:
# ulm_popup_power_outlet_sensor2:
# ulm_popup_power_outlet_graph_sensor:
# power 2:
# type: "custom:button-card"
# template: "popup_power_outlet_stats"
# entity: <your_entity>
# variables:
# ulm_popup_power_outlet_sensor1:
# ulm_popup_power_outlet_sensor2:
# ulm_popup_power_outlet_graph_sensor:
# power 3:
# type: "custom:button-card"
# template: "popup_power_outlet_stats"
# entity: <your_entity>
# variables:
# ulm_popup_power_outlet_sensor1:
# ulm_popup_power_outlet_sensor2:
# ulm_popup_power_outlet_graph_sensor:
# power 4:
# type: "custom:button-card"
# template: "popup_power_outlet_stats"
# entity: <your_entity>
# variables:
# ulm_popup_power_outlet_sensor1:
# ulm_popup_power_outlet_sensor2:
# ulm_popup_power_outlet_graph_sensor:
# power 5:
# type: "custom:button-card"
# template: "popup_power_outlet_stats"
# entity: <your_entity>
# variables:
# ulm_popup_power_outlet_sensor1:
# ulm_popup_power_outlet_sensor2:
# ulm_popup_power_outlet_graph_sensor:
## Rooms
livingroom: !include "../views/livingroom.yaml"
# bedroom: !include "../views/bedroom.yaml"
# bathroom: !include "../views/bathroom.yaml"
# garage: !include "../views/garage.yaml"
# lights: !include "../views/lights.yaml"

View File

@@ -0,0 +1,89 @@
---
type: "custom:layout-card"
layout_type: "custom:grid-layout"
layout:
grid-template-rows: "min-content"
grid-template-columns: "1fr 1fr 1fr"
grid-template-areas: >
"title1 title1 title1"
"card1 card1 card1"
"card2 card3 card4"
"card5 card6 ."
"card7 card8 card9"
"card10 card11 card12"
"card13 card14 card15"
"card16 card17 card18"
mediaquery:
# Mobile
"(max-width: 800px)":
grid-template-columns: "1fr 1fr"
grid-template-areas: |
"title1 title1"
"card1 card1"
"card2 card3"
"card4 card5"
"card6 card7"
"card8 card9"
"card10 card11"
"card12 card13"
"card14 card15"
"card16 card17"
"card18 card19"
view_layout:
grid-area: "livingroom"
cards:
- view_layout:
grid-area: "title1"
type: "custom:button-card"
template: "card_title"
name: "Some title"
label: "grid-area: title1"
- view_layout:
grid-area: "title2"
type: "custom:button-card"
template: "card_title"
name: "Some title"
label: "grid-area: title2"
- view_layout:
grid-area: "card1"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> first card"
label: "grid-area: card1"
- view_layout:
grid-area: "card2"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> second card"
label: "grid-area: card2"
- view_layout:
grid-area: "card3"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> third card"
label: "grid-area: card3"
- view_layout:
grid-area: "card4"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> fourth card"
label: "grid-area: card4"
- view_layout:
grid-area: "card5"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> fifth card"
label: "grid-area: card5"
- view_layout:
grid-area: "card6"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> sixth card"
label: "grid-area: card6"

View File

@@ -0,0 +1,105 @@
---
type: "custom:layout-card"
layout_type: "custom:grid-layout"
layout:
# Tablet portrait
grid-template-columns: "1fr 1fr 1fr 1fr 1fr 1fr"
grid-template-areas: |
"text text text weather weather weather"
"welcome welcome welcome welcome welcome welcome"
"title1 title1 title1 title1 title1 title1"
"card1 card1 card2 card2 card3 card3"
"title2 title2 title2 title2 title2 title2"
"card4 card4 card5 card5 card6 card6"
mediaquery:
# Mobile
"(max-width: 800px)":
grid-template-columns: "1fr 1fr"
grid-template-areas: |
"welcome welcome"
"person person"
"title1 title1"
"card1 card2"
"card3 card4"
"title2 title2"
"card5 card6"
"card7 card8"
view_layout:
grid-area: "main"
cards:
- view_layout:
grid-area: "text"
type: "custom:button-card"
template: "card_title"
name: "This is the adaptive <br>dashboard provided by <br> UI Minimalist"
label: "Find instructions to add <br> cards on the wiki"
- view_layout:
grid-area: "weather"
type: "custom:button-card"
template: "card_title"
name: "This could be your <br> weather card"
label: "grid-area: weather"
- view_layout:
grid-area: "welcome"
type: "custom:button-card"
template: "card_title"
name: "This could be your <br> welcome/scenes card"
label: "grid-area: welcome"
- view_layout:
grid-area: "title1"
type: "custom:button-card"
template: "card_title"
name: "Some title"
label: "grid-area: title1"
- view_layout:
grid-area: "title2"
type: "custom:button-card"
template: "card_title"
name: "Some title"
label: "grid-area: title2"
- view_layout:
grid-area: "card1"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> first card"
label: "grid-area: card1"
- view_layout:
grid-area: "card2"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> second card"
label: "grid-area: card2"
- view_layout:
grid-area: "card3"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> third card"
label: "grid-area: card3"
- view_layout:
grid-area: "card4"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> fourth card"
label: "grid-area: card4"
- view_layout:
grid-area: "card5"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> fifth card"
label: "grid-area: card5"
- view_layout:
grid-area: "card6"
type: "custom:button-card"
template: "card_title"
name: "Put here your <br> sixth card"
label: "grid-area: card6"

View File

@@ -0,0 +1,12 @@
---
ulm_custom_actions:
variables:
ulm_card_tap_action: "toggle"
ulm_card_hold_action: "popup"
ulm_card_double_tap_action: "adaptive"
ulm_icon_tap_action: "toggle"
ulm_icon_hold_action: "popup"
ulm_icon_double_tap_action: "adaptive"
ulm_name_tap_action: "toggle"
ulm_name_hold_action: "popup"
ulm_name_double_tap_action: "adaptive"

View File

@@ -0,0 +1,133 @@
---
minimalist-desktop:
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
ha-dialog-border-radius: "10px"
# fix added border-lines in 2022.11
ha-card-border-width: "0px"
card-mod-theme: "minimalist-desktop"
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
modes:
light:
# text
primary-text-color: "#212121"
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
# paper-tabs-selection-bar-color: "var(--primary-text-color)"
# slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "var(--google-red)"
sidebar-selected-icon-color: "var(--google-red)"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "var(--google-blue)"
# media player
mini-media-player-accent-color: "var(--google-blue)"
dark:
# text
primary-text-color: "#DDDDDD"
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

View File

@@ -0,0 +1,200 @@
---
minimalist-ios-tapbar:
# version 1.0.1
# By LRvdLinden
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
ha-dialog-border-radius: "10px"
# fix added border-lines in 2022.11
ha-card-border-width: "0px"
card-mod-theme: "minimalist-ios-tapbar"
header-height: "78px"
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
# Move navbar
card-mod-root-yaml: |
ha-tabs$: |
#tabsContent {
width: 97%;
}
paper-icon-button {
display: none;
}
.: |
@media (orientation: portrait) {
a.menu-link[target="_blank"], ha-button-menu, ha-menu-button, [main-title] {
display: none !important;
}
.header {
top: auto !important;
bottom: 0px !important;
box-shadow: var(--footer-shadow);
height: var(--header-height) !important;
}
.toolbar {
height: var(--header-height) !important;
padding: 10px 0px !important;
background: var( --ha-card-background, var(--card-background-color) );
}
#view {
transform: initial;
padding: 0 !important;
margin: 0 !important;
width: 100%;
padding-top: calc(-1 * var(--header-height)) !important;
padding-bottom: var(--header-height) !important;
}
ha-tabs {
--paper-tabs-selection-bar-color: var(--header-tab-indicator-color) !important;
--mdc-icon-size: 26px;
display: flex;
justify-content: space-between;
padding: 10px;
margin-top:15px;
height:var(--header-height) !important;
}
paper-tab[aria-selected=true] {
color: var(--header-active-tab-color);
background-color: var(--header-active-tab-bg-color);
}
paper-tab {
color: var(--header-all-tabs-color);
border-radius: 25px;
height:50px;
padding: 0 20px;
}
# Color themes
modes:
light:
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-blue))"
header-active-tab-bg-color: "rgba(var(--color-blue), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# text
primary-text-color: "#212121"
# slider
slider-color: "rgb(var(--google-blue))"
slider-bar-color: "rgba(var(--google-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "rgb(var(--color-blue))"
# media player
mini-media-player-accent-color: "rgb(var(--color-blue))"
dark:
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-amber: "255, 145, 1"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-amber))"
header-active-tab-bg-color: "rgba(var(--color-amber), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# text
primary-text-color: "#DDDDDD"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-amber))"
sidebar-selected-icon-color: "rgb(var(--color-amber))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

View File

@@ -0,0 +1,196 @@
---
minimalist-mobile-tapbar:
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
card-mod-theme: "minimalist-mobile-tapbar"
header-height: "calc(var(--header-base-height) + env(safe-area-inset-bottom))"
header-base-height: "70px"
app-header-selection-bar-color: "transparent"
ha-dialog-border-radius: "10px"
# fix added border-lines in 2022.11
ha-card-border-width: "0px"
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
# Move navbar
card-mod-root-yaml: |
ha-tabs$: |
#tabsContent {
width: 97%;
}
.: |
.header {
top: auto !important;
bottom: 0px !important;
box-shadow: var(--footer-shadow);
height: var(--header-height) !important;
}
.toolbar {
height: var(--header-base-height) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
#view {
transform: initial;
padding: 0 !important;
margin: 0 !important;
width: 100%;
padding-top: calc(-1 * var(--header-height)) !important;
padding-bottom: var(--header-height) !important;
}
ha-tabs {
--paper-tabs-selection-bar-color: var(--header-tab-indicator-color);
--mdc-icon-size: 26px;
display: flex;
justify-content: space-between;
padding: 0 10px;
height:50px !important;
}
paper-tab[aria-selected=true] {
color: var(--header-active-tab-color);
background-color: var(--header-active-tab-bg-color);
}
paper-tab {
color: var(--header-all-tabs-color);
border-radius: 25px;
height:50px;
/*width: calc(100% / 4);
padding: 0;*/
padding-left: 20px;
padding-right: 20px;
}
# Color themes
modes:
light:
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-blue))"
header-active-tab-bg-color: "rgba(var(--color-blue), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var( --ha-card-background, var(--card-background-color, white) )"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# text
primary-text-color: "#212121"
# slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "rgb(var(--color-blue))"
# media player
mini-media-player-accent-color: "rgb(var(--color-blue))"
dark:
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-amber: "255, 145, 1"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-amber))"
header-active-tab-bg-color: "rgba(var(--color-amber), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var( --ha-card-background, var(--card-background-color, rgb(29, 29, 29)) )"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# text
primary-text-color: "#DDDDDD"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-amber))"
sidebar-selected-icon-color: "rgb(var(--color-amber))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

View File

@@ -0,0 +1,140 @@
---
minimalist-mobile:
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
ha-dialog-border-radius: "10px"
# fix added border-lines in 2022.11
ha-card-border-width: "0px"
card-mod-theme: "minimalist-mobile"
card-mod-root: |
.header {
display: none;
}
#view {
padding: 0 !important;
height: 100vh !important;
}
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
modes:
light:
# text
primary-text-color: "#212121"
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
# paper-tabs-selection-bar-color: "var(--primary-text-color)"
# slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "var(--google-red)"
sidebar-selected-icon-color: "var(--google-red)"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "var(--google-blue)"
# media player
mini-media-player-accent-color: "var(--google-blue)"
dark:
# text
primary-text-color: "#DDDDDD"
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "¥"
ulm_updates_available: "有更新!"
ulm_no_updates_available: "无更新"
ulm_morning: "早上好"
ulm_afternoon: "下午好"
ulm_evening: "晚上好"
ulm_hello: "你好"
ulm_volume: "体积"
ulm_popups_color: "顏色"
ulm_radar: "雷达"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "Kč"
ulm_updates_available: "Aktualizace k dispozici!"
ulm_no_updates_available: "Nejsou k dispozici žádné aktualizace"
ulm_morning: "Dobré ráno"
ulm_afternoon: "Dobré odpoledne"
ulm_evening: "Dobrý večer"
ulm_hello: "Ahoj"
ulm_volume: "Hlasitost"
ulm_popups_color: "Barva"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "kr"
ulm_updates_available: "Opdatering tilgængelig"
ulm_no_updates_available: "Ingen opdateringer"
ulm_ophaling: "Affalds afhentning!"
ulm_geen_ophaling: "Ingen afhentninger"
ulm_volgende_ophaling: "Næste afhentning"
ulm_morning: "God morgen"
ulm_afternoon: "God eftermiddag"
ulm_evening: "God aften"
ulm_hello: "Hej"
ulm_volume: "Volumen"
ulm_popups_color: "Farve"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "Updates verfügbar!"
ulm_no_updates_available: "Keine Updates verfügbar"
ulm_morning: "Guten Morgen"
ulm_afternoon: "Guten Tag"
ulm_evening: "Guten Abend"
ulm_hello: "Hallo"
ulm_volume: "Lautstärke"
ulm_popups_color: "Farbe"
ulm_radar: "Radar"
ulm_popup_total: "Gesamt"

View File

@@ -0,0 +1,258 @@
---
ulm_translation_engine:
variables:
ulm_translation_back: "[[[ return hass.resources[hass['language']]['ui.common.back']; ]]]"
ulm_translation_brightness: "[[[ return hass.resources[hass['language']]['ui.card.light.brightness']; ]]]"
ulm_translation_color_temperature: "[[[ return hass.resources[hass['language']]['ui.card.light.color_temperature']; ]]]"
ulm_translation_status: "[[[ return hass.resources[hass['language']]['ui.dialogs.more_info_control.vacuum.status']; ]]]"
ulm_translation_scenes: "[[[ return hass.resources[hass['language']]['ui.dialogs.quick-bar.commands.reload.scene']; ]]]"
ulm_translation_source: "[[[ return hass.resources[hass['language']]['ui.card.media_player.source']; ]]]"
ulm_translation_history: "[[[ return hass.resources[hass['language']]['ui.dialogs.more_info_control.history']; ]]]"
ulm_translation_close_cover: "[[[ return hass.resources[hass['language']]['ui.dialogs.more_info_control.cover.close_cover']; ]]]"
ulm_translation_stop_cover: "[[[ return hass.resources[hass['language']]['ui.dialogs.more_info_control.cover.stop_cover']; ]]]"
ulm_translation_open_cover: "[[[ return hass.resources[hass['language']]['ui.dialogs.more_info_control.cover.open_cover']; ]]]"
ulm_translation_more_options: "[[[ return hass.resources[hass['language']]['ui.panel.lovelace.editor.edit_card.options']; ]]]"
ulm_active_state: >
[[[
if (typeof(entity) !== 'undefined' && entity !== undefined){
let not_active = ['disarmed','off','closed','not_home','standby','idle','docked','unknown','unavailable','paused']
function containsNumbers(str) {
return /\d/.test(str);
}
return (!not_active.includes(entity.state) && !containsNumbers(entity.state))
}
]]]
ulm_translation_off: "[[[ return hass.resources[hass['language']]['state.default.off']; ]]]"
ulm_translation_on: "[[[ return hass.resources[hass['language']]['state.default.on']; ]]]"
ulm_translation_state: >
[[[
if (typeof(entity) !== 'undefined' && entity !== undefined){
let device_class = entity.attributes.device_class;
let lang = hass["language"];
let action = entity.attributes.hvac_action;
let domain = entity.entity_id.substr(0, entity.entity_id.indexOf("."));
let mode = hass.resources[lang]["state_attributes." + domain + ".hvac_action." + action];
if(variables.ulm_show_last_changed){
let dt = new Intl.RelativeTimeFormat(lang, { style: "long" });
let delta = (Date.parse(entity.last_changed) - Date.now()) / 1000
let days = 0
if (delta > 1000)
days = parseInt(delta / (60 * 60 * 24));
let hours = parseInt(Math.round(delta / (60 * 60)) % 24);
let hours_unrounded = parseInt((delta / (60 * 60)) % 24);
let minutes = parseInt(Math.round(delta / 60) % 60);
let minutes_unrounded = parseInt((delta / 60) % 60);
let seconds = parseInt(Math.round(delta) % 60);
if (days != 0)
return dt.format(days,"days");
else if (hours_unrounded != 0)
return dt.format(hours,"hours");
else if (minutes_unrounded != 0)
return dt.format(minutes,"minutes");
return dt.format(seconds,"seconds");
}
if(device_class == ('timestamp' || 'date')){
let dt = new Intl.DateTimeFormat(lang, {
dateStyle: "long",
timeStyle: "short"
});
let formatted_date = dt.format(Date.parse(entity.state))
return formatted_date;
}
if(entity.entity_id.startsWith("climate.")){
return helpers.localize(entity, entity.attributes.current_temperature) + ' • ' +
helpers.localize(entity) + ((entity.state !='off' && mode !== undefined) ? ' (' + mode + ')' : '');
}
return helpers.localize(entity)
}
]]]
ulm_translation_state_reverse: >
[[[
if (typeof(entity) !== 'undefined' && entity !== undefined){
let state = entity.state;
let def = ["unknown", "unavailable"];
let lang = hass["language"];
if (state === "on"){
var translation = hass.resources[lang]["state.default.off"];
} else if (state === "off"){
var translation = hass.resources[lang]["state.default.on"];
}
if (def.includes(state)) {
var translation = hass.resources[lang]["state.default." + state ];
}
return translation ? translation : state;
}
]]]
ulm_translation_statistics: "[[[ return hass.resources[hass['language']]['ui.components.statistic-picker.statistic']; ]]]"
ulm_translation_unavailable: "[[[ return hass.resources[hass['language']]['state.default.unavailable']; ]]]"
ulm_translation_currency: >
[[[
var hasscurrency = hass.config["currency"];
var currency =
{ "AFA": "؋",
"ALL": "Lek",
"DZD": "دج",
"AOA": "Kz",
"ARS": "$",
"AMD": "֏",
"AWG": "ƒ",
"AUD": "$",
"AZN": "m",
"BSD": "B$",
"BHD": ".د.ب",
"BDT": "৳",
"BBD": "Bds$",
"BYR": "Br",
"BEF": "fr",
"BZD": "$",
"BMD": "$",
"BTN": "Nu.",
"BTC": "฿",
"BOB": "Bs.",
"BAM": "KM",
"BWP": "P",
"BRL": "R$",
"GBP": "£",
"BND": "B$",
"BGN": "Лв.",
"BIF": "FBu",
"KHR": "KHR",
"CAD": "$",
"CVE": "$",
"KYD": "$",
"XOF": "CFA",
"XAF": "FCFA",
"XPF": "₣",
"CLP": "$",
"CNY": "¥",
"COP": "$",
"KMF": "CF",
"CDF": "FC",
"CRC": "₡",
"HRK": "kn",
"CUC": "$, CUC",
"CZK": "Kč",
"DKK": "Kr.",
"DJF": "Fdj",
"DOP": "$",
"XCD": "$",
"EGP": "ج.م",
"ERN": "Nfk",
"EEK": "kr",
"ETB": "Nkf",
"EUR": "€",
"FKP": "£",
"FJD": "FJ$",
"GMD": "D",
"GEL": "ლ",
"DEM": "DM",
"GHS": "GH₵",
"GIP": "£",
"GRD": "₯, Δρχ, Δρ",
"GTQ": "Q",
"GNF": "FG",
"GYD": "$",
"HTG": "G",
"HNL": "L",
"HKD": "$",
"HUF": "Ft",
"ISK": "kr",
"INR": "₹",
"IDR": "Rp",
"IRR": "﷼",
"IQD": "د.ع",
"ILS": "₪",
"ITL": "L,£",
"JMD": "J$",
"JPY": "¥",
"JOD": "ا.د",
"KZT": "лв",
"KES": "KSh",
"KWD": "ك.د",
"KGS": "лв",
"LAK": "₭",
"LVL": "Ls",
"LBP": "£",
"LSL": "L",
"LRD": "$",
"LYD": "د.ل",
"LTL": "Lt",
"MOP": "$",
"MKD": "ден",
"MGA": "Ar",
"MWK": "MK",
"MYR": "RM",
"MVR": "Rf",
"MRO": "MRU",
"MUR": "₨",
"MXN": "$",
"MDL": "L",
"MNT": "₮",
"MAD": "MAD",
"MZM": "MT",
"MMK": "K",
"NAD": "$",
"NPR": "₨",
"ANG": "ƒ",
"TWD": "$",
"NZD": "$",
"NIO": "C$",
"NGN": "₦",
"KPW": "₩",
"NOK": "kr",
"OMR": ".ع.ر",
"PKR": "₨",
"PAB": "B/.",
"PGK": "K",
"PYG": "₲",
"PEN": "S/.",
"PHP": "₱",
"PLN": "zł",
"QAR": "ق.ر",
"RON": "lei",
"RUB": "₽",
"RWF": "FRw",
"SVC": "₡",
"WST": "SAT",
"SAR": "﷼",
"RSD": "din",
"SCR": "SRe",
"SLL": "Le",
"SGD": "$",
"SKK": "Sk",
"SBD": "Si$",
"SOS": "Sh.so.",
"ZAR": "R",
"KRW": "₩",
"XDR": "SDR",
"LKR": "Rs",
"SHP": "£",
"SDG": ".س.ج",
"SRD": "$",
"SZL": "E",
"SEK": "kr",
"CHF": "CHf",
"SYP": "LS",
"STD": "Db",
"TJS": "SM",
"TZS": "TSh",
"THB": "฿",
"TOP": "$",
"TTD": "$",
"TND": "ت.د",
"TRY": "₺",
"TMT": "T",
"UGX": "USh",
"UAH": "₴",
"AED": "إ.د",
"UYU": "$",
"USD": "$",
"UZS": "лв",
"VUV": "VT",
"VEF": "Bs",
"VND": "₫",
"YER": "﷼",
"ZMK": "ZK"
}
return currency[hasscurrency];
]]]

View File

@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "$"
ulm_updates_available: "Updates available!"
ulm_no_updates_available: "No updates available"
ulm_ophaling: "Garbage collection!"
ulm_geen_ophaling: "No collections"
ulm_volgende_ophaling: "Next collections"
ulm_morning: "Good morning"
ulm_afternoon: "Good afternoon"
ulm_evening: "Good evening"
ulm_hello: "Hello"
ulm_volume: "Volume"
ulm_popups_color: "Color"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "¡Actualización disponible!"
ulm_no_updates_available: "No hay actualizaciones"
ulm_ophaling: "¡Recogida de basura!"
ulm_geen_ophaling: "Sin recogida"
ulm_volgende_ophaling: "Próxima recogida"
ulm_morning: "Buenos días"
ulm_afternoon: "Buenas tardes"
ulm_evening: "Buenas noches"
ulm_hello: "Hola"
ulm_volume: "Volumen"
ulm_popups_color: "Color"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "Päivityksiä saatavilla!"
ulm_no_updates_available: "Ei päivityksiä saatavilla"
ulm_morning: "Hyvää huomenta"
ulm_afternoon: "Hyvää päivää"
ulm_evening: "Hyvää iltaa"
ulm_hello: "Hei"
ulm_volume: "Äänenvoimakkuus"
ulm_popups_color: "Väri"
ulm_radar: "Tutka"
ulm_popup_total: "Yhteensä"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "Mises à jour disponibles!"
ulm_no_updates_available: "Pas de nouvelle mise à jour"
ulm_morning: "Bonjour"
ulm_afternoon: "Bon après-midi"
ulm_evening: "Bonsoir"
ulm_hello: "Bonjour"
ulm_volume: "Volume"
ulm_popups_color: "Couleur"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "₪"
ulm_updates_available: "יש עדכונים"
ulm_no_updates_available: "אין עדכונים"
ulm_ophaling: "יש איסוף אשפה!"
ulm_geen_ophaling: "אין איסוף אשפה"
ulm_volgende_ophaling: "איסופי אשפה קרובים"
ulm_morning: "בוקר טוב"
ulm_afternoon: "צהריים טובים"
ulm_evening: "ערב טוב"
ulm_hello: "שלום"
ulm_volume: "ווליום"
ulm_popups_color: "צבע"
ulm_radar: "רדאר"
ulm_popup_total: "סך הכל"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "Aggiornamento Disponibile!"
ulm_no_updates_available: "Non ci sono aggiornamenti"
ulm_morning: "Buongiorno"
ulm_afternoon: "Buon pomeriggio"
ulm_evening: "Buonasera"
ulm_hello: "Ciao"
ulm_volume: "Volume"
ulm_popups_color: "Colore"
ulm_radar: "Radar"
ulm_popup_total: "Totale"

View File

@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "₩"
ulm_updates_available: "업데이트 가능!"
ulm_no_updates_available: "사용 가능한 업데이트 없음"
ulm_ophaling: "쓰레기 수거일!"
ulm_geen_ophaling: "수거 일정 없음"
ulm_volgende_ophaling: "다음 수거 일정"
ulm_morning: "좋은 아침입니다"
ulm_afternoon: "안녕하세요, 좋은 오후입니다"
ulm_evening: "안녕하세요, 좋은 저녁 보내세요"
ulm_hello: "안녕하세요"
ulm_volume: "볼륨"
ulm_popups_color: "색상"
ulm_radar: "레이더"
ulm_popup_total: "총계"

View File

@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "Updates beschikbaar!"
ulm_no_updates_available: "Geen updates beschikbaar"
ulm_ophaling: "Huisvuilophaling!"
ulm_geen_ophaling: "Geen ophalingen"
ulm_volgende_ophaling: "Volgende ophalingen"
ulm_morning: "Goedemorgen"
ulm_afternoon: "Goedemiddag"
ulm_evening: "Goedenavond"
ulm_hello: "Hallo"
ulm_volume: "Volume"
ulm_popups_color: "Kleur"
ulm_radar: "Radar"
ulm_popup_total: "Totaal"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "NOK"
ulm_updates_available: "Updates available!"
ulm_no_updates_available: "No updates available"
ulm_morning: "God morgen"
ulm_afternoon: "God ettermiddag"
ulm_evening: "God kveld"
ulm_hello: "Hei"
ulm_volume: "Volume"
ulm_popups_color: "Farge"
ulm_radar: "Radar"
ulm_popup_total: "Totalt"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "PLN"
ulm_updates_available: "Aktualizacja jest dostępna!"
ulm_no_updates_available: "Brak dostępnych aktualizacji"
ulm_morning: "Dzień dobry"
ulm_afternoon: "Dzień dobry"
ulm_evening: "Dobry wieczór"
ulm_hello: "Witaj"
ulm_volume: "Objętość"
ulm_popups_color: "Kolor"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "R$"
ulm_updates_available: "Atualizações disponíveis!"
ulm_no_updates_available: "Sem atualizações disponíveis"
ulm_morning: "Bom dia"
ulm_afternoon: "Boa tarde"
ulm_evening: "Boa noite"
ulm_hello: "Olá"
ulm_volume: "Volume"
ulm_popups_color: "Cor"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "Updates available!"
ulm_no_updates_available: "No updates available"
ulm_morning: "Bom dia"
ulm_afternoon: "Boa tarde"
ulm_evening: "Boa noite"
ulm_hello: "Olá"
ulm_volume: "Volume"
ulm_popups_color: "Cor"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "RUB"
ulm_updates_available: "Доступны обновления!"
ulm_no_updates_available: "Нет доступных обновлений"
ulm_morning: "Доброе утро"
ulm_afternoon: "Добрый день"
ulm_evening: "Добрый вечер"
ulm_hello: "Здравствуйте"
ulm_volume: "Объем"
ulm_popups_color: "Цвет"
ulm_radar: "Pадар"
ulm_popup_total: "Всего"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "€"
ulm_updates_available: "Aktualizácia k dispozícii!"
ulm_no_updates_available: "Nie je k dispozícii žiadna aktualizácia"
ulm_morning: "Dobré ráno"
ulm_afternoon: "Dobrý deň"
ulm_evening: "Dobrý večer"
ulm_hello: "Ahoj"
ulm_volume: "Volume"
ulm_popups_color: "Farba"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "kr"
ulm_updates_available: "Uppdatering tillgänglig!"
ulm_no_updates_available: "Ingen uppdatering tillgänglig"
ulm_morning: "God morgon"
ulm_afternoon: "God eftermiddag"
ulm_evening: "God kväll"
ulm_hello: "Hej"
ulm_volume: "Volym"
ulm_popups_color: "Färg"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "TRY"
ulm_updates_available: "Güncellemeler var!"
ulm_no_updates_available: "Güncelleme yok"
ulm_morning: "Günaydın"
ulm_afternoon: "İyi günler"
ulm_evening: "İyi akşamlar"
ulm_hello: "Hello"
ulm_volume: "Cilt"
ulm_popups_color: "Renk"
ulm_radar: "Radar"
ulm_popup_total: "Total"

View File

@@ -0,0 +1,14 @@
---
ulm_language_variables:
variables:
ulm_currency: "UAH"
ulm_updates_available: "Доступні оновлення!"
ulm_no_updates_available: "Немає доступних оновлень"
ulm_morning: "Доброго ранку"
ulm_afternoon: "Добрий день"
ulm_evening: "Добрий вечір"
ulm_hello: "Привіт"
ulm_volume: "Гучність"
ulm_popups_color: "Колір"
ulm_radar: "Радар"
ulm_popup_total: "Усього"

View File

@@ -0,0 +1,17 @@
---
ulm_language_variables:
variables:
ulm_currency: "$"
ulm_updates_available: "更新可用!"
ulm_no_updates_available: "无可用更新"
ulm_ophaling: "垃圾收集!"
ulm_geen_ophaling: "从未收集"
ulm_volgende_ophaling: "下一次收集"
ulm_morning: "早上好"
ulm_afternoon: "下午好"
ulm_evening: "晚上好"
ulm_hello: "你好"
ulm_volume: "音量"
ulm_popups_color: "颜色"
ulm_radar: "雷达"
ulm_popup_total: "总计"

View File

@@ -0,0 +1,118 @@
---
button_card_templates: !include_dir_merge_named "../../custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/"
title: "UI Lovelace Minimalist"
theme: "minimalist-desktop"
background: "var(--background-image)"
# views: !include_dir_merge_list "views/"
views:
- title: "Example View"
path: 0
icon: "mdi:flower"
cards:
- type: "vertical-stack"
cards:
- type: "custom:button-card"
template: "card_title"
name: "Congrats with your installation 🎉"
label: "Explore some of the wonderful 'Minimalistic-UI' cards we offer here"
- type: "custom:auto-entities"
card:
type: "grid"
columns: 1
square: false
card_param: "cards"
sort:
count: 1
filter:
include:
- domain: "weather"
options:
type: "custom:button-card"
template: "card_welcome_scenes"
variables:
ulm_weather: "this.entity_id"
- type: "custom:button-card"
template: "card_title"
name: "[[[ hass.resources[hass['language']]['ui.panel.lovelace.editor.card.light.name'] ]]]"
label: "This is the Minimalist-light-card"
- type: "custom:auto-entities"
card:
type: "grid"
columns: 2
square: false
card_param: "cards"
sort:
count: 4
filter:
include:
- domain: "light"
options:
type: "custom:button-card"
template: "card_light"
variables:
ulm_card_light_enable_slider: true
ulm_card_light_enable_color: true
ulm_card_light_enable_popup: true
- type: "custom:button-card"
template: "card_title"
name: "Binary Sensors"
label: "This is the Minimalist-binary_sensor-card"
- type: "custom:auto-entities"
card:
type: "grid"
columns: 2
square: false
card_param: "cards"
sort:
count: 4
filter:
include:
- domain: "binary_sensor"
options:
type: "custom:button-card"
template: "card_binary_sensor_alert"
variables:
- ulm_card_binary_sensor_alert: true
- type: "custom:button-card"
template: "card_title"
name: "[[[ hass.resources[hass['language']]['ui.panel.lovelace.editor.card.sensor.name'] ]]]"
label: "This is the Minimalist-sensor-card"
- type: "custom:auto-entities"
card:
type: "grid"
columns: 2
square: false
card_param: "cards"
sort:
count: 4
filter:
include:
- domain: "sensor"
options:
type: "custom:button-card"
template: "card_generic"
- type: "custom:button-card"
template: "card_title"
name: "[[[ hass.resources[hass['language']]['ui.dialogs.entity_registry.editor.device_classes.binary_sensor.battery'] ]]]"
label: "This is the Minimalist-battery-card"
- type: "custom:auto-entities"
card:
type: "grid"
columns: 2
square: false
card_param: "cards"
sort:
count: 4
filter:
include:
- attributes:
unit_of_measurement: "%"
device_class: "battery"
options:
type: "custom:button-card"
template: "card_battery"
variables:
ulm_card_battery_battery_state_entity_id: "this.entity_id"
ulm_card_battery_battery_level_danger: 30
ulm_card_battery_battery_level_warning: 80

View File

@@ -0,0 +1,342 @@
---
### Actions card ###
ulm_actions_card:
tap_action:
action: >
[[[
var action = variables.ulm_card_tap_action != null ? variables.ulm_card_tap_action : 'toggle';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_card_tap_action == 'navigate' ? variables.ulm_card_tap_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_card_tap_haptic != null ? variables.ulm_card_tap_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_card_tap_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_card_tap_service !== undefined)
return variables.ulm_card_tap_service;
else if ((entity != null) && entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_card_tap_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_card_tap_target !== undefined)
return variables.ulm_card_tap_target;
else if ((entity != null) && entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_card_tap_action == 'adaptive')
return {'option': variables.ulm_input_select_option };
else if (variables.ulm_card_tap_service_data !== undefined)
return variables.ulm_card_tap_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]
hold_action:
action: >
[[[
var action = variables.ulm_card_hold_action != null ? variables.ulm_card_hold_action : 'more-info';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_card_hold_action == 'navigate' ? variables.ulm_card_hold_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_card_hold_haptic != null ? variables.ulm_card_hold_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_card_hold_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_card_hold_service !== undefined)
return variables.ulm_card_hold_service;
else if ((entity != null) && entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_card_hold_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_card_hold_target !== undefined)
return variables.ulm_card_hold_target;
else if ((entity != null) && entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_card_hold_action == 'adaptive')
return { 'option': variables.ulm_input_select_option };
else if (variables.ulm_card_hold_service_data !== undefined)
return variables.ulm_card_hold_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]
double_tap_action:
action: >
[[[
var action = variables.ulm_card_double_tap_action != null ? variables.ulm_card_double_tap_action : "adaptive";
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_card_double_tap_action == 'navigate' ? variables.ulm_card_double_tap_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_card_double_tap_haptic != null ? variables.ulm_card_double_tap_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_card_double_tap_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_card_double_tap_service !== undefined)
return variables.ulm_card_double_tap_service;
else if ((entity != null) && entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_card_double_tap_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_card_double_tap_target !== undefined)
return variables.ulm_card_double_tap_target;
else if ((entity != null) && entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_card_double_tap_action == 'adaptive')
return { 'option': variables.ulm_input_select_option };
else if (variables.ulm_card_double_tap_service_data !== undefined)
return variables.ulm_card_double_tap_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]

View File

@@ -0,0 +1,46 @@
---
### Overlay to enable custom actions card over other cards ###
ulm_actions_card_overlay:
template:
- "ulm_custom_actions"
- "ulm_actions_card"
styles:
grid:
- position: "relative"
- z-index: 0
custom_fields:
actions_card_overlay:
- position: "absolute"
- left: "0px"
- top: "0px"
- height: "100%"
- width: "100%"
- display: "grid"
- z-index: 10
custom_fields:
actions_card_overlay:
card:
type: "custom:button-card"
template:
- "ulm_actions_card"
entity: "[[[ return (entity != null) ? entity.entity_id : null; ]]]"
show_icon: false
show_name: false
show_label: false
styles:
card:
- height: "100%"
- background: "none"
variables:
ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
ulm_card_tap_action: "[[[ return variables.ulm_card_tap_action; ]]]"
ulm_card_tap_haptic: "[[[ return variables.ulm_card_tap_haptic; ]]]"
ulm_card_tap_navigate_path: "[[[ return variables.ulm_card_tap_navigate_path; ]]]"
ulm_card_hold_action: "[[[ return variables.ulm_card_hold_action; ]]]"
ulm_card_hold_haptic: "[[[ return variables.ulm_card_hold_haptic; ]]]"
ulm_card_hold_navigate_path: "[[[ return variables.ulm_card_hold_navigate_path; ]]]"
ulm_card_double_tap_action: "[[[ return variables.ulm_card_double_tap_action; ]]]"
ulm_card_double_tap_haptic: "[[[ return variables.ulm_card_double_tap_haptic; ]]]"
ulm_card_double_tap_navigate_path: "[[[ return variables.ulm_card_double_tap_navigate_path; ]]]"
ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]"

View File

@@ -0,0 +1,345 @@
---
### Actions icon ###
ulm_actions_icon:
tap_action:
action: >
[[[
var action = variables.ulm_icon_tap_action != null ? variables.ulm_icon_tap_action : 'toggle';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_icon_tap_action == 'navigate' ? variables.ulm_icon_tap_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_icon_tap_haptic != null ? variables.ulm_icon_tap_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_icon_tap_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_icon_tap_service !== undefined)
return variables.ulm_icon_tap_service;
else if (entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_icon_tap_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_icon_tap_target !== undefined)
return variables.ulm_icon_tap_target;
else if (entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_icon_tap_action == 'adaptive')
return { 'option': variables.ulm_input_select_option };
else if (variables.ulm_icon_tap_service_data !== undefined)
return variables.ulm_icon_tap_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]
hold_action:
action: >
[[[
var action = variables.ulm_icon_hold_action != null ? variables.ulm_icon_hold_action : 'more_info';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_icon_hold_action == 'navigate' ? variables.ulm_icon_hold_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_icon_hold_haptic != null ? variables.ulm_icon_hold_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_icon_hold_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_icon_hold_service !== undefined)
return variables.ulm_icon_hold_service;
else if (entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_icon_hold_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_icon_hold_target !== undefined)
return variables.ulm_icon_hold_target;
else if (entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_icon_hold_action == 'adaptive')
return {'option': variables.ulm_input_select_option };
else if (variables.ulm_icon_hold_service_data !== undefined)
return variables.ulm_icon_hold_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]
double_tap_action:
action: >
[[[
var action = variables.ulm_icon_double_tap_action != null ? variables.ulm_icon_double_tap_action : 'adaptive';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup || variables.ulm_card_cover_enable_popup)){
action = 'fire-dom-event'
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_icon_double_tap_action == 'navigate' ? variables.ulm_icon_double_tap_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_icon_double_tap_haptic != null ? variables.ulm_icon_double_tap_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_icon_double_tap_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_icon_double_tap_service !== undefined)
return variables.ulm_icon_double_tap_service;
else if (entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_icon_double_tap_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_icon_double_tap_target !== undefined)
return variables.ulm_icon_double_tap_target;
else if (entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_icon_double_tap_action == 'adaptive')
return { 'option': variables.ulm_input_select_option };
else if (variables.ulm_icon_double_tap_service_data !== undefined)
return variables.ulm_icon_double_tap_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]

View File

@@ -0,0 +1,342 @@
---
### Actions name ###
ulm_actions_name:
tap_action:
action: >
[[[
var action = variables.ulm_name_tap_action != null ? variables.ulm_name_tap_action : 'toggle';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_name_tap_action == 'navigate' ? variables.ulm_name_tap_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_name_tap_haptic != null ? variables.ulm_name_tap_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_name_tap_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_name_tap_service !== undefined)
return variables.ulm_name_tap_service;
else if (entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_name_tap_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_name_tap_target !== undefined)
return variables.ulm_name_tap_target;
else if (entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_name_tap_action == 'adaptive')
return {'option': variables.ulm_input_select_option };
else if (variables.ulm_name_tap_service_data !== undefined)
return variables.ulm_name_tap_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]
hold_action:
action: >
[[[
var action = variables.ulm_name_hold_action != null ? variables.ulm_name_hold_action : 'more-info';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_name_hold_action == 'navigate' ? variables.ulm_name_hold_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_name_hold_haptic != null ? variables.ulm_name_hold_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_name_hold_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_name_hold_service !== undefined)
return variables.ulm_name_hold_service;
else if (entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_name_hold_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_name_hold_target !== undefined)
return variables.ulm_name_hold_target;
else if (entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_name_hold_action == 'adaptive')
return {'option': variables.ulm_input_select_option };
else if (variables.ulm_name_hold_service_data !== undefined)
return variables.ulm_name_hold_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]
double_tap_action:
action: >
[[[
var action = variables.ulm_name_double_tap_action != null ? variables.ulm_name_double_tap_action : 'adaptive';
let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : "";
if (domain == "binary_sensor" || domain == "sensor" || domain == ""){
if (action == 'toggle')
action = 'none';
}
if (action == 'adaptive' && !(variables.ulm_input_select_option) ){
action = 'popup'
}
if (action == 'adaptive'){
action = 'perform-action'
}
if (domain == "media_player" && action == 'toggle'){
action = 'perform-action';
}
if (action == 'popup' && (variables.ulm_custom_popup != null )){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config){
action = 'fire-dom-event';
}
}
if (action == 'popup'){
action = 'more-info'
}
return action;
]]]
navigation_path: "[[[ return variables.ulm_name_double_tap_action == 'navigate' ? variables.ulm_name_double_tap_navigate_path : '/0' ]]]"
haptic: "[[[ return variables.ulm_name_double_tap_haptic != null ? variables.ulm_name_double_tap_haptic : 'none' ]]]"
perform_action: >
[[[
if (variables.ulm_name_double_tap_action == 'adaptive')
return 'input_select.select_option';
else if (variables.ulm_name_double_tap_service !== undefined)
return variables.ulm_name_double_tap_service;
else if (entity.entity_id.startsWith("media_player."))
return 'media_player.media_play_pause';
return "";
]]]
target:
entity_id: >
[[[
if (variables.ulm_name_double_tap_action == 'adaptive')
return variables.ulm_input_select;
else if (variables.ulm_name_double_tap_target !== undefined)
return variables.ulm_name_double_tap_target;
else if (entity.entity_id.startsWith("media_player."))
return entity.entity_id;
return "";
]]]
data: >
[[[
if (variables.ulm_name_double_tap_action == 'adaptive')
return { 'option': variables.ulm_input_select_option };
else if (variables.ulm_name_double_tap_service_data !== undefined)
return variables.ulm_name_double_tap_service_data;
return "";
]]]
browser_mod:
service: "browser_mod.popup"
data:
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-min-width: 1000px;
size: >
[[[
const mediaQuery = window.matchMedia('(max-width: 800px)')
if (mediaQuery.matches) {
return 'fullscreen'
}
]]]
content:
type: "custom:button-card"
template: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'template' in popup_config) {
return popup_config.template;
}
}
]]]
entity: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'entity' in popup_config) {
return popup_config.entity;
}
}
return (entity != null) ? entity.entity_id : null;
]]]
variables: >
[[[
if (variables.ulm_custom_popup != null ){
let popup_config = variables.ulm_custom_popup;
if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) {
return popup_config.popup_variables;
}
}
return {};
]]]

View File

@@ -0,0 +1,91 @@
---
### Card Graph ###
card_graph:
template:
- "extended_card"
variables:
ulm_card_graph_color: "var(--info-color)"
ulm_card_graph_name: "[[[ return entity.attributes.friendly_name; ]]]"
ulm_card_graph_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_graph_color2: "var(--info-color)"
ulm_card_graph_entity2: ""
ulm_card_graph_hours: 24
ulm_card_graph_type: "fill"
ulm_card_graph_points: "0.5"
ulm_card_graph_group_by: "interval"
ulm_card_graph_line_width: 5
ulm_card_graph_icon_color: ""
triggers_update:
- "[[[ return variables.ulm_card_graph_entity2 ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
template:
- "card_generic"
variables:
ulm_card_generic_icon: "[[[ return variables.ulm_card_graph_icon; ]]]"
ulm_card_generic_name: "[[[ return variables.ulm_card_graph_name; ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_graph_icon_color;
if (variables.ulm_card_graph_icon_color){
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_graph_icon_color;
if (variables.ulm_card_graph_icon_color){
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:mini-graph-card"
entities: >
[[[
var ent = [];
ent.push(variables.ulm_card_graph_entity);
if(variables.ulm_card_graph_entity2 != "")
ent.push(variables.ulm_card_graph_entity2);
return ent;
]]]
line_color: >
[[[
var col = [];
col.push(variables.ulm_card_graph_color);
if(variables.ulm_card_graph_color2 != "")
col.push(variables.ulm_card_graph_color2);
return col;
]]]
show:
name: false
icon: false
legend: false
state: false
graph: "[[[ return variables.ulm_card_graph_type=='fill'?'line':variables.ulm_card_graph_type; ]]]"
fill: "[[[ return variables.ulm_card_graph_type=='fill'?true:false; ]]]"
hours_to_show: "[[[ return variables.ulm_card_graph_hours; ]]]"
points_per_hour: "[[[ return variables.ulm_card_graph_points; ]]]"
group_by: "[[[ return variables.ulm_card_graph_group_by; ]]]"
line_width: "[[[ return variables.ulm_card_graph_line_width; ]]]"
card_mod:
style: |
ha-card {
box-shadow: none;
border-radius: var(--border-radius);
}

View File

@@ -0,0 +1,166 @@
---
### Card Battery ###
card_battery:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_battery_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_battery_attribute:
ulm_card_battery_battery_state_entity_id:
ulm_card_battery_charger_type_entity_id:
ulm_card_battery_charging_animation: false
ulm_card_battery_battery_level_danger:
ulm_card_battery_battery_level_warning:
ulm_card_battery_color_battery_level_danger: "var(--google-red)"
ulm_card_battery_color_battery_level_warning: "var(--google-yellow)"
ulm_card_battery_color_battery_level_ok: "var(--google-green)"
ulm_outlet_power_enable_popup: false
triggers_update:
- "[[[ return variables?.ulm_card_battery_battery_state_entity_id ]]]"
- "[[[ return variables?.ulm_card_battery_charger_type_entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
icon: |
[[[
// Get battery level
const battery_level = variables.ulm_card_battery_attribute !== null ?
states[entity.entity_id].attributes[variables.ulm_card_battery_attribute] :
states[entity.entity_id].state;
// Generate icon infix
let infix = "";
if (variables.ulm_card_battery_charger_type_entity_id == null) {
// Check wether the battery state is charging
infix = variables.ulm_card_battery_battery_state_entity_id !== null &&
variables.ulm_card_battery_charging_animation === false &&
states[variables.ulm_card_battery_battery_state_entity_id].state.toLowerCase() === "charging" ?
"-charging" : ""
} else {
// Select the infix based on the entity charging state
switch (states[variables.ulm_card_battery_charger_type_entity_id].state.toLowerCase()) {
case "wireless":
infix = "-charging-wireless";
break;
case "charging":
infix = "-charging";
break;
case "ac":
infix = "-charging";
break;
case "usb":
infix = "-charging";
break;
default:
infix = "";
}
}
// Generate the icon based on the battery_level
let icon = "mdi:help-circle-outline";
if (battery_level == 100) {
icon = "mdi:battery";
} else if (battery_level < 10) {
icon = "mdi:battery" + infix + "-outline";
} else if (battery_level == "unknown" || battery_level == "unavailable") {
icon = "mdi:battery-off";
} else {
icon = "mdi:battery" + infix + "-" + Math.floor(battery_level / 10) * 10;
}
return icon;
]]]
extra_styles: |
@keyframes charge {
0%, 80% { clip-path: inset(0 0 0 0); }
10% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 66%, 34% 66%, 34% 100%, 100% 100%, 100% 0%); }
20% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 62%, 34% 62%, 34% 100%, 100% 100%, 100% 0%); }
30% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 58%, 34% 58%, 34% 100%, 100% 100%, 100% 0%); }
40% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 54%, 34% 54%, 34% 100%, 100% 100%, 100% 0%); }
50% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 50%, 34% 50%, 34% 100%, 100% 100%, 100% 0%); }
60% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 46%, 34% 46%, 34% 100%, 100% 100%, 100% 0%); }
70% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 40%, 34% 40%, 34% 100%, 100% 100%, 100% 0%); }
}
styles:
icon:
- color: |
[[[
const battery_level = variables.ulm_card_battery_attribute !== null ?
states[entity.entity_id].attributes[variables.ulm_card_battery_attribute] :
states[entity.entity_id].state;
// Get the color based on battery_level
let color = "rgba(var(--color-theme), 0.9)";
if (battery_level !== "unavailable" && (variables.ulm_card_battery_battery_level_danger !== null || variables.ulm_card_battery_battery_level_warning !== null)) {
if (battery_level <= variables.ulm_card_battery_battery_level_danger) {
color = variables.ulm_card_battery_color_battery_level_danger;
} else if (battery_level <= variables.ulm_card_battery_battery_level_warning) {
color = variables.ulm_card_battery_color_battery_level_warning;
} else if (battery_level == "unknown" || battery_level == "unavailable") {
color = variables.ulm_card_battery_color_battery_level_danger;
} else {
color = variables.ulm_card_battery_color_battery_level_ok;
}
}
return color;
]]]
- animation: |
[[[
if (variables.ulm_card_battery_battery_state_entity_id !== null &&
variables.ulm_card_battery_charging_animation === true &&
states[variables.ulm_card_battery_battery_state_entity_id].state.toLowerCase() === "charging"){
return "charge 3s linear infinite"
}
return "none"
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_battery_name ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
label: |
[[[
const battery_level = variables.ulm_card_battery_attribute !== null
? states[entity.entity_id].attributes[variables.ulm_card_battery_attribute]
: states[entity.entity_id].state;
return battery_level + "%";
if(battery_level == "unknown")
{ return variables.ulm_translation_state; }
else
{ return battery_level + "%"; }
]]]

View File

@@ -0,0 +1,112 @@
---
### Card Binary Sensor ###
card_binary_sensor:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
show_last_changed: false
variables:
ulm_card_binary_sensor_show_last_changed: false
ulm_card_binary_sensor_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_binary_sensor_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_outlet_power_enable_popup: false
ulm_card_binary_sensor_color: "blue"
ulm_card_binary_sensor_force_background_color: false
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_binary_sensor_force_background_color) {
var color = variables.ulm_card_binary_sensor_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_binary_sensor_icon; ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_binary_sensor_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_binary_sensor_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_binary_sensor_name; ]]]"
label: "[[[ return variables.ulm_translation_state;]]]"
show_last_changed: "[[[ return variables.ulm_card_binary_sensor_show_last_changed; ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_binary_sensor_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_binary_sensor_force_background_color) {
return 'rgb(250,250,250)';
}
]]]

View File

@@ -0,0 +1,113 @@
---
### Card Binary Sensor Alert ###
card_binary_sensor_alert:
template:
- "icon_more_info_alert"
- "ulm_translation_engine"
show_last_changed: false
variables:
ulm_card_binary_sensor_alert_show_last_changed: false
ulm_card_binary_sensor_alert_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_binary_sensor_alert_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_outlet_power_enable_popup: false
ulm_card_binary_sensor_alert_color: "blue"
ulm_card_binary_sensor_alert_force_background_color: false
ulm_icon_alert_color: "[[[ return variables.ulm_card_binary_sensor_alert_color ]]]"
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_binary_sensor_alert_force_background_color) {
var color = variables.ulm_card_binary_sensor_alert_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_binary_sensor_alert_icon; ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_binary_sensor_alert_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_binary_sensor_alert_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_binary_sensor_alert_name; ]]]"
label: "[[[ return variables.ulm_translation_state;]]]"
show_last_changed: "[[[ return variables.ulm_card_binary_sensor_alert_show_last_changed; ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_binary_sensor_alert_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_binary_sensor_alert_force_background_color) {
return 'rgb(250,250,250)';
}
]]]

View File

@@ -0,0 +1,808 @@
---
### Card Cover ###
card_cover:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_cover_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_cover_icon: false
ulm_card_cover_color: "blue"
ulm_card_invert_percent: false
ulm_card_cover_invert_percent: false
ulm_card_cover_display_left_right: false
ulm_card_cover_garage_large: false
ulm_card_cover_gate: false
ulm_card_cover_enable_controls: false
ulm_card_cover_favorite_percentage: null
ulm_card_cover_enable_slider: false
ulm_card_cover_slider_min: 0
ulm_card_cover_slider_max: 100
ulm_card_cover_enable_tilt: false
ulm_card_cover_enable_horizontal: false
ulm_card_cover_enable_popup: false
ulm_card_cover_show_last_changed: false
ulm_card_cover_force_background_color: false
show_icon: false
show_name: false
show_label: false
show_last_changed: false
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_cover_color) {
if (variables.ulm_card_cover_force_background_color) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
}
]]]
styles:
grid:
- grid-template-areas: >
[[[
if (variables.ulm_card_cover_enable_horizontal) {
var hor_area = ["item1"];
var ver_area = [];
if (variables.ulm_card_cover_enable_controls) {
if (variables.ulm_card_cover_enable_horizontal == "controls" || variables.ulm_card_cover_enable_horizontal == true) {
hor_area.push("item2");
} else {
ver_area.push("item2" + " " + "item2");
}
}
if (variables.ulm_card_cover_enable_slider) {
if (variables.ulm_card_cover_enable_horizontal == "slider") {
hor_area.push("item3");
} else {
ver_area.push("item3" + " " + "item3");
}
}
if (variables.ulm_card_cover_enable_tilt) {
if (variables.ulm_card_cover_enable_horizontal == "tilt") {
hor_area.push("item4");
} else {
ver_area.push("item4" + " " + "item4");
}
}
if (ver_area.length < 1) {
return "\"" + hor_area.join(" ") + "\" ";
} else {
return "\"" + hor_area.join(" ") + "\" " + "\"" + ver_area.join("\" \"") + "\"";
}
} else {
var areas = [];
areas.push("item1");
if (variables.ulm_card_cover_enable_controls) {
areas.push("item2");
}
if (variables.ulm_card_cover_enable_slider) {
areas.push("item3");
}
if (variables.ulm_card_cover_enable_tilt) {
areas.push("item4");
}
return "\"" + areas.join("\" \"") + "\"";
}
]]]
- grid-template-columns: >
[[[
if (variables.ulm_card_cover_enable_horizontal) {
return "1fr 1fr";
}
return "1fr";
]]]
- grid-template-rows: >
[[[
var rows = [];
rows.push("min-content");
if (variables.ulm_card_cover_enable_controls) {
rows.push("min-content");
}
if (variables.ulm_card_cover_enable_slider) {
rows.push("min-content");
}
if (variables.ulm_card_cover_enable_tilt) {
rows.push("min-content");
}
if (variables.ulm_card_cover_enable_horizontal) {
if (rows.length > 1) {
rows.pop()
}
}
return rows.join(" ");
]]]
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item2:
- display: >
[[[
if (variables.ulm_card_cover_enable_controls) {
return "block";
} else {
return "none";
}
]]]
item3:
- display: >
[[[
if (variables.ulm_card_cover_enable_slider) {
return "block";
} else {
return "none";
}
]]]
item4:
- display: >
[[[
if (variables.ulm_card_cover_enable_tilt) {
return "block";
} else {
return "none";
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if (variables.ulm_card_cover_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_cover'
};
}
return vars;
]]]
icon: >
[[[
var icon = entity.attributes.icon || "mdi:help-circle";
var icon_state = {
"open": "open",
"opening": "open",
"closed": "closed",
"closing": "closed"
};
if(entity.attributes?.device_class){
var device_class = entity.attributes?.device_class;
}
var icon_open = {
"awning": "mdi:window-open",
"blind": "mdi:blinds-open",
"curtain": "mdi:curtains",
"damper": "mdi:circle-outline",
"door": "mdi:door-open",
"garage": variables.ulm_card_cover_garage_large ? "mdi:garage-open-variant" : "mdi:garage-open",
"gate": "mdi:gate-open",
"shade": "mdi:roller-shade",
"shutter": "mdi:window-shutter-open",
"window": "mdi:window-open",
};
var icon_closed = {
"awning": "mdi:window-closed",
"blind": "mdi:blinds",
"curtain": "mdi:curtains-closed",
"damper": "mdi:circle-slice-8",
"door": "mdi:door-closed",
"garage": variables.ulm_card_cover_garage_large ? "mdi:garage-variant" : "mdi:garage",
"gate": "mdi:gate",
"shade": "mdi:roller-shade-closed",
"shutter": "mdi:window-shutter",
"window": "mdi:window-closed",
};
return variables.ulm_card_cover_icon || (icon_state[entity.state]=='open' ? icon_open[device_class] : icon_closed[device_class]) || icon
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_cover_color;
if (variables.ulm_card_invert_percent || variables.ulm_card_cover_invert_percent) {
if (entity.attributes.current_position == 100) {
return 'rgba(var(--color-theme),0.2)';
}
return 'rgba(var(--color-' + color + '),1)';
}
if (typeof entity !== "undefined") {
if (states[entity.entity_id].state != "closed") {
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
}
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_cover_color;
if (variables.ulm_card_invert_percent || variables.ulm_card_cover_invert_percent) {
if (entity.attributes.current_position == 100) {
return 'rgba(var(--color-theme),0.05)';
}
return 'rgba(var(--color-' + color + '),0.2)';
}
if (typeof entity !== "undefined") {
if (states[entity.entity_id].state != "closed") {
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
}
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_cover_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_cover'
};
}
return vars;
]]]
name: "[[[ return variables.ulm_card_cover_name ]]]"
label: >
[[[
var position = states[entity.entity_id]?.attributes?.current_position;
var invert = {
"closed": hass.resources[hass['language']]['component.cover.state._.open'],
"closing": hass.resources[hass['language']]['component.cover.state._.opening'],
"open": hass.resources[hass['language']]['component.cover.state._.closed'],
"opening": hass.resources[hass['language']]['component.cover.state._.closing']
};
if ((variables.ulm_card_invert_percent || variables.ulm_card_cover_invert_percent) && typeof entity !== "undefined") {
if (position == 0) {
return invert[entity.state] + " • " + (100 - position) + "%";
} else {
return invert[entity.state];
}
}
if(["unknown", "unavailable", "closed"].includes(entity.state) || position === undefined) {
return variables.ulm_translation_state;
}
if (typeof entity !== "undefined") {
if (entity == 0) {
return variables.ulm_translation_state;
} else {
return variables.ulm_translation_state + " • " + position + "%";
}
}
return variables.ulm_translation_state;
]]]
show_last_changed: "[[[ return variables.ulm_card_cover_show_last_changed; ]]]"
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
item2:
card:
type: "custom:button-card"
template: "[[[ return (variables.ulm_card_cover_favorite_percentage) ? 'list_4_items' : 'list_3_items' ]]]"
styles:
card:
- background: "none"
custom_fields:
item4:
- display: >
[[[
if (variables.ulm_card_cover_favorite_percentage) {
return "block";
} else {
return "none";
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_cover_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
state:
- operator: "template"
value: >
[[[
return entity.attributes.current_position == "0";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "closing";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "opening";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
tap_action:
action: "perform-action"
perform_action: "cover.close_cover"
target:
entity_id: "[[[ return entity.entity_id ]]]"
icon: >
[[[
if (variables.ulm_card_cover_display_left_right) {
return "mdi:arrow-left";
}
var device_class = entity.attributes?.device_class;
if (device_class == 'curtain' || device_class == 'gate' || device_class == 'awning') {
return "mdi:arrow-collapse-horizontal";
}
return "mdi:arrow-down";
]]]
item2:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_cover_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "cover.stop_cover"
target:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:stop"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_cover_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
state:
- operator: "template"
value: >
[[[
return entity.attributes.current_position == "100";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "closing";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "opening";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
tap_action:
action: "perform-action"
perform_action: "cover.open_cover"
target:
entity_id: "[[[ return entity.entity_id ]]]"
icon: >-
[[[
if (variables.ulm_card_cover_display_left_right) {
return "mdi:arrow-right";
}
var device_class = entity.attributes?.device_class;
if (device_class == 'curtain' || device_class == 'gate' || device_class == 'awning') {
return "mdi:arrow-expand-horizontal";
}
return "mdi:arrow-up";
]]]
item4:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_cover_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "cover.set_cover_position"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
position: "[[[ return variables.ulm_card_cover_favorite_percentage ]]]"
icon: "mdi:star"
item3:
card:
type: "custom:my-slider"
entity: "[[[ return entity.entity_id ]]]"
radius: "14px"
height: "42px"
minSet: "[[[ return variables.ulm_card_cover_slider_min ]]]"
maxSet: "[[[ return variables.ulm_card_cover_slider_max ]]]"
mainSliderColor: >
[[[
var color = variables.ulm_card_cover_color;
if (variables.ulm_card_invert_percent || variables.ulm_card_cover_invert_percent) {
if (entity.attributes.current_position == 100) {
return 'rgba(var(--color-theme),0.05)';
}
if (variables.ulm_card_cover_force_background_color) {
return 'rgb(250,250,250)';
}
return 'rgba(var(--color-' + color + '),0.8)';
}
if (typeof entity !== "undefined") {
if (states[entity.entity_id].state != "closed") {
if (variables.ulm_card_cover_force_background_color) {
return 'rgb(250,250,250)';
}
return 'rgba(var(--color-' + color + '),0.8)';
}
return 'rgba(var(--color-theme),0.05)';
}
]]]
secondarySliderColor: >
[[[
var color = variables.ulm_card_cover_color;
if (variables.ulm_card_invert_percent || variables.ulm_card_cover_invert_percent) {
if (entity.attributes.current_position == 100) {
return 'rgba(var(--color-theme),0.05)';
}
if (variables.ulm_card_cover_force_background_color) {
return 'rgba(var(--color-' + color + '),0.3)';
}
return 'rgba(var(--color-' + color + '),0.1)';
}
if (typeof entity !== "undefined") {
if (states[entity.entity_id].state != "closed") {
if (variables.ulm_card_cover_force_background_color) {
return 'rgba(var(--color-' + color + '),0.3)';
}
return 'rgba(var(--color-' + color + '),0.1)';
}
return 'rgba(var(--color-theme),0.05)';
}
]]]
mainSliderColorOff: "rgba(var(--color-theme),0.05)"
secondarySliderColorOff: "rgba(var(--color-theme),0.05)"
thumbHorizontalPadding: "0px"
thumbVerticalPadding: "0px"
thumbWidth: "0px"
card_mod:
style: |
ha-card {
border-radius: 14px;
box-shadow: none;
}
item4:
card:
type: "custom:button-card"
template: "list_3_items"
styles:
card:
- background: "none"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_cover_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
state:
- operator: "template"
value: >
[[[
return entity.attributes.current_tilt_position == "0";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "closing";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "opening";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
tap_action:
action: "perform-action"
perform_action: "cover.close_cover_tilt"
target:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:arrow-bottom-left"
item2:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_cover_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "cover.stop_cover_tilt"
target:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:stop"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_cover_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
if (variables.ulm_card_cover_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_cover_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
state:
- operator: "template"
value: >
[[[
return entity.attributes.current_tilt_position == "100";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "closing";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
- operator: "template"
value: >
[[[
return entity.state == "opening";
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.4)"
tap_action:
action: "perform-action"
perform_action: "cover.open_cover_tilt"
target:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:arrow-top-right"

View File

@@ -0,0 +1,318 @@
---
### Card Fan ###
card_fan:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_fan_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_fan_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_fan_enable_horizontal: false
ulm_card_fan_color: "blue"
ulm_card_fan_force_background_color: false
ulm_card_fan_enable_collapse: false
ulm_card_fan_enable_slider: false
ulm_card_fan_slider_min: 0
ulm_card_fan_slider_max: 100
ulm_card_fan_enable_button: false
ulm_card_fan_button_icon: "mdi:rotate-3d-variant"
ulm_card_fan_button_service: "fan.oscillate"
ulm_card_fan_oscillate_attribute: "oscillate"
ulm_card_fan_temp_attribute: false
ulm_card_fan_hum_attribute: false
show_icon: false
show_name: false
show_label: false
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_fan_color) {
if (variables.ulm_card_fan_force_background_color) {
var color = variables.ulm_card_fan_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
}
]]]
styles:
grid:
- grid-template-areas: >
[[[
if (variables.ulm_card_fan_enable_collapse && entity.state != "on") {
return "\"item1\"";
}
var areas = [];
areas.push("item1");
if (variables.ulm_card_fan_enable_slider) {
areas.push("item2");
}
if (variables.ulm_card_fan_enable_horizontal) {
return "\"" + areas.join(" ") + "\"";
}
return "\"" + areas.join("\" \"") + "\"";
]]]
- grid-template-columns: >
[[[
if (variables.ulm_card_fan_enable_collapse && entity.state != "on") {
return "1fr";
}
if (variables.ulm_card_fan_enable_horizontal) {
return "1fr 1fr";
}
return "1fr";
]]]
- grid-template-rows: >
[[[
if (variables.ulm_card_fan_enable_horizontal || (variables.ulm_card_fan_enable_collapse && entity.state != "on")) {
return "min-content";
}
var rows = [];
rows.push("min-content");
if (variables.ulm_card_fan_enable_slider) {
rows.push("min-content");
}
return rows.join(" ");
]]]
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item2:
- display: >
[[[
if (variables.ulm_card_fan_enable_collapse && entity.state != "on") {
return "none";
} else if (variables.ulm_card_fan_enable_slider) {
return "block";
} else {
return "none";
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_fan_icon ]]]"
styles:
icon:
- color: >
[[[
if (entity.state == "on") {
if (variables.ulm_card_fan_color) {
var color = variables.ulm_card_fan_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
if (entity.state == "on") {
if (variables.ulm_card_fan_color) {
var color = variables.ulm_card_fan_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_fan_name ]]]"
label: >
[[[
if (entity.state == 'unavailable') {
return variables.ulm_translation_unavailable;
}
let temp_str = '';
if (variables.ulm_card_fan_temp_attribute) {
var temp = Math.round(entity.attributes[variables.ulm_card_fan_temp_attribute]);
temp_str = ' • ' + (temp ? temp : '0') + '°C';
}
let hum_str = '';
if (variables.ulm_card_fan_hum_attribute) {
var hum = Math.round(entity.attributes[variables.ulm_card_fan_hum_attribute]);
hum_str = ' • ' + (hum ? hum : '0') + '%';
}
if (entity.state != 'off') {
if (entity.attributes.percentage != null) {
var per = entity.attributes.percentage;
let per_str = (per ? per : '0') + '%';
return per_str + temp_str + hum_str;
}
return variables.ulm_translation_on + temp_str + hum_str;
}
return variables.ulm_translation_off + temp_str + hum_str;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_fan_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_fan_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
item2:
card:
type: "custom:button-card"
template: "list_one_third_items"
styles:
card:
- background: "none"
- overflow: "visible"
grid:
- grid-template-areas: >
[[[
if (variables.ulm_card_fan_enable_button) {
return "'slider button'";
}
return "'slider'";
]]]
- grid-template-columns: >
[[[
if (variables.ulm_card_fan_enable_button) {
return "2fr 1fr";
}
return "1fr";
]]]
custom_fields:
button:
- display: >
[[[
if (variables.ulm_card_fan_enable_button) {
return "block";
}
return "none";
]]]
custom_fields:
slider:
card:
type: "custom:my-slider"
entity: "[[[ return entity.entity_id ]]]"
radius: "14px"
height: "42px"
minSet: "[[[ return variables.ulm_card_fan_slider_min ]]]"
maxSet: "[[[ return variables.ulm_card_fan_slider_max ]]]"
mainSliderColor: >
[[[
var color = variables.ulm_card_fan_color;
if (entity.state == "on") {
if (variables.ulm_card_fan_force_background_color) {
return 'rgb(250,250,250)';
}
return 'rgba(var(--color-' + color + '),0.8)';
}
return "rgba(var(--color-grey),0.8)";
]]]
secondarySliderColor: >
[[[
var color = variables.ulm_card_fan_color;
if (entity.state == "on") {
if (variables.ulm_card_fan_force_background_color) {
return 'rgba(var(--color-' + color + '),0.3)';
}
return 'rgba(var(--color-' + color + '),0.1)';
}
return "rgba(var(--color-grey),0.1)";
]]]
mainSliderColorOff: "rgba(var(--color-theme),0.05)"
secondarySliderColorOff: "rgba(var(--color-theme),0.05)"
thumbHorizontalPadding: "0px"
thumbVerticalPadding: "0px"
thumbWidth: "0px"
card_mod:
style: |
ha-card {
border-radius: 14px;
box-shadow: none;
}
button:
card:
type: "custom:button-card"
template:
- "widget_icon"
icon: "[[[ return variables.ulm_card_fan_button_icon ]]]"
entity: "[[[ return entity.entity_id ]]]"
tap_action:
action: "perform-action"
perform_action: "[[[ return variables.ulm_card_fan_button_service ]]]"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
oscillating: "[[[ return !entity.attributes[variables.ulm_card_fan_oscillate_attribute] ]]]"
state:
- operator: "template"
value: "[[[ return entity.state === 'on' && !entity.attributes[variables.ulm_card_fan_oscillate_attribute]; ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_light_force_background_color){
return 'rgb(250,250,250)'
}
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_fan_color;
if (variables.ulm_card_fan_force_background_color) {
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
var color = variables.ulm_card_fan_color;
if (variables.ulm_card_fan_force_background_color) {
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
- operator: "template"
value: "[[[ return entity.state === 'on' && entity.attributes[variables.ulm_card_fan_oscillate_attribute]; ]]]"
styles:
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_fan_color;
if (variables.ulm_card_fan_force_background_color) {
return 'rgba(250, 250, 250, 1)';
}
return 'rgba(var(--color-' + color + '),0.2)';
]]]
icon:
- color: >
[[[
var color = variables.ulm_card_fan_color;
return 'rgba(var(--color-' + color + '),1)'
]]]

View File

@@ -0,0 +1,110 @@
---
### Card Generic ###
card_generic:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_generic_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_generic_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_outlet_power_enable_popup: false
ulm_card_generic_color: "blue"
ulm_card_generic_force_background_color: false
triggers_update: "all"
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_generic_force_background_color) {
var color = variables.ulm_card_generic_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_generic_icon; ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_generic_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_generic_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_translation_state ]]]"
label: "[[[ return variables.ulm_card_generic_name ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_generic_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_generic_force_background_color) {
return 'rgb(250,250,250)';
}
]]]

View File

@@ -0,0 +1,110 @@
---
### Card Generic Swap ###
card_generic_swap:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_generic_swap_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_generic_swap_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_outlet_power_enable_popup: false
ulm_card_generic_swap_color: "blue"
ulm_card_generic_swap_force_background_color: false
triggers_update: "all"
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_generic_swap_force_background_color) {
var color = variables.ulm_card_generic_swap_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_generic_swap_icon; ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_generic_swap_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_generic_swap_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
name: "[[[ return variables.ulm_card_generic_swap_name ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_generic_swap_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_generic_swap_force_background_color) {
return 'rgb(250,250,250)';
}
]]]

View File

@@ -0,0 +1,109 @@
---
### Card Input Boolean ###
card_input_boolean:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_input_boolean_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_input_boolean_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_outlet_power_enable_popup: false
ulm_card_input_boolean_color: "blue"
ulm_card_input_boolean_force_background_color: false
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_input_boolean_force_background_color) {
var color = variables.ulm_card_input_boolean_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_input_boolean_icon; ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_input_boolean_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_input_boolean_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_input_boolean_name; ]]]"
label: "[[[ return variables.ulm_translation_state ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {
'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor
}
};
}
return vars;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_input_boolean_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_input_boolean_force_background_color) {
return 'rgb(250,250,250)';
}
]]]

View File

@@ -0,0 +1,446 @@
---
### Card Light ###
card_light:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_light_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_light_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_light_enable_collapse: false
ulm_card_light_enable_horizontal: false
ulm_card_light_enable_horizontal_wide: false
ulm_card_light_enable_color: false
ulm_card_light_color_palette: ""
ulm_card_light_color: "yellow"
ulm_card_light_force_background_color: false
ulm_card_light_enable_slider: false
ulm_card_light_enable_slider_minSet: 0
ulm_card_light_enable_slider_maxSet: 100
ulm_card_light_enable_buttons: false
ulm_card_light_brightness_low: 1
ulm_card_light_brightness_medium: 50
ulm_card_light_brightness_high: 100
ulm_card_light_enable_popup: false
ulm_card_light_enable_popup_tap: false
show_icon: false
show_name: false
show_label: false
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
var color_set = (variables.ulm_card_light_enable_color && entity.attributes.rgb_color) ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),var(--opacity-bg))'
if(variables.ulm_card_light_enable_color && entity.attributes.rgb_color){
color = 'rgba(' + color_set + ',var(--opacity-bg))'
}
if (variables.ulm_card_light_force_background_color) {
return color
}
]]]
styles:
grid:
- grid-template-areas: >
[[[
if (variables.ulm_card_light_enable_collapse && entity.state != "on") {
return "\"item1\"";
}
var areas = [];
areas.push("item1");
if (variables.ulm_card_light_enable_slider) {
areas.push("item2");
}
if (variables.ulm_card_light_enable_buttons) {
areas.push("item3");
}
if (variables.ulm_card_light_enable_horizontal) {
areas = areas.slice(0, 2);
return "\"" + areas.join(" ") + "\"";
}
return "\"" + areas.join("\" \"") + "\"";
]]]
- grid-template-columns: >
[[[
if (variables.ulm_card_light_enable_collapse && entity.state != "on") {
return "1fr";
}
if (variables.ulm_card_light_enable_horizontal) {
if(variables.ulm_card_light_enable_horizontal_wide){
return "1fr 2fr";
} else {
return "1fr 1fr";
}
}
return "1fr";
]]]
- grid-template-rows: >
[[[
if (variables.ulm_card_light_enable_horizontal || (variables.ulm_card_light_enable_collapse && entity.state != "on")) {
return "min-content";
}
var rows = [];
rows.push("min-content");
if (variables.ulm_card_light_enable_slider) {
rows.push("min-content");
}
if (variables.ulm_card_light_enable_buttons) {
rows.push("min-content");
}
return rows.join(" ");
]]]
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item2:
- display: >
[[[
if (variables.ulm_card_light_enable_collapse && entity.state != "on") {
return "none";
} else if (variables.ulm_card_light_enable_slider) {
return "block";
} else {
return "none";
}
]]]
item3:
- display: >
[[[
if (variables.ulm_card_light_enable_collapse && entity.state != "on") {
return "none";
} else if (variables.ulm_card_light_enable_buttons) {
if (variables.ulm_card_light_enable_horizontal && variables.ulm_card_light_enable_slider) {
return "none";
}
return "block";
} else {
return "none";
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_light_icon ]]]"
variables: >
[[[
let vars = variables;
if (variables.ulm_card_light_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_light_brightness',
'popup_variables': {'ulm_card_light_color_palette': variables.ulm_card_light_color_palette}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),1)'
if(variables.ulm_card_light_enable_color && entity.attributes.rgb_color){
color = 'rgba(' + color_set + ',1)'
}
if (entity.state != "on") {
return 'rgba(var(--color-theme),0.2)';
}
return color
]]]
img_cell:
- background-color: >
[[[
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),0.2)'
if(variables.ulm_card_light_enable_color && entity.attributes.rgb_color){
color = 'rgba(' + color_set + ',0.2)'
}
if (entity.state != "on") {
return 'rgba(var(--color-theme),0.05)';
}
return color
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if (variables.ulm_card_light_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_light_brightness',
'popup_variables': {'ulm_card_light_color_palette': variables.ulm_card_light_color_palette}
};
}
return vars;
]]]
name: "[[[ return variables.ulm_card_light_name ]]]"
label: >
[[[
var label = variables.ulm_translation_state;
if (entity.attributes.brightness != null && entity.state === 'on') {
var bri = Math.round(entity.attributes.brightness / 2.55);
label = (bri ? bri : "0") + "%";
}
return label;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_light_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_light_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
item2:
card:
type: "custom:my-slider"
entity: "[[[ return entity.entity_id ]]]"
radius: "14px"
height: "42px"
minSet: "[[[ return variables.ulm_card_light_enable_slider_minSet ]]]"
maxSet: "[[[ return variables.ulm_card_light_enable_slider_maxSet ]]]"
mainSliderColor: >
[[[
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),1)'
if(variables.ulm_card_light_enable_color && entity.attributes.rgb_color){
color = 'rgba(' + color_set + ',1)'
}
if (entity.state == "unavailable") {
return "rgba(var(--color-grey),1)";
}
if(variables.ulm_card_light_force_background_color && !hass.themes.darkMode){
return 'rgba(250,250,250,1)'
}
return color
]]]
secondarySliderColor: >
[[[
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),0.2)'
if(variables.ulm_card_light_enable_color && entity.attributes.rgb_color){
color = 'rgba(' + color_set + ',0.2)'
}
if (entity.state == "unavailable") {
return "rgba(var(--color-grey),0.2)";
}
return color
]]]
thumbColor: >
[[[
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),1)'
if(variables.ulm_card_light_enable_color && entity.attributes.rgb_color){
color = 'rgba(' + color_set + ',1)'
}
if (entity.state == "unavailable") {
return "rgba(var(--color-grey),1)";
}
if(variables.ulm_card_light_force_background_color && !hass.themes.darkMode){
return 'rgba(250,250,250,1)'
}
return color
]]]
mainSliderColorOff: "rgba(var(--color-theme),0.05)"
secondarySliderColorOff: "rgba(var(--color-theme),0.05)"
thumbHorizontalPadding: "0px"
thumbVerticalPadding: "0px"
thumbWidth: "12px"
card_mod:
style: |
ha-card {
border-radius: 14px;
box-shadow: none;
}
item3:
card:
type: "custom:button-card"
template: "list_3_items"
styles:
card:
- background: "none"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_light_force_background_color){
if (entity.state != "off"){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_light_force_background_color) {
if (entity.state != "off") {
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),0.2)'
if (variables.ulm_card_light_enable_color && entity.attributes.rgb_color) {
color = 'rgba(' + color_set + ',0.2)';
}
return color;
}
}
]]]
icon:
- color: >
[[[
if (variables.ulm_card_light_force_background_color) {
if (entity.state != "off") {
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),1)';
if (variables.ulm_card_light_enable_color && entity.attributes.rgb_color) {
color = 'rgba(' + color_set + ',1)';
}
return color;
}
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "light.turn_on"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
brightness_pct: "[[[ return variables.ulm_card_light_brightness_low ]]]"
icon: "mdi:lightbulb-on-10"
item2:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_light_force_background_color){
if (entity.state != "off"){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_light_force_background_color) {
if (entity.state != "off") {
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),0.2)'
if (variables.ulm_card_light_enable_color && entity.attributes.rgb_color) {
color = 'rgba(' + color_set + ',0.2)';
}
return color;
}
}
]]]
icon:
- color: >
[[[
if (variables.ulm_card_light_force_background_color) {
if (entity.state != "off") {
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),1)';
if (variables.ulm_card_light_enable_color && entity.attributes.rgb_color) {
color = 'rgba(' + color_set + ',1)';
}
return color;
}
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "light.turn_on"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
brightness_pct: "[[[ return variables.ulm_card_light_brightness_medium ]]]"
icon: "mdi:lightbulb-on-50"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_light_force_background_color){
if (entity.state != "off"){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_light_force_background_color) {
if (entity.state != "off") {
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),0.2)'
if (variables.ulm_card_light_enable_color && entity.attributes.rgb_color) {
color = 'rgba(' + color_set + ',0.2)';
}
return color;
}
}
]]]
icon:
- color: >
[[[
if (variables.ulm_card_light_force_background_color) {
if (entity.state != "off") {
var color_set = variables.ulm_card_light_enable_color && entity.attributes.rgb_color ? entity.attributes.rgb_color : variables.ulm_card_light_color;
var color = 'rgba(var(--color-' + color_set + '),1)';
if (variables.ulm_card_light_enable_color && entity.attributes.rgb_color) {
color = 'rgba(' + color_set + ',1)';
}
return color;
}
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "light.turn_on"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
brightness_pct: "[[[ return variables.ulm_card_light_brightness_high ]]]"
icon: "mdi:lightbulb-on"

View File

@@ -0,0 +1,912 @@
---
### Card Media Player ###
card_media_player:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_media_player_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_media_player_icon: false
ulm_card_media_player_enable_art: false
ulm_card_media_player_enable_controls: false
ulm_card_media_player_enable_volume_slider: false
ulm_card_media_player_enable_volume_buttons: false
ulm_card_media_player_enable_volume_adjust: 0
ulm_card_media_player_collapsible: false
ulm_card_media_player_idle_off: false
ulm_card_media_player_player_controls_entity: "[[[ return entity.entity_id ]]]"
ulm_card_media_player_enable_popup: false
ulm_card_media_player_more_info: false
ulm_card_media_player_power_button: false
ulm_card_media_player_force_background_color: false
ulm_card_media_player_color: "blue"
show_icon: false
show_name: false
show_label: false
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state && !variables.ulm_card_media_player_enable_art ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_media_player_color) {
if (variables.ulm_card_media_player_force_background_color) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
}
]]]
styles:
grid:
- grid-template-areas: |
[[[
var areas = "'item1'";
if (variables.ulm_card_media_player_enable_controls){
areas = areas + " 'item2'";
}
if (variables.ulm_card_media_player_enable_volume_slider){
areas = areas + " 'item3'";
}
if (variables.ulm_card_media_player_enable_volume_buttons){
areas = areas + " 'item4'";
}
return areas;
]]]
- grid-template-columns: "1fr"
- grid-template-rows: |
[[[
var rows = "min-content";
if (variables.ulm_card_media_player_enable_controls){
rows = rows + " min-content";
}
if (variables.ulm_card_media_player_enable_volume_slider){
rows = rows + " min-content";
}
if (variables.ulm_card_media_player_enable_volume_buttons){
rows = rows + " min-content";
}
return rows;
]]]
- row-gap: |-
[[[
if (!variables.ulm_card_media_player_collapsible) {
return "12px";
} else {
return (entity.state === "off" || entity.state === "standby" || (variables.ulm_card_media_player_idle_off && entity.state=== "idle")) ? "0px" : "12px";
}
]]]
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
- background: |
[[[
return variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null
? 'center / cover url(' + states[entity.entity_id].attributes.entity_picture + ') rgba(0, 0, 0, 0.15)'
: ''
]]]
custom_fields:
power:
- display: "[[[ return variables.ulm_card_media_player_power_button ? 'block' : 'none']]]"
- position: "absolute"
- top: "12px"
- right: "12px"
item2:
- display: |
[[[
if(variables.ulm_card_media_player_enable_controls) {
if(variables.ulm_card_media_player_collapsible){
return (entity.state === "off" || entity.state === "standby" || (variables.ulm_card_media_player_idle_off && entity.state=== "idle")) ? "none" : "block";
}
return "block";
}
return "none";
]]]
item3:
- border-radius: "14px"
- background-color: >
[[[
if(variables.ulm_card_media_player_enable_art){
return 'transparent'
}
if(!hass.themes.darkMode){
return 'rgb(250,250,250)' ;
}
]]]
- display: |
[[[
if(variables.ulm_card_media_player_enable_volume_slider) {
if(variables.ulm_card_media_player_collapsible){
return (entity.state === "off" || entity.state === "standby" || (variables.ulm_card_media_player_idle_off && entity.state=== "idle")) ? "none" : "block";
}
return "block";
}
return "none";
]]]
item4:
- display: |
[[[
if(variables.ulm_card_media_player_enable_volume_buttons) {
if(variables.ulm_card_media_player_collapsible){
return (entity.state === "off" || entity.state === "standby" || (variables.ulm_card_media_player_idle_off && entity.state=== "idle")) ? "none" : "block";
}
return "block";
}
return "none";
]]]
custom_fields:
power:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
template: "widget_icon"
icon: "mdi:power"
tap_action:
action: "toggle"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- width: "42px"
- heigth: "42px"
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_media_player_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_media_player_infos'
};
}
return vars;
]]]
icon: |
[[[
var icon = entity.attributes.icon || "mdi:speaker";
if(entity.attributes.app_name){
var app = entity.attributes.app_name.toLowerCase();
var icon = {
"spotify": "mdi:spotify",
"google podcasts": "mdi:google-podcast",
"plex": "mdi:plex",
"soundcloud": "mdi:soundcloud",
"youtube music": "mdi:youtube",
"oto music": "mdi:music-circle",
"pandora": "mdi:pandora",
"netflix": "mdi:netflix",
"hulu": "mdi:hulu",
"bluetooth audio": "mdi:bluetooth"
}
}
return variables.ulm_card_media_player_icon || icon[app];
]]]
styles:
icon:
- color: |
[[[
var color = variables.ulm_card_media_player_color;
var active_color = 'rgba(var(--color-theme),0.2)'
if (variables.ulm_active_state){
active_color = 'rgba(var(--color-' + color + '),1)';
}
return variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null
? 'white'
: active_color
]]]
img_cell:
- background-color: |
[[[
var color = variables.ulm_card_media_player_color;
var active_color = 'rgba(var(--color-theme),0.05)'
if (variables.ulm_active_state){
active_color = 'rgba(var(--color-' + color + '),0.2)';
}
return variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null
? 'rgba(0, 0, 0, 0.2)'
: active_color
]]]
card:
- background: >
[[[
if(!variables.ulm_card_media_player_enable_art && variables.ulm_card_media_player_force_background_color && !hass.themes.darkMode){
return 'rgb(250,250,250)'
}
return 'none'
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_media_player_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_media_player_infos'
};
}
return vars;
]]]
label: "[[[ return variables.ulm_translation_state ]]]"
state:
- operator: "template"
value: "[[[ return entity.state == 'off' ]]]"
name: |
[[[
let name = variables.ulm_card_media_player_name || states[entity.entity_id].attributes.friendly_name;
return name;
]]]
- operator: "template"
value: "[[[ return entity.state == 'standby' ]]]"
name: |
[[[
let name = variables.ulm_card_media_player_name || states[entity.entity_id].attributes.friendly_name;
return name;
]]]
- operator: "template"
value: "[[[ return entity.state != 'off' || entity.state != 'standby']]]"
name: |
[[[
let name = variables.ulm_card_media_player_name || states[entity.entity_id].attributes.friendly_name;
let isIdle = variables.ulm_card_media_player_idle_off && (entity.state === "idle");
if(states[entity.entity_id].attributes.media_title && !isIdle){
name = states[entity.entity_id].attributes.media_title;
}
return name;
]]]
label: |
[[[
let label = variables.ulm_translation_on;
let isIdle = variables.ulm_card_media_player_idle_off && (entity.state === "idle");
if (!isIdle) {
if (variables.ulm_card_media_player_more_info && states[entity.entity_id].attributes.media_artist
&& states[entity.entity_id].attributes.media_album_name ) {
label = states[entity.entity_id].attributes.media_artist + " • " + states[entity.entity_id].attributes.media_album_name;
} else if(states[entity.entity_id].attributes.media_album_name) {
label = states[entity.entity_id].attributes.media_album_name;
} else if (states[entity.entity_id].attributes.media_artist) {
label = states[entity.entity_id].attributes.media_artist
}
}
return label;
]]]
styles:
label:
- opacity: "1"
- filter: "opacity(100%)"
- text-shadow: |
[[[
return variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null
? '0 0 black'
: 'none'
]]]
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state){
return 'rgba(250,250,250,0.5)'
}
return 'rgba(var(--color-theme), .5)'
]]]
name:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state){
return 'rgb(250,250,250)'
}
return'rgba(var(--color-theme), 1)'
]]]
- text-shadow: "0 0 black"
card:
- padding: "0px"
- background: "none"
- border-radius: "0"
- box-shadow: "none"
item2:
card:
type: "custom:button-card"
template: "list_4_items"
styles:
card:
- padding: "0px"
- background: "none"
- border-radius: "0"
- box-shadow: "none"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
hold_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
content:
type: "custom:button-card"
template: "popup_media_player_infos"
entity: "[[[ return entity.entity_id ]]]"
tap_action:
action: "perform-action"
perform_action: "media_player.media_previous_track"
target:
entity_id: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
icon: "mdi:skip-previous"
entity: "[[[ return entity.entity_id ]]]"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
item2:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
hold_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
content:
type: "custom:button-card"
template: "popup_media_player_infos"
entity: "[[[ return entity.entity_id; ]]]"
tap_action:
action: "perform-action"
perform_action: "[[[ return (entity.attributes?.media_duration > 0) ? 'media_player.media_play_pause' : entity.state =='playing' ? 'media_player.media_stop' : 'media_player.media_play']]]"
target:
entity_id: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
icon: "[[[ return (entity.attributes?.media_duration > 0) ? 'mdi:pause' : 'mdi:stop' ]]]"
state:
- value: "playing"
icon: "mdi:pause"
- value: "paused"
icon: "mdi:play"
- value: "off"
icon: "mdi:play"
- value: "standby"
icon: "mdi:play"
- value: "idle"
icon: "mdi:play"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
item3:
card:
type: "custom:button-card"
template: "widget_icon"
hold_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
content:
type: "custom:button-card"
template: "popup_media_player_infos"
entity: "[[[ return entity.entity_id; ]]]"
tap_action:
action: "perform-action"
perform_action: "media_player.media_next_track"
target:
entity_id: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
icon: "mdi:skip-next"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
item4:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:playlist-music"
entity: "[[[ return entity.entity_id; ]]]"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
hold_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup && entity.attributes?.source_list ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
content:
type: "custom:button-card"
template: "popup_media_player_source_card"
entity: "[[[ return entity.entity_id; ]]]"
tap_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup && entity.attributes?.source_list ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
style: |
--popup-background-color: var(--primary-background-color);
--popup-border-radius: 20px;
--popup-padding-x: 24px;
--popup-padding-y: 20px;
--popup-max-width: auto
--popup-min-width: 800px;
card_mod:
style:
ha-dialog$: |
@media (max-width: 800px){
div.mdc-dialog__container {
--mdc-dialog-min-width: 100vw;
--mdc-dialog-max-width: 100vw;
--mdc-dialog-min-height: 100%;
--ha-dialog-border-radius: 0px;
}
}
content:
type: "custom:button-card"
template: "popup_media_player_source_card"
entity: "[[[ return entity.entity_id; ]]]"
item3:
card:
type: "custom:my-slider"
entity: "[[[ return entity.entity_id ]]]"
radius: "14px"
height: "42px"
mainSliderColor: |
[[[
var color = variables.ulm_card_media_player_color;
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.5)'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
return 'rgb(250,250,250)';
}
return 'rgba(var(--color-' + color + '),1)'
]]]
secondarySliderColor: |
[[[
var color = variables.ulm_card_media_player_color;
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.3)'
}
if (variables.ulm_card_media_player_force_background_color) {
return 'rgba(var(--color-' + color + '),0.3)';
}
return 'rgba(var(--color-' + color + '),0.2)'
]]]
mainSliderColorOff: "rgba(var(--color-theme),0.05)"
secondarySliderColorOff: "rgba(var(--color-theme),0.05)"
thumbHorizontalPadding: "0px"
thumbVerticalPadding: "0px"
thumbWidth: "0px"
card_mod:
style: |
ha-card {
border-radius: 14px;
background-color: transparent;
box-shadow: none;
}
item4:
card:
type: "custom:button-card"
template: "list_3_items"
styles:
card:
- padding: "0px"
- background: "none"
- border-radius: "0"
- box-shadow: "none"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
hold_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
content:
type: "custom:button-card"
template: "popup_media_player_infos"
entity: "[[[ return entity.entity_id; ]]]"
tap_action:
action: "perform-action"
perform_action: "media_player.volume_mute"
target:
entity_id: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
data:
is_volume_muted: "[[[ return (states[entity.entity_id].attributes.is_volume_muted) ? false : true; ]]]"
icon: "mdi:volume-mute"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
item2:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
hold_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
content:
type: "custom:button-card"
template: "popup_media_player_infos"
entity: "[[[ return entity.entity_id; ]]]"
tap_action:
action: "perform-action"
perform_action: "media_player.volume_set"
target:
entity_id: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
data:
volume_level: |
[[[
var volume = states[entity.entity_id].attributes.volume_level;
if (variables.ulm_card_media_player_enable_volume_adjust != 0) {
volume = states[entity.entity_id].attributes.volume_level - variables.ulm_card_media_player_enable_volume_adjust;
} else {
if (states[entity.entity_id].attributes.device_class === "tv") {
volume = states[entity.entity_id].attributes.volume_level - 0.01;
}
if (states[entity.entity_id].attributes.device_class === "speaker") {
volume = states[entity.entity_id].attributes.volume_level - 0.05;
}
if (states[entity.entity_id].attributes.device_class === "receiver") {
volume = states[entity.entity_id].attributes.volume_level - 0.025;
} else {
volume = states[entity.entity_id].attributes.volume_level - 0.025;
}
}
return volume;
]]]
icon: "mdi:volume-minus"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
item3:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
hold_action:
action: >
[[[
return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info";
]]]
browser_mod:
service: "browser_mod.popup"
data:
large: true
hide_header: true
content:
type: "custom:button-card"
template: "popup_media_player_infos"
entity: "[[[ return entity.entity_id; ]]]"
tap_action:
action: "perform-action"
perform_action: "media_player.volume_set"
target:
entity_id: "[[[ return variables.ulm_card_media_player_player_controls_entity ]]]"
data:
volume_level: |
[[[
var volume = states[entity.entity_id].attributes.volume_level;
if (variables.ulm_card_media_player_enable_volume_adjust != 0) {
volume = states[entity.entity_id].attributes.volume_level + variables.ulm_card_media_player_enable_volume_adjust;
} else {
if (states[entity.entity_id].attributes.device_class === "tv") {
volume = states[entity.entity_id].attributes.volume_level + 0.01;
}
if (states[entity.entity_id].attributes.device_class === "speaker") {
volume = states[entity.entity_id].attributes.volume_level + 0.05;
}
if (states[entity.entity_id].attributes.device_class === "receiver") {
volume = states[entity.entity_id].attributes.volume_level + 0.025;
} else {
volume = states[entity.entity_id].attributes.volume_level + 0.025;
}
}
return volume;
]]]
icon: "mdi:volume-plus"
styles:
card:
- background-color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'rgba(0, 0, 0, 0.2)'
}
if(!hass.themes.darkMode && variables.ulm_card_media_player_force_background_color){
if (variables.ulm_active_state){
return 'rgb(250,250,250)'
}
}
return 'rgba(var(--color-theme),0.05)'
]]]
img_cell:
- background-color: >
[[[
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state && !variables.ulm_card_media_player_enable_art) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: |
[[[
if(variables.ulm_card_media_player_enable_art && states[entity.entity_id].attributes.entity_picture != null){
return 'white'
}
if (variables.ulm_card_media_player_force_background_color && variables.ulm_active_state) {
var color = variables.ulm_card_media_player_color;
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]

View File

@@ -0,0 +1,25 @@
---
### Card Navigate ###
card_navigate:
template:
- "icon_only"
tap_action:
action: "navigate"
navigation_path: "[[[ return variables.ulm_card_navigate_path; ]]]"
variables:
ulm_card_navigate_color: "var(--color-blue)"
label: "[[[ return variables.ulm_card_navigate_title; ]]]"
icon: "[[[ return variables.ulm_card_navigate_icon; ]]]"
styles:
icon:
- color: >
[[[
let color = variables.ulm_card_navigate_color;
return "rgba(" + color + ",0.7)"
]]]
label:
- align-self: "center"
- font-size: "14px"
- filter: "opacity(100%)"
grid:
- grid-template-columns: "min-content min-content"

View File

@@ -0,0 +1,101 @@
---
### Card Person ###
card_person:
template:
- "icon_info_bg"
- "ulm_translation_engine"
variables:
ulm_card_person_use_entity_picture: false
ulm_card_person_icon: "mdi:face-man"
ulm_address: ""
triggers_update:
- "[[[ return variables.ulm_card_person_entity ]]]"
- "[[[ return variables.ulm_card_person_eta ]]]"
- "[[[ return variables.ulm_address ]]]"
tap_action:
action: "more-info"
show_label: true
show_name: true
label: >
[[[
let translation = helpers.localize(entity)
var eta = ""
if (variables.ulm_card_person_eta && entity.state != 'home'){
eta = " | " + helpers.localize(states[variables.ulm_card_person_eta]);
}
if (variables.ulm_address){
return helpers.localize(states[variables.ulm_address]) + eta;
}
return translation + eta
]]]
name: "[[[ return entity.attributes.friendly_name ]]]"
entity: "[[[ return variables.ulm_card_person_entity; ]]]"
icon: "[[[ return variables.ulm_card_person_icon; ]]]"
show_entity_picture: "[[[ return variables.ulm_card_person_use_entity_picture ]]]"
entity_picture:
"[[[ return variables.ulm_card_person_use_entity_picture ? entity.attributes.entity_picture\
\ : null ]]]"
styles:
icon:
- color: "rgba(var(--color-theme),0.9)"
- width: >
[[[
return !variables.ulm_card_person_use_entity_picture ? "20px" : "42px";
]]]
- place-self: >
[[[
return !variables.ulm_card_person_use_entity_picture ? "center" : "stretch stretch";
]]]
custom_fields:
notification:
- border-radius: "50%"
- position: "absolute"
- left: "38px"
- top: "8px"
- height: "16px"
- width: "16px"
- border: "2px solid var(--card-background-color)"
- font-size: "12px"
- line-height: "14px"
- background-color: >
[[[
return (entity.state !== 'home') ? "rgba(var(--color-green),1)" : "rgba(var(--color-blue),1)";
]]]
info:
- position: "absolute"
- right: "6px"
- top: "6px"
- width: "25px"
- height: "25px"
custom_fields:
notification: >
[[[
if (entity.state == 'home') {
return '<ha-icon icon="mdi:home-variant" style="width: 10px; height: 10px; color: var(--primary-background-color);"></ha-icon>';
} else {
for (let st in states) {
if (st.startsWith("zone.")) {
if (states[st]?.attributes?.persons?.includes(entity.state) && !states[st]?.attributes?.passive) {
var icon = states[st].attributes.icon !== null ? states[st].attributes.icon : 'mdi:help-circle';
return '<ha-icon icon="' + icon + '" style="width: 10px; height: 10px; color: var(--primary-background-color);"></ha-icon>';
}
}
}
}
return '<ha-icon icon="mdi:home-minus" style="width: 10px; height: 10px; color: var(--primary-background-color);"></ha-icon>';
]]]
info: |
[[[
if(variables.ulm_card_person_battery){
const battery = Math.round(states[variables.ulm_card_person_battery].state/1);
const radius = 20.5; const circumference = radius * 2 * Math.PI;
return `<svg viewBox="0 0 50 50"><circle cx="25" cy="25" r="${radius}"
stroke="green" stroke-width="3" fill="none"
style="transform: rotate(-90deg); transform-origin: 50% 50%;
stroke-dasharray: ${circumference};
stroke-dashoffset: ${circumference - battery / 100 * circumference};" />
<text x="50%" y="54%" fill="var(--primary-text-color)" font-size="16" font-weight= "bold"
text-anchor="middle" alignment-baseline="middle">
${battery}<tspan font-size="10">%</tspan></text></svg>`;
}
]]]

View File

@@ -0,0 +1,115 @@
---
### Card Power Outlet ###
card_power_outlet:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_power_outlet_consumption_sensor:
ulm_card_power_outlet_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_power_outlet_icon: "[[[ return entity.attributes.icon ]]]"
ulm_outlet_power_enable_popup: false
ulm_card_power_outlet_color: "yellow"
ulm_card_power_outlet_force_background_color: false
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_power_outlet_force_background_color) {
var color = variables.ulm_card_power_outlet_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
]]]
triggers_update:
- "[[[ return variables.ulm_card_power_outlet_consumption_sensor ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_power_outlet_icon ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_power_outlet_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.2)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_power_outlet_color;
if (variables.ulm_active_state){
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_power_outlet_name ]]]"
label: |-
[[[
if (entity.state === "on" && variables.ulm_card_power_outlet_consumption_sensor !== null) {
return variables.ulm_translation_state + " • " + states[variables.ulm_card_power_outlet_consumption_sensor].state + "W";
} else {
return variables.ulm_translation_state;
}
]]]
variables: >
[[[
let vars = variables;
if(variables.ulm_outlet_power_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_power_outlet_stats',
'popup_variables': {'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1,
'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2,
'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor}
};
}
return vars;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_power_outlet_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_power_outlet_force_background_color) {
return 'rgb(250,250,250)';
}
]]]

View File

@@ -0,0 +1,239 @@
---
card_room:
template:
- "ulm_translation_engine"
variables:
label_use_temperature: true
label_use_brightness: false
double_tap_action:
action: "perform-action"
perform_action: "input_select.select_option"
target:
entity_id: "[[[ return variables.ulm_input_select ]]]"
data:
option: "[[[ return variables.ulm_input_select_option ]]]"
color: "var(--google-grey-500)"
size: "45%"
aspect_ratio: "1/1"
show_icon: true
show_label: true
show_name: true
icon: "mdi:sofa-single"
label: |-
[[[
if (variables.label_use_temperature) {
return (entity?.attributes?.current_temperature || entity?.attributes?.temperature || entity?.attributes?.device_temperature || entity?.state || '-') + (entity?.attributes?.unit_of_measurement || '°C');
} else if (variables.label_use_brightness && entity?.state == "on" && entity?.attributes?.brightness != null) {
let bri = Math.round(entity?.attributes?.brightness / 2.55);
return (bri ? bri : "0") + "%";
}
return variables.ulm_translation_state;
]]]
state:
- value: "unavailable"
styles:
custom_fields:
notification:
- border-radius: "50%"
- border: "2px solid var(--card-background-color)"
- width: "24.5px"
- height: "24.5px"
- position: "absolute"
- left: "50%"
- top: "50%"
- transform: "translate(-50%,-50%)"
- margin-top: "35%"
- margin-left: "-35%"
- line-height: 0
- display: "grid"
- background-color: "[[[ return 'rgba(var(--color-red),1)'; ]]]"
styles:
icon:
- color: "rgba(var(--color-theme),0.2)"
label:
- justify-self: "start"
- align-self: "start"
- font-weight: "bold"
- font-size: "14px"
- filter: "opacity(40%)"
- margin-left: "12px"
- max-width: "[[[ return `calc(100% - (12px + ${!variables?.entity_1 && !variables?.entity_2 ? 5 : 0}px))`; ]]]"
- text-overflow: "ellipsis"
- overflow: "hidden"
- margin-top: "[[[ return !variables?.entity_1 ? '-24%' : '-10%'; ]]]"
name:
- justify-self: "start"
- align-self: "end"
- font-weight: "bold"
- font-size: "18px"
- margin-left: "12px"
- margin-bottom: "[[[ return !variables?.entity_1 ? (!variables?.entity_2 ? '15.8%' : '24%') : '10%'; ]]]"
- max-width: "[[[ return `calc(100% - (12px + ${!variables?.entity_2 ? 5 : 0}px))`; ]]]"
- text-overflow: "ellipsis"
- overflow: "hidden"
state:
- justify-self: "start"
- font-weight: "bold"
- font-size: "12px"
- filter: "opacity(40%)"
- margin-left: "6px"
img_cell:
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "50%"
- width: "75%"
- height: "75%"
- max-width: "none"
- max-height: "none"
- position: "absolute"
- left: "50%"
- top: "50%"
- transform: "translate(-50%,-50%)"
- margin-top: "25%"
- margin-left: "-25%"
grid:
- grid-template-areas: "[[[ return !variables?.entity_1 ? (!variables?.entity_2 ? `'n n n' 'l l i3' 'i i i4'` : `'n n i2' 'l l i3' 'i i i4'`) : `'n n n i1' 'l l l i2' 'i i . i3' 'i i . i4'`; ]]]"
- grid-template-columns: "[[[ return !variables?.entity_1 ? '1fr 1fr 1fr' : '1fr 1fr 1fr 1fr'; ]]]"
- grid-template-rows: "[[[ return !variables?.entity_1 ? '1fr 1fr 1fr' : '1fr 1fr 1fr 1fr'; ]]]"
- justify-items: "center"
card:
- border-radius: "20px"
- box-shadow: "var(--box-shadow)"
- padding: "5px"
custom_fields:
i1: &widget_icon_room_styling
- border-radius: "50%"
- width: "80%"
- height: "80%"
- line-height: 0
- display: "grid"
i2: *widget_icon_room_styling
i3: *widget_icon_room_styling
i4: *widget_icon_room_styling
custom_fields:
notification: >
[[[
if (entity?.state == 'unavailable'){
return '<ha-icon icon="mdi:exclamation" style="width: 50%; height: 50%; color: var(--primary-background-color);"></ha-icon>';
}
]]]
i1:
card:
type: "custom:button-card"
template: >
[[[
let templates = [ 'widget_icon_room' ];
if (variables?.entity_1?.templates?.length) {
templates.push(...variables.entity_1.templates);
}
return templates;
]]]
variables: "[[[ return variables?.entity_1; ]]]"
state:
- operator: "template"
value: "[[[ return !variables.entity_1; ]]]"
styles:
card:
- display: "none"
entity: "[[[ return variables?.entity_1?.entity_id; ]]]"
i2:
card:
type: "custom:button-card"
template: >
[[[
let templates = [ 'widget_icon_room' ];
if (variables?.entity_2?.templates?.length) {
templates.push(...variables.entity_2.templates);
}
return templates;
]]]
variables: "[[[ return variables?.entity_2; ]]]"
state:
- operator: "template"
value: "[[[ return !variables.entity_2; ]]]"
styles:
card:
- display: "none"
entity: "[[[ return variables?.entity_2?.entity_id; ]]]"
i3:
card:
type: "custom:button-card"
template: >
[[[
let templates = [ 'widget_icon_room' ];
if (variables?.entity_3?.templates?.length) {
templates.push(...variables.entity_3.templates);
}
return templates;
]]]
variables: "[[[ return variables?.entity_3; ]]]"
state:
- operator: "template"
value: "[[[ return !variables.entity_3; ]]]"
styles:
card:
- display: "none"
entity: "[[[ return variables?.entity_3?.entity_id; ]]]"
i4:
card:
type: "custom:button-card"
template: >
[[[
let templates = [ 'widget_icon_room' ];
if (variables?.entity_4?.templates?.length) {
templates.push(...variables.entity_4.templates);
}
return templates;
]]]
variables: "[[[ return variables?.entity_4; ]]]"
state:
- operator: "template"
value: "[[[ return !variables.entity_4; ]]]"
styles:
card:
- display: "none"
entity: "[[[ return variables?.entity_4?.entity_id; ]]]"
widget_icon_room:
variables:
tap_action:
action: "toggle"
hold_action:
action: "more-info"
tap_action:
action: "[[[ return variables?.tap_action?.action ? variables.tap_action.action : 'none'; ]]]"
entity: "[[[ return variables.tap_action.entity; ]]]"
navigation_path: "[[[ return variables.tap_action.navigation_path; ]]]"
url_path: "[[[ return variables.tap_action.url_path; ]]]"
perform_action: "[[[ return variables.tap_action.service; ]]]"
data: "[[[ return variables.tap_action.service_data; ]]]"
hold_action:
action: "[[[ return variables?.hold_action?.action ? variables.hold_action.action : 'none'; ]]]"
entity: "[[[ return variables.hold_action.entity; ]]]"
navigation_path: "[[[ return variables.hold_action.navigation_path; ]]]"
url_path: "[[[ return variables.hold_action.url_path; ]]]"
perform_action: "[[[ return variables.hold_action.service; ]]]"
data: "[[[ return variables.hold_action.service_data; ]]]"
size: "15px"
color: "var(--google-grey)"
show_icon: true
show_name: false
styles:
icon:
- width: "50%"
- height: "50%"
- line-height: "0"
- color: "rgba(var(--color-theme),0.2)"
img_cell:
- border-radius: "50%"
- background-color: "rgba(var(--color-theme),0.05)"
grid:
- grid-template-areas: "'i'"
card:
- height: "100%"
- box-shadow: "none"
- padding: "0px"
- border-radius: "50%"

View File

@@ -0,0 +1,219 @@
---
card_scenes_welcome:
show_icon: false
show_name: true
show_label: false
variables:
entity_1:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_2:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_3:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_4:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_5:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_6:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_7:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
styles:
grid:
- grid-template-areas: >
[[[
var pills = []
const entities = [variables.entity_1?.entity_id, variables.entity_2?.entity_id, variables.entity_3?.entity_id, variables.entity_4?.entity_id, variables.entity_5?.entity_id, variables.entity_6?.entity_id, variables.entity_7?.entity_id]
function entity_check(item) {
if (item != "") {
pills.push("item" + (pills.length+1))
}
}
entities.forEach(entity_check)
return pills.join(" ")
]]]
- display: "flex"
- grid-template-rows: "min-content"
- justify-content: "space-evenly"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
- overflow: "visible"
custom_fields:
item1:
- display: "[[[ return (variables.entity_1.entity_id != '') ? 'block' : 'none' ]]]"
item2:
- display: "[[[ return (variables.entity_2.entity_id != '') ? 'block' : 'none' ]]]"
item3:
- display: "[[[ return (variables.entity_3.entity_id != '') ? 'block' : 'none' ]]]"
item4:
- display: "[[[ return (variables.entity_4.entity_id != '') ? 'block' : 'none' ]]]"
item5:
- display: "[[[ return (variables.entity_5.entity_id != '') ? 'block' : 'none' ]]]"
item6:
- display: "[[[ return (variables.entity_6.entity_id != '') ? 'block' : 'none' ]]]"
item7:
- display: "[[[ return (variables.entity_7.entity_id != '') ? 'block' : 'none' ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
variables: "[[[ return variables.entity_1; ]]]"
entity: "[[[ return variables.entity_1.entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_1.entity_id ]]]"
icon: "[[[ return variables.entity_1.icon ]]]"
item2:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_1.entity_id ]]]"
name: "[[[ return variables.entity_1.name ]]]"
item2:
card:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
variables: "[[[ return variables.entity_2; ]]]"
entity: "[[[ return variables.entity_2.entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_2.entity_id ]]]"
icon: "[[[ return variables.entity_2.icon ]]]"
item2:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_2.entity_id ]]]"
name: "[[[ return variables.entity_2.name ]]]"
item3:
card:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
variables: "[[[ return variables.entity_3; ]]]"
entity: "[[[ return variables.entity_3.entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_3.entity_id ]]]"
icon: "[[[ return variables.entity_3.icon ]]]"
item2:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_3.entity_id ]]]"
name: "[[[ return variables.entity_3.name ]]]"
item4:
card:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
variables: "[[[ return variables.entity_4; ]]]"
entity: "[[[ return variables.entity_4.entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_4.entity_id ]]]"
icon: "[[[ return variables.entity_4.icon ]]]"
item2:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_4.entity_id ]]]"
name: "[[[ return variables.entity_4.name ]]]"
item5:
card:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
variables: "[[[ return variables.entity_5; ]]]"
entity: "[[[ return variables.entity_5.entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_5.entity_id ]]]"
icon: "[[[ return variables.entity_5.icon ]]]"
item2:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_5.entity_id ]]]"
name: "[[[ return variables.entity_5.name ]]]"
item6:
card:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
variables: "[[[ return variables.entity_6; ]]]"
entity: "[[[ return variables.entity_6.entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_6.entity_id ]]]"
icon: "[[[ return variables.entity_6.icon ]]]"
item2:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_6.entity_id ]]]"
name: "[[[ return variables.entity_6.name ]]]"
item7:
card:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
variables: "[[[ return variables.entity_7; ]]]"
entity: "[[[ return variables.entity_7.entity_id ]]]"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_7.entity_id ]]]"
icon: "[[[ return variables.entity_7.icon ]]]"
item2:
card:
type: "custom:button-card"
entity: "[[[ return variables.entity_7.entity_id ]]]"
name: "[[[ return variables.entity_7.name ]]]"

View File

@@ -0,0 +1,18 @@
---
### Card Script ###
card_script:
template:
- "icon_only"
label: "[[[ return variables.ulm_card_script_title; ]]]"
icon: "[[[ return variables.ulm_card_script_icon; ]]]"
styles:
icon:
- color: "rgba(var(--color-blue),0.7)"
label:
- align-self: "center"
- font-size: "14px"
- filter: "opacity(100%)"
img_cell:
- background-color: "rgba(var(--color-blue), 0.2)"
grid:
- grid-template-columns: "min-content min-content"

View File

@@ -0,0 +1,788 @@
---
### Card Thermostat ###
card_thermostat:
template:
- "ulm_translation_engine"
- "icon_more_info_new"
variables:
ulm_card_thermostat_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_thermostat_icon: "[[[ return 'mdi:thermometer' ]]]"
ulm_card_thermostat_enable_collapse: false
ulm_card_thermostat_enable_controls: false
ulm_card_thermostat_enable_hvac_modes: false
ulm_card_thermostat_enable_background_color: false
ulm_card_thermostat_enable_display_temperature: false
ulm_card_thermostat_enable_horizontal: false
ulm_card_thermostat_enable_popup: false
ulm_card_thermostat_fan_entity: null
ulm_card_thermostat_minimum_temp_spread: 1
ulm_card_thermostat_preset_mode: false
show_icon: false
show_name: false
show_label: false
state:
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'heating' && variables.ulm_card_thermostat_enable_background_color)
]]]
styles:
card:
- background-color: "rgba(255,165,0,0.75)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' && variables.ulm_card_thermostat_enable_background_color)
]]]
styles:
card:
- background-color: "rgba(0,191,255,0.75)"
- operator: "template"
value: >
[[[
return entity.state != 'off'
]]]
styles:
card:
- background-color: "rgba(var(--color-background-yellow),var(--opacity-bg))"
styles:
grid:
- grid-template-areas: >
[[[
var areas = [];
if (variables.ulm_card_thermostat_enable_horizontal) {
return "\"item1 item2\"";
}
if (variables.ulm_card_thermostat_enable_display_temperature) {
areas.push("item1 item4");
} else {
areas.push("item1 item1");
}
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_controls) {
areas.push("item2 item2");
}
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_controls && entity.attributes.target_temp_high != null) {
areas.push("low_temp_adjustment low_temp_adjustment");
}
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_hvac_modes) {
areas.push("item3 item3");
}
return "\"" + areas.join("\" \"") + "\"";
]]]
- grid-template-columns: >
[[[
return variables.ulm_card_thermostat_enable_horizontal ? "1fr 1fr" : "2fr 1fr";
]]]
- grid-template-rows: >
[[[
var rows = [];
rows.push("min-content");
if (variables.ulm_card_thermostat_enable_horizontal) {
return "min-content";
}
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_controls) {
rows.push("min-content");
}
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_controls && entity.attributes.target_temp_high != null) {
rows.push("min-content");
}
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_hvac_modes) {
rows.push("min-content");
}
return rows.join(" ");
]]]
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item2:
- display: >
[[[
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_controls) {
return "block";
} else {
return "none";
}
]]]
low_temp_adjustment:
- display: >
[[[
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_controls && entity.attributes.target_temp_high != null) {
return "block";
} else {
return "none";
}
]]]
item3:
- display: >
[[[
if (variables.ulm_card_thermostat_enable_horizontal) {
return "none";
}
if ( !(variables.ulm_card_thermostat_enable_collapse && entity.state == "off") && variables.ulm_card_thermostat_enable_hvac_modes) {
return "block";
} else {
return "none";
}
]]]
item4:
- display: >
[[[
if (variables.ulm_card_thermostat_enable_horizontal) {
return "none";
}
if (variables.ulm_card_thermostat_enable_display_temperature) {
return "block";
} else {
return "none";
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_thermostat_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_thermostat_temperature',
'popup_variables': {'ulm_card_thermostat_preset_mode': variables.ulm_card_thermostat_preset_mode }
};
}
return vars;
]]]
icon: "[[[ return variables.ulm_card_thermostat_icon ]]]"
state:
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'heating')
]]]
styles:
icon:
- color: "rgba(var(--color-red),1)"
img_cell:
- background-color: "rgba(var(--color-red),0.2)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling')
]]]
styles:
icon:
- color: "rgba(var(--color-blue),1)"
img_cell:
- background-color: "rgba(var(--color-blue),0.2)"
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_thermostat_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_thermostat_temperature',
'popup_variables': {'ulm_card_thermostat_preset_mode': variables.ulm_card_thermostat_preset_mode }
};
}
return vars;
]]]
name: "[[[ return variables.ulm_card_thermostat_name ]]]"
label: >-
[[[
var label = variables.ulm_translation_state;
if((entity.attributes.temperature || entity.attributes.target_temp_high != null) && !variables.ulm_card_thermostat_enable_display_temperature){
return variables.ulm_translation_state;
}
return label;
]]]
item2:
card:
type: "custom:button-card"
template: "list_3_items"
styles:
card:
- background: "none"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:minus"
tap_action:
action: "perform-action"
perform_action: "climate.set_temperature"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
target_temp_low: |
[[[
if (entity.attributes.target_temp_low == null) {
return 0;
} else {
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
const new_temp = (parseFloat(entity.attributes.target_temp_high) - step)
return (new_temp - variables.ulm_card_thermostat_minimum_temp_spread < entity.attributes.target_temp_low ? new_temp - variables.ulm_card_thermostat_minimum_temp_spread : entity.attributes.target_temp_low);
}
]]]
target_temp_high: |
[[[
if (entity.attributes.target_temp_low == null) {
return 0;
} else {
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
return (parseFloat(entity.attributes.target_temp_high) - step)
}
]]]
temperature: |
[[[
if (entity.attributes.temperature == null) {
return 0;
} else {
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
return (parseFloat(states[entity.entity_id].attributes.temperature) - step)
}
]]]
state:
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
item2:
card:
type: "custom:button-card"
show_icon: false
show_name: false
show_label: true
entity: "[[[ return entity.entity_id ]]]"
label: |-
[[[
var temperature = entity.attributes.temperature || entity.attributes.target_temp_high;
if (temperature == null) {
var temperature = '-';
}
return temperature + hass.config.unit_system.temperature;
]]]
styles:
card:
- background: "none"
- box-shadow: "none"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:plus"
tap_action:
action: "perform-action"
perform_action: "climate.set_temperature"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
target_temp_low: |
[[[
if (entity.attributes.target_temp_low == null) {
return 0;
} else {
return entity.attributes.target_temp_low;
}
]]]
target_temp_high: |
[[[
if (entity.attributes.target_temp_high == null) {
return 0;
} else {
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
return (parseFloat(entity.attributes.target_temp_high) + step)
}
]]]
temperature: |
[[[
if (entity.attributes.temperature == null) {
return 0;
} else {
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
return (parseFloat(states[entity.entity_id].attributes.temperature) + step)
}
]]]
state:
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
low_temp_adjustment:
card:
type: "custom:button-card"
template: "list_3_items"
styles:
card:
- background: "none"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:minus"
tap_action:
action: "perform-action"
perform_action: "climate.set_temperature"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
target_temp_low: |
[[[
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
return (parseFloat(entity.attributes.target_temp_low) - step)
]]]
target_temp_high: "[[[ return entity.attributes.target_temp_high ]]]"
state:
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
item2:
card:
type: "custom:button-card"
show_icon: false
show_name: false
show_label: true
entity: "[[[ return entity.entity_id ]]]"
label: |-
[[[
var temperature = entity.attributes.target_temp_low;
if (temperature == null) {
var temperature = '-';
}
return temperature + hass.config.unit_system.temperature;
]]]
styles:
card:
- background: "none"
- box-shadow: "none"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:plus"
tap_action:
action: "perform-action"
perform_action: "climate.set_temperature"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
target_temp_low: |
[[[
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
return (parseFloat(entity.attributes.target_temp_low) + step)
]]]
target_temp_high: |
[[[
const unit = hass.config.unit_system.temperature
const step = variables.ulm_card_thermostat_temp_step || entity.attributes.target_temp_step || (unit == '°F' ? 1.0 : 0.5)
const new_temp = (parseFloat(entity.attributes.target_temp_low) + step)
return (new_temp + variables.ulm_card_thermostat_minimum_temp_spread > entity.attributes.target_temp_high ? new_temp + variables.ulm_card_thermostat_minimum_temp_spread : entity.attributes.target_temp_high)
]]]
state:
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
item3:
card:
type: "custom:button-card"
styles:
grid:
- grid-template-areas: >
[[[
var areas = [];
if (states[entity.entity_id].attributes.hvac_modes.includes("auto")) {
areas.push("auto");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("heat")) {
areas.push("heat");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("cool")) {
areas.push("cool");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("dry")) {
areas.push("dry");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("heat_cool")) {
areas.push("heat_cool");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("fan_only")) {
areas.push("fan_only");
}
if (!states[entity.entity_id].attributes.hvac_modes.includes("fan_only") && (variables.ulm_card_thermostat_fan_entity !== null)) {
areas.push("fan_entity_only");
}
return "\"" + areas.join(" ") + "\"";
]]]
- grid-template-columns: >
[[[
var columns = [];
if (states[entity.entity_id].attributes.hvac_modes.includes("auto")) {
columns.push("1fr");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("heat")) {
columns.push("1fr");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("cool")) {
columns.push("1fr");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("dry")) {
columns.push("1fr");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("heat_cool")) {
columns.push("1fr");
}
if (states[entity.entity_id].attributes.hvac_modes.includes("fan_only")) {
columns.push("1fr");
}
if (!states[entity.entity_id].attributes.hvac_modes.includes("fan_only") && (variables.ulm_card_thermostat_fan_entity !== null)) {
columns.push("1fr");
}
return columns.join(" ");
]]]
- grid-template-rows: "min-content"
- column-gap: "7px"
card:
- box-shadow: "none"
- padding: "0px"
- background: "none"
custom_fields:
auto:
- display: >
[[[
if (states[entity.entity_id].attributes.hvac_modes.includes("auto")) {
return "block";
} else {
return "none";
}
]]]
heat:
- display: >
[[[
if (states[entity.entity_id].attributes.hvac_modes.includes("heat")) {
return "block";
} else {
return "none";
}
]]]
cool:
- display: >
[[[
if (states[entity.entity_id].attributes.hvac_modes.includes("cool")) {
return "block";
} else {
return "none";
}
]]]
dry:
- display: >
[[[
if (states[entity.entity_id].attributes.hvac_modes.includes("dry")) {
return "block";
} else {
return "none";
}
]]]
heat_cool:
- display: >
[[[
if (states[entity.entity_id].attributes.hvac_modes.includes("heat_cool")) {
return "block";
} else {
return "none";
}
]]]
fan_only:
- display: >
[[[
if (states[entity.entity_id].attributes.hvac_modes.includes("fan_only")) {
return "block";
} else {
return "none";
}
]]]
fan_entity_only:
- display: >
[[[
if (!states[entity.entity_id].attributes.hvac_modes.includes("fan_only") && (variables.ulm_card_thermostat_fan_entity !== null)) {
return "block";
} else {
return "none";
}
]]]
custom_fields:
auto:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:autorenew"
tap_action:
action: "perform-action"
perform_action: "climate.set_hvac_mode"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
hvac_mode: "auto"
state:
- operator: "template"
value: >
[[[
return entity.state == "auto"
]]]
styles:
card:
- background-color: "rgba(var(--color-green),0.5)"
icon:
- color: "rgba(var(--color-green),1)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
heat:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:fire"
tap_action:
action: "perform-action"
perform_action: "climate.set_hvac_mode"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
hvac_mode: "heat"
state:
- operator: "template"
value: >
[[[
return entity.state == "heat"
]]]
styles:
card:
- background-color: "rgba(var(--color-red),0.5)"
icon:
- color: "rgba(var(--color-red),1)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
cool:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:snowflake"
tap_action:
action: "perform-action"
perform_action: "climate.set_hvac_mode"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
hvac_mode: "cool"
state:
- operator: "template"
value: >
[[[
return entity.state == "cool"
]]]
styles:
card:
- background-color: "rgba(var(--color-blue),0.5)"
icon:
- color: "rgba(var(--color-blue),1)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
dry:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:water"
tap_action:
action: "perform-action"
perform_action: "climate.set_hvac_mode"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
hvac_mode: "dry"
state:
- operator: "template"
value: >
[[[
return entity.state == "dry"
]]]
styles:
card:
- background-color: "rgba(var(--color-yellow),0.5)"
icon:
- color: "rgba(var(--color-yellow),1)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
heat_cool:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:sun-snowflake"
tap_action:
action: "perform-action"
perform_action: "climate.set_hvac_mode"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
hvac_mode: "heat_cool"
state:
- operator: "template"
value: >
[[[
return entity.state == "heat_cool"
]]]
styles:
card:
- background-color: "rgba(var(--color-purple),0.5)"
icon:
- color: "rgba(var(--color-purple),1)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
fan_only:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:fan"
tap_action:
action: "perform-action"
perform_action: "climate.set_hvac_mode"
target:
entity_id: "[[[ return entity.entity_id ]]]"
data:
hvac_mode: "fan_only"
state:
- operator: "template"
value: >
[[[
return entity.state == "fan_only"
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.5)"
icon:
- color: "rgba(var(--color-green),1)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
fan_entity_only:
card:
type: "custom:button-card"
template: "widget_icon"
icon: "mdi:fan"
tap_action:
action: "perform-action"
perform_action: "fan.toggle"
target:
entity_id: "[[[ return variables.ulm_card_thermostat_fan_entity !== null ? states[variables.ulm_card_thermostat_fan_entity].entity_id : null ]]]"
state:
- operator: "template"
value: >
[[[
return ((variables.ulm_card_thermostat_fan_entity !== null) && states[variables.ulm_card_thermostat_fan_entity].state == 'on')
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.5)"
icon:
- color: "rgba(var(--color-green),1)"
- operator: "template"
value: >
[[[
return (entity.attributes.hvac_action == 'cooling' || entity.attributes.hvac_action == 'heating') && variables.ulm_card_thermostat_enable_background_color
]]]
styles:
card:
- background-color: "rgba(var(--color-theme),0.15)"
item4:
card:
type: "custom:button-card"
show_icon: false
show_name: false
show_label: true
entity: "[[[ return entity.entity_id ]]]"
label: |-
[[[
var temperature = entity.attributes.current_temperature;
if (temperature == null) {
var temperature = '-';
}
return temperature + hass.config.unit_system.temperature;
]]]
styles:
card:
- background: "none"
- box-shadow: "none"

View File

@@ -0,0 +1,378 @@
---
### Card Vacuum ###
card_vacuum:
show_name: false
show_icon: false
show_label: false
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_vacuum_name: "[[[ return entity.attributes.friendly_name ]]]"
ulm_card_vacuum_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_vacuum_room:
ulm_card_vacuum_room_icon: "[[[ return entity.attributes.icon ]]]"
ulm_card_vacuum_camera: ""
ulm_card_vacuum_enable_popup: false
ulm_card_vacuum_camera_toggle: false
ulm_card_vacuum_force_background_color: false
ulm_card_vacuum_color: >
[[[
var state = entity.state.toLowerCase();
var colors = {
"cleaning": "blue",
"mowing": "blue",
"paused": "green",
"mopping": "yellow",
"returning": "purple",
"error": "red",
"default": "theme"
}
return (colors[state] || colors["default"]);
]]]
triggers_update:
- "[[[ return variables.ulm_card_vacuum_camera ]]]"
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
card:
- background-color: >
[[[
if (variables.ulm_card_vacuum_color) {
if (variables.ulm_card_vacuum_force_background_color) {
var color = variables.ulm_card_vacuum_color;
return 'rgba(var(--color-' + color + '),var(--opacity-bg))';
}
}
]]]
styles:
grid:
- grid-template-areas: >
[[[
let map = "'item1' 'map' 'item2'"
if(variables.ulm_card_vacuum_camera != ""){
if(variables.ulm_card_vacuum_camera_toggle){
if(entity.state.toLowerCase() === 'cleaning' || entity.state.toLowerCase() === 'mopping' || entity.state.toLowerCase() === 'mowing'){
return map;
}
} else {
return map;
}
}
return "'item1' 'item2'"
]]]
- grid-template-columns: "1fr"
- grid-template-rows: >
[[[
let map = "repeat(3, min-content)"
if(variables.ulm_card_vacuum_camera != ""){
if(variables.ulm_card_vacuum_camera_toggle){
if(entity.state.toLowerCase() === 'cleaning' || entity.state.toLowerCase() === 'mopping' || entity.state.toLowerCase() === 'mowing'){
return map;
}
} else {
return map;
}
}
return "repeat(2, min-content)"
]]]
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
- background-color: >
[[[
if(hass.themes.darkMode){
return "variables.ulm_card_vacuum_color" + ", 0.1)";
}
]]]
custom_fields:
map:
- display: >
[[[
let map = "block"
if(variables.ulm_card_vacuum_camera != ""){
if(variables.ulm_card_vacuum_camera_toggle){
if(entity.state.toLowerCase() === 'cleaning' || entity.state.toLowerCase() === 'mopping' || entity.state.toLowerCase() === 'mowing'){
return map;
}
} else {
return map;
}
}
return "none"
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "[[[ return variables.ulm_card_vacuum_icon ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_vacuum_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_vacuum_map',
'popup_variables': {'ulm_card_vacuum_camera': variables.ulm_card_vacuum_camera }
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var color = variables.ulm_card_vacuum_color;
if(color == 'theme' || !variables.ulm_active_state){
return 'rgba(var(--color-theme),0.2)';
}
return 'rgba(var(--color-' + color + '),1)';
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_vacuum_color;
if(color == 'theme' || !variables.ulm_active_state){
return 'rgba(var(--color-theme),0.05)';
}
return 'rgba(var(--color-' + color + '),0.2)';
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_vacuum_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_vacuum_map',
'popup_variables': {'ulm_card_vacuum_camera': variables.ulm_card_vacuum_camera }
};
}
return vars;
]]]
name: "[[[ return variables.ulm_card_vacuum_name ]]]"
label: >
[[[
let label = entity.attributes.friendly_name
if(variables.ulm_card_vacuum_label){
label = variables.ulm_card_vacuum_label;
} else {
label = variables.ulm_translation_state;
}
return label;
]]]
state:
- operator: "template"
value: "[[[ return variables.ulm_active_state ]]]"
styles:
name:
- color: >
[[[
if (variables.ulm_card_vacuum_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
label:
- color: >
[[[
if (variables.ulm_card_vacuum_force_background_color) {
return 'rgb(250,250,250)';
}
]]]
map:
card:
type: "custom:button-card"
show_name: false
show_icon: false
show_label: false
entity: "[[[ return variables.ulm_card_vacuum_camera ]]]"
show_entity_picture: "true"
styles:
card:
- box-shadow: "none"
icon:
- border-radius: "20px"
- width: "100%"
item2:
card:
type: "custom:button-card"
template: >
[[[ return variables.ulm_card_vacuum_room ? "list_4_items" : "list_3_items"; ]]]
styles:
card:
- background: "none"
- border-radius: "0"
custom_fields:
item4:
- display: >
[[[ return variables.ulm_card_vacuum_room ? "block" : "none"; ]]]
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:play"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state){
return 'rgb(250,250,250)'
}
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
state:
- operator: "template"
value: "[[[ return ['cleaning','mopping','mowing'].includes(entity.state.toLowerCase()) ]]]"
icon: "mdi:stop"
tap_action:
action: "perform-action"
perform_action: "vacuum.stop"
target:
entity_id: "[[[ return entity.entity_id ]]]"
tap_action:
action: "perform-action"
perform_action: >
[[[
return ['cleaning','mopping','mowing'].includes(entity.state.toLowerCase()) ? "vacuum.stop" : "vacuum.start";
]]]
target:
entity_id: "[[[ return entity.entity_id ]]]"
item2:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:home-map-marker"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state){
return 'rgb(250,250,250)'
}
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "vacuum.return_to_base"
target:
entity_id: "[[[ return entity.entity_id ]]]"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:map-marker"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state){
return 'rgb(250,250,250)'
}
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "vacuum.locate"
target:
entity_id: "[[[ return entity.entity_id ]]]"
item4:
card:
type: "custom:button-card"
template: "widget_icon"
entity: "[[[ return variables.ulm_card_vacuum_room ]]]"
icon: "[[[ return variables.ulm_card_vacuum_room_icon ]]]"
styles:
card:
- background-color: >
[[[
if(!hass.themes.darkMode && variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state){
return 'rgb(250,250,250)'
}
]]]
img_cell:
- background-color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),0.2)';
}
return 'rgba(var(--color-theme),0.05)';
]]]
icon:
- color: >
[[[
var color = variables.ulm_card_vacuum_color;
if (variables.ulm_card_vacuum_force_background_color && variables.ulm_active_state) {
return 'rgba(var(--color-' + color + '),1)';
}
return 'rgba(var(--color-theme),0.9)';
]]]
tap_action:
action: "perform-action"
perform_action: "script.turn_on"
target:
entity_id: "[[[ return variables.ulm_card_vacuum_room ]]]"

View File

@@ -0,0 +1,100 @@
---
### VERTICAL BUTTONS (fka SCENES) ###
card_vertical_button:
variables:
ulm_card_vertical_button_color: "blue"
ulm_card_vertical_button_state: "on"
show_label: true
label: ""
name: |
[[[
if( entity.entity_id.startsWith("input_select.") )
return variables.ulm_card_vertical_button_state;
else if( entity.entity_id.startsWith("input_boolean.") )
return "";
return entity.state;
]]]
styles:
icon:
- color: "rgba(var(--color-theme),0.2)"
label:
- justify-self: "center"
- align-self: "start"
- font-weight: "bolder"
- font-size: "12px"
- filter: "opacity(40%)"
name:
- margin-top: "10px"
- justify-self: "center"
- font-weight: "bold"
- font-size: "14px"
img_cell:
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "50%"
- place-self: "center"
- width: "42px"
- height: "42px"
grid:
- grid-template-areas: "'i' 'n' 'l'"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "10px 0px 8px 0px"
size: "20px"
state:
- operator: "template"
value: |
[[[
return entity.state == variables.ulm_card_vertical_button_state;
]]]
styles:
icon:
- color: "[[[ return `rgba(var(--color-${variables.ulm_card_vertical_button_color}), 1)`; ]]]"
label:
- color: "[[[ return `rgba(var(--color-${variables.ulm_card_vertical_button_color}-text), 1)`; ]]]"
name:
- color: "[[[ return `rgba(var(--color-${variables.ulm_card_vertical_button_color}-text), 1)`; ]]]"
img_cell:
- background-color: "[[[ return `rgba(var(--color-${variables.ulm_card_vertical_button_color}), 0.2)`; ]]]"
card:
- background-color: "[[[ return `rgba(var(--color-background-${variables.ulm_card_vertical_button_color}), var(--opacity-bg))`; ]]]"
tap_action:
action: "perform-action"
perform_action: |
[[[
if( entity.entity_id.startsWith("input_select.") )
return "input_select.select_option";
if( entity.entity_id.startsWith("input_boolean.") )
return "input_boolean.toggle";
if( entity.entity_id.startsWith("switch.") )
return "switch.toggle";
if( entity.entity_id.startsWith("light.") )
return "light.toggle";
if( entity.entity_id.startsWith("automation.") )
return "automation.toggle";
if( entity.entity_id.startsWith("input_button.") )
return "input_button.press";
if( entity.entity_id.startsWith("fan.") )
return "fan.toggle";
if( entity.entity_id.startsWith("vacuum.") )
return "vacuum.toggle";
if( entity.entity_id.startsWith("script.") )
return "script.toggle";
if( entity.entity_id.startsWith("button.") )
return "button.press";
if( entity.entity_id.startsWith("lock.") )
if(entity.state == "locked")
return "lock.unlock";
else
return "lock.lock";
// If we need to support other entities we can add these options here.
return "";
]]]
target:
entity_id: "[[[ return entity.entity_id; ]]]"
data:
option: |
[[[
if( entity.entity_id.startsWith("input_select.") )
return variables.ulm_card_vertical_button_state;
]]]

View File

@@ -0,0 +1,49 @@
---
### Card Weather ###
card_weather:
template:
- "ulm_actions_card_overlay"
variables:
ulm_card_weather_backdrop: false
ulm_card_weather_primary_info: "extrema"
ulm_card_weather_secondary_info: "precipitation"
ulm_card_weather_custom:
- temp: "[[[ return entity.attributes.temperature ]]]"
show_icon: false
show_name: false
show_label: false
styles:
grid:
- grid-template-areas: "'item1'"
- grid-template-columns: "1fr"
- grid-template-rows: "min-content"
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "0px"
custom_fields:
item1:
card:
type: "custom:simple-weather-card"
entity: "[[[ return entity.entity_id; ]]]"
name: "[[[ return variables.ulm_card_weather_name || entity.attributes.friendly_name ]]]"
primary_info: "[[[ return variables.ulm_card_weather_primary_info ]]]"
secondary_info: "[[[ return variables.ulm_card_weather_secondary_info ]]]"
backdrop: "[[[ return variables.ulm_card_weather_backdrop ]]]"
custom: "[[[ return variables?.ulm_card_weather_custom ]]]"
card_mod:
style: |
ha-card {
border-radius: 14px;
box-shadow: none;
}
ha-card.type-custom-simple-weather-card {
padding: 24px;
}
ha-card[bg].type-custom-simple-weather-card{
color: white;
}
ha-card.type-custom-simple-weather-card .weather__info {
text-align: left
}

View File

@@ -0,0 +1,205 @@
---
### Card Weather ULM ###
card_weather_ulm:
template:
- "icon_more_info_new"
- "ulm_translation_engine"
variables:
ulm_card_weather_ulm_enable_popup: false
ulm_weather_popup_surpress_first_forecast: false
show_icon: false
show_name: false
show_label: false
styles:
grid:
- grid-template-areas: "'item1' 'item2'"
- grid-template-columns: "1fr"
- grid-template-rows: "1fr 1fr"
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:button-card"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: |
[[[
var state = entity.state;
var icon = {
"clear-night": "mdi:weather-night",
"cloudy": "mdi:weather-cloudy",
"exceptional": "mdi:weather-sunny-alert",
"fog": "mdi:weather-fog",
"hail": "mdi:weather-hail",
"lightning": "mdi:weather-lightning",
"lightning-rainy": "mdi:weather-lightning-rainy",
"partlycloudy": "mdi:weather-partly-cloudy",
"pouring": "mdi:weather-pouring",
"rainy": "mdi:weather-rainy",
"snowy": "mdi:weather-snowy",
"snowy-rainy": "mdi:weather-snowy-rainy",
"sunny": "mdi:weather-sunny",
"windy": "mdi:weather-windy",
"default": "mdi:crosshairs-question"
}
return (icon[state] || icon["default"]);
]]]
variables: >
[[[
let vars = variables;
if(variables.ulm_card_weather_ulm_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_weather_forecast',
'popup_variables': {'ulm_weather_popup_surpress_first_forecast': variables.ulm_weather_popup_surpress_first_forecast}
};
}
return vars;
]]]
styles:
icon:
- color: >
[[[
var state = entity.state;
var icon = {
"clear-night": "rgba(var(--color-yellow),1)",
"cloudy": "rgba(var(--color-blue),1)",
"exceptional": "rgba(var(--color-red),1)",
"fog": "rgba(var(--color-grey),1)",
"hail": "rgba(var(--color-blue),1)",
"lightning": "rgba(var(--color-blue),1)",
"lightning-rainy": "rgba(var(--color-blue),1)",
"partlycloudy": "rgba(var(--color-yellow),1)",
"pouring": "rgba(var(--color-grey),1)",
"rainy": "rgba(var(--color-blue),1)",
"snowy": "rgba(var(--color-blue),1)",
"snowy-rainy": "rgba(var(--color-blue),1)",
"sunny": "rgba(var(--color-yellow),1)",
"windy": "rgba(var(--color-grey),1)",
"default": "rgba(var(--color-grey),1)",
}
return (icon[state] || icon["default"]);
]]]
img_cell:
- background-color: >
[[[
var state = entity.state;
var icon = {
"clear-night": "rgba(var(--color-yellow),0.2)",
"cloudy": "rgba(var(--color-blue),0.2)",
"exceptional": "rgba(var(--color-red),0.2)",
"fog": "rgba(var(--color-grey),0.2)",
"hail": "rgba(var(--color-blue),0.2)",
"lightning": "rgba(var(--color-blue),0.2)",
"lightning-rainy": "rgba(var(--color-blue),0.2)",
"partlycloudy": "rgba(var(--color-yellow),0.2)",
"pouring": "rgba(var(--color-grey),0.2)",
"rainy": "rgba(var(--color-blue),0.2)",
"snowy": "rgba(var(--color-blue),0.2)",
"snowy-rainy": "rgba(var(--color-blue),0.2)",
"sunny": "rgba(var(--color-yellow),0.2)",
"windy": "rgba(var(--color-grey),0.2)",
"default": "rgba(var(--color-grey),0.2)",
}
return (icon[state] || icon["default"]);
]]]
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
show_state: true
styles:
grid:
- grid-template-areas: "'i n' 'i s'"
variables: >
[[[
let vars = variables;
if(variables.ulm_card_weather_ulm_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_weather_forecast',
'popup_variables': {'ulm_weather_popup_surpress_first_forecast': variables.ulm_weather_popup_surpress_first_forecast}
};
}
return vars;
]]]
item2:
card:
type: "custom:button-card"
template: "list_2_items"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:water"
tap_action:
action: "none"
layout: "icon_state"
show_state: false
show_units: false
show_name: false
custom_fields:
item: "[[[ return entity.attributes.humidity + '%' ]]]"
styles:
grid:
- grid-template-areas: "'i item'"
- grid-template-columns: "40% 60%"
card:
- box-shadow: "none"
- padding: "0px"
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "14px"
- place-self: "center"
- height: "42px"
icon:
- color: "rgba(var(--color-theme),0.9)"
img_cell:
- justify-content: "right"
custom_fields:
item:
- text-align: "left"
- font-size: "1rem"
size: "20px"
color: "var(--google-grey)"
item2:
card:
type: "custom:button-card"
entity: "[[[ return entity.entity_id ]]]"
icon: "mdi:thermometer"
tap_action:
action: "none"
layout: "icon_state"
show_state: false
show_units: false
show_name: false
custom_fields:
item: "[[[ return entity.attributes.temperature + entity.attributes.temperature_unit ]]]"
styles:
grid:
- grid-template-areas: "'i item'"
- grid-template-columns: "45% 55%"
card:
- box-shadow: "none"
- padding: "0px"
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "14px"
- place-self: "center"
- height: "42px"
icon:
- color: "rgba(var(--color-theme),0.9)"
img_cell:
- justify-content: "right"
custom_fields:
item:
- text-align: "left"
- font-size: "1rem"
size: "20px"
color: "var(--google-grey)"

View File

@@ -0,0 +1,548 @@
---
card_welcome_scenes:
variables:
ulm_weather: "[[[ return variables.ulm_weather]]]"
ulm_language: "[[[ return hass['language']; ]]]"
entity_1:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_2:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_3:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_4:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_5:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_6:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
entity_7:
entity_id: ""
color: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
template:
- "ulm_language_variables"
- "ulm_translation_engine"
show_icon: false
show_name: false
show_label: true
styles:
grid:
- grid-template-areas: >
[[[
if(variables.ulm_card_welcome_scenes_collapse && states[variables.ulm_card_welcome_scenes_collapse].state == 'on'){
return "\'item1\' \'item2\' ";
} else {
return "\'item1\' \'item2\' \'item3\' \'item4\'";
}
]]]
- grid-template-columns: "1fr"
- grid-template-rows: "min-content min-content"
- row-gap: "0px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "10px"
custom_fields:
item3:
- display: >
[[[
if(variables.ulm_card_welcome_scenes_collapse && states[variables.ulm_card_welcome_scenes_collapse].state == 'on'){
return "none";
} else {
return "block";
}
]]]
item4:
- display: >
[[[
if(variables.ulm_card_welcome_scenes_collapse && states[variables.ulm_card_welcome_scenes_collapse].state == 'on'){
return "none";
} else {
return "block";
}
]]]
custom_fields:
item1:
card:
type: "custom:button-card"
template: "card_topbar_welcome"
variables:
ulm_card_welcome_scenes_collapse: "[[[ return variables.ulm_card_welcome_scenes_collapse ]]]"
ulm_weather: "[[[ return variables.ulm_weather]]]"
ulm_language: "[[[ return variables.ulm_language ]]]"
styles:
card:
- border-radius: "none"
- box-shadow: "none"
- padding: "4px"
item2:
card:
type: "custom:button-card"
show_icon: false
show_label: false
show_name: true
show_entity_picture: false
name: |
[[[
var today = new Date();
var time = today.getHours()
let welcome = '';
if (time >= '18'){
welcome = variables.ulm_evening;
} else if (time >= '12'){
welcome = variables.ulm_afternoon;
} else if (time >= '5'){
welcome = variables.ulm_morning;
} else {
welcome = variables.ulm_hello;
}
return welcome + ', ' + ' <br>' + user.name + '!';
]]]
styles:
name:
- align-self: "start"
- justify-self: "start"
- font-weight: "bold"
- font-size: "24px"
- margin-left: "16px"
grid:
- grid-template-areas: "'i n' 'i l'"
- grid-template-columns: "min-content auto"
- grid-template-rows: "min-content min-content"
- text-align: "start"
card:
- box-shadow: "none"
- padding-bottom: "8px"
item3:
card:
type: "custom:button-card"
show_icon: true
show_label: true
show_name: true
show_entity_picture: false
name: "[[[ return variables.ulm_translation_scenes ]]]"
icon: "mdi:dots-vertical"
styles:
icon:
- height: "20px"
- filter: "opacity(50%)"
name:
- align-self: "start"
- justify-self: "start"
- font-weight: "bold"
- font-size: "18px"
- margin-left: "16px"
grid:
- grid-template-areas: "'n i'"
- grid-template-columns: "6fr 1fr"
- grid-template-rows: "min-content min-content"
- text-align: "start"
card:
- box-shadow: "none"
- padding-bottom: "0px"
- bottom: "10px"
item4:
card:
type: "custom:button-card"
template: >
[[[
if(variables?.entity_1?.entity_id != ""){
return 'card_scenes_welcome'
} else {
return 'card_scenes_welcome_auto'
}
]]]
styles:
card:
- border-radius: "none"
- box-shadow: "none"
- padding: "4px"
variables:
entity_1: "[[[ return variables.entity_1]]]"
entity_2: "[[[ return variables.entity_2]]]"
entity_3: "[[[ return variables.entity_3]]]"
entity_4: "[[[ return variables.entity_4]]]"
entity_5: "[[[ return variables.entity_5]]]"
entity_6: "[[[ return variables.entity_6]]]"
entity_7: "[[[ return variables.entity_7]]]"
card_title_welcome:
tap_action:
action: "none"
show_icon: false
show_label: true
show_name: true
styles:
card:
- background-color: "rgba(0,0,0,0)"
- box-shadow: "none"
- height: "auto"
- width: "auto"
- margin-top: "-10px"
- margin-left: "16px"
- margin-bottom: "-15px"
grid:
- grid-template-areas: "'n' 'l'"
- grid-template-columns: "1fr"
- grid-template-rows: "min-content min-content"
name:
- justify-self: "start"
- font-weight: "bold"
- font-size: "20px"
label:
- justify-self: "start"
- font-weight: "bold"
- font-size: "1rem"
- opacity: "0.4"
# pill
card_scenes_pill_welcome:
show_icon: false
show_label: false
show_name: false
state:
- operator: "template"
value: >
[[[
return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state)
]]]
styles:
card:
- overflow: "visible"
- box-shadow: "none"
styles:
grid:
- grid-template-areas: "'item1' 'item2'"
- grid-template-columns: "min-content"
- grid-template-rows: "1fr 1fr"
- row-gap: "12px"
- justify-items: "center"
- column-gap: "auto"
card:
- border-radius: "50px"
- place-self: "center"
- width: "52px"
- height: "84px"
- box-shadow: >
[[[
if (hass.themes.darkMode){
return "0px 2px 4px 0px rgba(0,0,0,0.80)";
} else {
return "var(--box-shadow)";
}
]]]
color: "var(--google-grey)"
custom_fields:
item1:
card:
type: "custom:button-card"
show_icon: true
show_label: false
show_name: false
tap_action:
action: >
[[[
if(variables?.nav_path){
return "navigate"
}
return "perform-action"
]]]
perform_action: >
[[[
if(entity?.entity_id.startsWith("scene.")){
return "scene.turn_on"
}
if(entity?.entity_id.startsWith("media_player.")){
return "media_player.media_play_pause"
}
if(entity?.entity_id.startsWith("input_select.")){
return "input_select.select_option"
}
if(entity?.entity_id.startsWith("script.")){
return entity.entity_id
}
return "homeassistant.toggle"
]]]
navigation_path: "[[[ return variables?.nav_path; ]]]"
target: |
[[[
if(typeof(entity) !== 'undefined' && entity !== undefined){
return { entity_id: entity?.entity_id };
}
]]]
data: |
[[[
if (variables.service_data){
return variables.service_data
}
if(typeof(entity) !== 'undefined' && entity !== undefined){
if( entity?.entity_id.startsWith("input_select.") )
return { option: variables.state };
}
]]]
styles:
grid:
- grid-template-areas: "i"
icon:
- color: >
[[[
var color = variables?.color
if(hass.themes.darkMode){var color = "#FAFAFA";}
return `rgba(var(--color-${color}), 1)`;
]]]
- width: "20px"
img_cell:
- background-color: >
[[[
var color = variables?.color
var opacity = '0.20'
if(hass.themes.darkMode){var opacity = '1'}
return `rgba(var(--color-${color}), ${opacity})`;
]]]
- border-radius: "50%"
- width: "42px"
- height: "42px"
card:
- box-shadow: "none"
- border-radius: "50px"
- padding: "5px"
state:
- operator: "template"
value: >
[[[
return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state)
]]]
styles:
card:
- overflow: "visible"
- box-shadow: >
[[[
if (hass.themes.darkMode){
return "0px 2px 4px 0px rgba(0,0,0,0.80)";
} else {
return "var(--box-shadow)";
}
]]]
item2:
card:
type: "custom:button-card"
show_icon: false
show_label: false
tap_action:
action: >
[[[
if(variables?.nav_path){
return "navigate"
}
return "perform-action"
]]]
navigation_path: "[[[ return variables?.nav_path; ]]]"
perform_action: >
[[[
if(entity?.entity_id.startsWith("scene.")){
return "scene.turn_on"
}
if(entity?.entity_id.startsWith("media_player.")){
return "media_player.media_play_pause"
}
if(entity?.entity_id.startsWith("input_select.")){
return "input_select.select_option"
}
if(entity?.entity_id.startsWith("script.")){
return entity.entity_id
}
return "homeassistant.toggle"
]]]
target: |
[[[
if(typeof(entity) !== 'undefined' && entity !== undefined){
return { entity_id: entity?.entity_id };
}
]]]
data: |
[[[
if (variables.service_data){
return variables.service_data
}
if(typeof(entity) !== 'undefined' && entity !== undefined){
if( entity?.entity_id.startsWith("input_select.") )
return { option: variables.state };
}
]]]
styles:
grid:
- grid-template-areas: "n"
name:
- justify-self: "center"
- font-weight: "bold"
- font-size: "9.5px"
- padding-bottom: "7px"
- overflow: "[[[return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state) ? 'visible' : 'hidden']]]"
card:
- box-shadow: "none"
- padding: "0px 5px 5px 5px"
- margin-top: "-5px"
- border-radius: "50px"
- overflow: "[[[return (entity?.state !== 'on' && entity?.state !== 'playing' && entity?.state != variables?.state) ? 'visible' : 'hidden']]]"
card_topbar_welcome:
show_icon: false
show_name: false
show_label: false
styles:
grid:
- grid-template-areas: "item1 item2 item3"
- justify-content: "space-between"
- display: "flex"
card:
- border-radius: "none"
- box-shadow: "none"
- padding: "12px"
- background: "none"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "chips"
entity: "[[[ return variables.ulm_card_welcome_scenes_collapse ]]]"
icon: "mdi:chevron-up"
show_icon: true
styles:
grid:
- grid-template-areas: "'i'"
state:
- value: "on"
icon: "mdi:chevron-down"
styles:
icon:
- color: "rgb(var(--color-theme))"
tap_action:
action: "perform-action"
perform_action: "input_boolean.toggle"
target:
entity_id: "[[[ return variables.ulm_card_welcome_scenes_collapse ]]]"
item2:
card:
type: "custom:button-card"
template: "chip_weather_date"
entity: "[[[ return variables.ulm_weather]]]"
variables:
ulm_weather: "[[[ return variables.ulm_weather ]]]"
ulm_language: "[[[ return variables.ulm_language ]]]"
styles:
card:
- width: "100px"
item3:
card:
type: "custom:button-card"
tap_action:
action: "navigate"
navigation_path: "/config/dashboard"
template: "chip_mdi_icon_only"
variables:
ulm_chip_mdi_icon_only_icon: "mdi:cog-outline"
styles:
card:
- align-self: "end"
# auto-entities
card_scenes_welcome_auto:
show_icon: false
show_name: true
show_label: false
variables:
colors: >
[[[
var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
var color = colors[Math.floor(Math.random() * colors.length)];
return color;
]]]
styles:
grid:
- grid-template-areas: "item1"
- display: "flex"
- justify-content: "center"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:auto-entities"
card:
type: "grid"
columns: 5
square: false
card_param: "cards"
sort:
count: 5
filter:
include:
- domain: "light"
options:
type: "custom:button-card"
template: "card_scenes_pill_welcome"
custom_fields:
item1:
card:
type: "custom:button-card"
entity: "this.entity_id"
styles:
icon:
- color: >
[[[
var color = variables.colors
if(hass.themes.darkMode){var color = "#FAFAFA";}
return `rgba(var(--color-${color}), 1)`;
]]]
- width: "20px"
img_cell:
- background-color: >
[[[
var color = variables.colors
var opacity = '0.20'
if(hass.themes.darkMode){var opacity = '1'}
return `rgba(var(--color-${color}), ${opacity})`;
]]]
item2:
card:
type: "custom:button-card"
entity: "this.entity_id"

View File

@@ -0,0 +1,37 @@
---
### chip_alarm ###
chip_alarm:
template:
- "chip_icon_label"
- "ulm_translation_engine"
label: "[[[ return variables.ulm_translation_state ]]]"
icon: |
[[[
var state = entity.state.toLowerCase();
var alarm_icon = {
"default": "mdi:shield-outline",
"armed_home": "mdi:shield-home",
"armed_away": "mdi:shield-lock",
"armed_night": "mdi:shield-moon",
"disarmed": "mdi:shield-off",
"arming": "mdi:shield",
"triggered": "mdi:shield-alert"
}
return (alarm_icon[state] || alarm_icon["default"]);
]]]
styles:
icon:
- color: |
[[[
var state = entity.state.toLowerCase();
var alarm_color = {
"default": "var(--google-yellow)",
"armed_home": "var(--google-red)",
"armed_away": "var(--google-red)",
"armed_night": "var(--google-red)",
"disarmed": "var(--google-green)",
"arming": "var(--google-yellow)",
"triggered": "var(--google-red)"
}
return (alarm_color[state] || alarm_color["default"]);
]]]

View File

@@ -0,0 +1,17 @@
---
### Chip Back ###
chip_back:
template: "chips"
variables:
ulm_chip_back_path: >
[[[
return hass["panelUrl"];
]]]
tap_action:
action: "navigate"
navigation_path: "[[[ return variables.ulm_chip_back_path; ]]]"
show_icon: true
icon: "mdi:arrow-left"
styles:
grid:
- grid-template-areas: "'i'"

View File

@@ -0,0 +1,26 @@
---
### Chip Icon Double State ###
chip_icon_double_state:
template: "chips"
tap_action:
action: "navigate"
navigation_path: "[[[ return variables.ulm_chip_navigate_path; ]]]"
triggers_update:
- "[[[ return variables.ulm_chip_icon_double_state_entity_1 ]]]"
- "[[[ return variables.ulm_chip_icon_double_state_entity_2 ]]]"
label: |
[[[
var icon = "❔";
if (variables.ulm_chip_icon_double_state_icon){
var icon = variables.ulm_chip_icon_double_state_icon;
}
var state1 = "";
if (states[variables.ulm_chip_icon_double_state_entity_1].state){
var state1 = helpers.localize(states[variables.ulm_chip_icon_double_state_entity_1])
}
var state2 = "";
if (states[variables.ulm_chip_icon_double_state_entity_2].state){
var state2 = helpers.localize(states[variables.ulm_chip_icon_double_state_entity_2])
}
return icon + " " + state1 + " • " + state2;
]]]

View File

@@ -0,0 +1,23 @@
---
## Chips Icon Label ###
chip_icon_label:
template: "chips"
show_icon: true
size: "100%"
styles:
card:
- padding-top: "6px"
- padding-button: "6px"
- padding-left: "12px"
grid:
- grid-template-areas: "'i l'"
- grid-template-columns: "max_content auto"
- grid-template-rows: "min-content"
img_cell:
- place-self: "center"
- width: "14px"
- height: "24px"
label:
- font-size: "12px"
- margin-left: "0px"
- margin-top: "0px"

View File

@@ -0,0 +1,12 @@
---
### Chip Icon Only ###
chip_icon_only:
template: "chips"
label: |
[[[
var icon = "❔";
if (variables.ulm_chip_icon_only){
var icon = variables.ulm_chip_icon_only;
}
return icon;
]]]

View File

@@ -0,0 +1,18 @@
---
### Chip Icon State ###
chip_icon_state:
template: "chips"
triggers_update:
- "[[[ return variables.ulm_chip_icon_state_entity ]]]"
label: |
[[[
var icon = "❔";
if (variables.ulm_chip_icon_state_icon){
var icon = variables.ulm_chip_icon_state_icon;
}
var state = "";
if (states[variables.ulm_chip_icon_state_entity].state){
var state = helpers.localize(states[variables.ulm_chip_icon_state_entity]);
}
return icon + " " + state;
]]]

View File

@@ -0,0 +1,14 @@
---
### Chip Mdi Icon Only ###
chip_mdi_icon_only:
template: "chips"
tap_action:
action: "more-info"
entity: "[[[ return variables.ulm_chip_mdi_icon_only_entity ]]]"
show_icon: true
icon: "[[[ return variables.ulm_chip_mdi_icon_only_icon ]]]"
styles:
grid:
- grid-template-areas: "'i'"
icon:
- color: "[[[ return variables.ulm_chip_mdi_icon_only_icon_color; ]]]"

View File

@@ -0,0 +1,26 @@
---
### Chip Mdi Icon State ###
chip_mdi_icon_state:
template: "chips"
tap_action:
action: "more-info"
entity: "[[[ return variables.ulm_chip_mdi_icon_state_entity ]]]"
triggers_update:
- "[[[ return variables.ulm_chip_mdi_icon_state_entity ]]]"
show_icon: true
icon: "[[[ return variables.ulm_chip_mdi_icon_state_icon ]]]"
label: |
[[[
var state = "";
if (states[variables.ulm_chip_mdi_icon_state_entity].state){
var state = helpers.localize(entity)
}
return state;
]]]
styles:
grid:
- grid-template-areas: "'i l'"
icon:
- color: "[[[ return variables.ulm_chip_mdi_icon_state_icon_color; ]]]"
label:
- color: "[[[ return variables.ulm_chip_mdi_icon_state_label_color; ]]]"

View File

@@ -0,0 +1,16 @@
---
### Chip Navigate ###
chip_navigate:
template: "chips"
tap_action:
action: "navigate"
navigation_path: "[[[ return variables.ulm_chip_navigate_path; ]]]"
show_icon: true
icon: "[[[ return variables.ulm_chip_navigate_icon; ]]]"
styles:
grid:
- grid-template-areas: "'i l'"
icon:
- color: "[[[ return variables.ulm_chip_navigate_icon_color; ]]]"
label:
- color: "[[[ return variables.ulm_chip_navigate_label_color; ]]]"

View File

@@ -0,0 +1,18 @@
---
### Chip Power Consumption ###
chip_power_consumption:
template:
- "chips"
- "ulm_translation_engine"
triggers_update:
- "[[[ return variables.ulm_chip_electric_price ]]]"
- "[[[ return variables.ulm_chip_electric_consumption ]]]"
label: |
[[[
var amount = variables.ulm_chip_electric_price != "" ? true : false
if (amount){
return "⚡ " + states[variables.ulm_chip_electric_price].state + variables.ulm_translation_currency;
} else {
return "⚡ " + helpers.localize(states[variables.ulm_chip_electric_consumption]);
}
]]]

View File

@@ -0,0 +1,15 @@
---
### Chip Presence Detection ###
chip_presence_detection:
template: "chips"
triggers_update:
- "[[[ return variables.ulm_chip_presence_counter_residents ]]]"
- "[[[ return variables.ulm_chip_presence_counter_guests ]]]"
label: |
[[[
if (!!variables.ulm_chip_presence_counter_guests) {
return "🏠 " + states[variables.ulm_chip_presence_counter_residents].state + " / " + states[variables.ulm_chip_presence_counter_guests].state;
} else {
return "🏠 " + states[variables.ulm_chip_presence_counter_residents].state;
}
]]]

View File

@@ -0,0 +1,20 @@
---
chip_short_date_with_day:
template: "chips"
variables:
ulm_language: >
[[[
return hass["language"];
]]]
triggers_update: "all"
label: |
[[[
var locale = variables.ulm_language;
let dt = new Intl.DateTimeFormat(locale , {
weekday: "short",
day: "numeric",
month: "short"
});
let formatted_date = dt.format(Date.now())
return formatted_date
]]]

View File

@@ -0,0 +1,49 @@
---
### Chip Temperature ###
chip_temperature:
template:
- "chips"
- "ulm_actions_card"
variables:
ulm_card_weather_enable_popup: false
triggers_update:
- "[[[ return variables.ulm_chip_temperature_weather ]]]"
- "[[[ return variables.ulm_chip_temperature_outside ]]]"
- "[[[ return variables.ulm_chip_temperature_inside ]]]"
label: |
[[[
var state = states[variables.ulm_chip_temperature_weather].state;
var icon = {
"clear-night": "🌙",
"cloudy": "☁️",
"exceptional": "🌞",
"fog": "🌫️",
"hail": "⛈️",
"lightning": "⚡",
"lightning-rainy": "⛈️",
"partlycloudy": "⛅",
"pouring": "🌧️",
"rainy": "💧",
"snowy": "❄️",
"snowy-rainy": "🌨️",
"sunny": "☀️",
"windy": "🌪️",
"default": "🌡️"
}
function convertTemperature(temp) {
if (parseFloat(temp) == temp && Math.floor(temp) != temp) {
return parseFloat(temp).toFixed(1);
}
return temp;
}
var outside_temp = states[variables.ulm_chip_temperature_outside].state;
var inside_temp = null;
if (variables.ulm_chip_temperature_inside) {
inside_temp = states[variables.ulm_chip_temperature_inside].state;
}
var label = (icon[state] || icon["default"]) + " " + convertTemperature(outside_temp) + "°";
if (inside_temp) {
label = label + " / " + convertTemperature(inside_temp) + "°";
}
return label;
]]]

View File

@@ -0,0 +1,39 @@
---
chip_weather_date:
template: "chips"
entity: "[[[ return variables.ulm_weather]]]"
variables:
ulm_language: >
[[[
return hass["language"];
]]]
triggers_update:
- "[[[ return variables.ulm_weather ]]]"
tap_action:
action: "more-info"
label: |
[[[
const event = new Date();
const options = {month: 'short', day: 'numeric' };
var locale = variables.ulm_language;
let formatted_date = event.toLocaleDateString(locale, options);
var state = states[variables.ulm_weather].state;
var icon = {
"clear-night": "🌙",
"cloudy": "☁️",
"exceptional": "🌞",
"fog": "🌫️",
"hail": "⛈️",
"lightning": "⚡",
"lightning-rainy": "⛈️",
"partlycloudy": "⛅",
"pouring": "🌧️",
"rainy": "💧",
"snowy": "❄️",
"snowy-rainy": "🌨️",
"sunny": "☀️",
"windy": "🌪️",
"default": "🌡️"
}
return (icon[state] || icon["default"]) + ' ' + formatted_date
]]]

View File

@@ -0,0 +1,17 @@
---
### Blue No Card ###
blue_no_card:
state:
- styles:
icon:
- color: "rgba(var(--color-blue),1)"
label:
- color: "rgba(var(--color-blue-text),1)"
name:
- color: "rgba(var(--color-blue-text),1)"
img_cell:
- background-color: "rgba(var(--color-blue), 0.2)"
card:
- background-color: "rgba(0,0,0,0)"
id: "on"
value: "on"

View File

@@ -0,0 +1,12 @@
---
### Blue No State ###
blue_no_state:
styles:
icon:
- color: "rgba(var(--color-blue),1)"
label:
- color: "rgba(var(--color-blue-text),1)"
name:
- color: "rgba(var(--color-blue-text),1)"
img_cell:
- background-color: "rgba(var(--color-blue), 0.2)"

View File

@@ -0,0 +1,14 @@
---
blue_off:
state:
- styles:
icon:
- color: "rgba(var(--color-blue),1)"
label:
- color: "rgba(var(--color-blue-text),1)"
name:
- color: "rgba(var(--color-blue-text),1)"
img_cell:
- background-color: "rgba(var(--color-blue), 0.2)"
value: "off"
id: "off"

View File

@@ -0,0 +1,20 @@
---
blue_on:
state:
- styles:
icon:
- color: "rgba(var(--color-blue),1)"
label:
- color: "rgba(var(--color-blue-text),1)"
name:
- color: "rgba(var(--color-blue-text),1)"
img_cell:
- background-color: "rgba(var(--color-blue), 0.2)"
card:
- background-color: "rgba(var(--color-background-blue), var(--opacity-bg))"
id: "on"
value: "on"
# Legacy
blue:
template: "blue_on"

View File

@@ -0,0 +1,11 @@
---
green_no_state:
styles:
icon:
- color: "rgba(var(--color-green),1)"
label:
- color: "rgba(var(--color-green-text),1)"
name:
- color: "rgba(var(--color-green-text),1)"
img_cell:
- background-color: "rgba(var(--color-green), 0.2)"

View File

@@ -0,0 +1,14 @@
---
green_off:
state:
- styles:
icon:
- color: "rgba(var(--color-green),1)"
label:
- color: "rgba(var(--color-green-text),1)"
name:
- color: "rgba(var(--color-green-text),1)"
img_cell:
- background-color: "rgba(var(--color-green), 0.2)"
value: "off"
id: "off"

View File

@@ -0,0 +1,20 @@
---
green_on:
state:
- styles:
icon:
- color: "rgba(var(--color-green),1)"
label:
- color: "rgba(var(--color-green-text),1)"
name:
- color: "rgba(var(--color-green-text),1)"
img_cell:
- background-color: "rgba(var(--color-green), 0.2)"
card:
- background-color: "rgba(var(--color-background-green), var(--opacity-bg))"
value: "on"
id: "on"
# Legacy
green:
template: "green_on"

View File

@@ -0,0 +1,11 @@
---
grey_no_state:
styles:
icon:
- color: "rgba(var(--color-grey),1)"
label:
- color: "rgba(var(--color-grey-text),1)"
name:
- color: "rgba(var(--color-grey-text),1)"
img_cell:
- background-color: "rgba(var(--color-grey), 0.2)"

Some files were not shown because too many files have changed in this diff Show More