Skip to content

Timeflow card v2.0.0

Choose a tag to compare

@Rishi8078 Rishi8078 released this 22 Jul 20:13

πŸš€ TimeFlow Card v2.0.0 - Major Template System Release

✨ Major New Features

🎯 Complete Home Assistant Template Support

  • Full Jinja2 template evaluation for all card properties
  • Smart fallback handling with automatic extraction from template expressions
  • Template result caching (5-second cache) for optimal performance
  • Dual API support (callApi + callWS) for maximum compatibility

πŸ“‹ Template-Enabled Properties

All card properties now support Home Assistant templates:

  • title - Dynamic titles based on entity states
  • subtitle - Smart subtitle generation
  • target_date - Dynamic countdown targets
  • creation_date - Dynamic start dates
  • color - State-based text colors
  • background_color - Dynamic background themes
  • progress_color - Conditional progress colors

πŸ”§ Supported Template Patterns

# Simple OR fallback
title: "{{ states('sensor.event_name') or 'Default Event' }}"

# Chained OR fallback
title: "{{ states('sensor.primary') or states('sensor.backup') or 'Fallback' }}"

# Conditional expressions
color: "{{ '#ff0000' if states('sensor.temperature')|float > 30 else '#00ff00' }}"

# Dynamic dates
target_date: "{{ states('input_datetime.deadline') }}"

# Complex conditionals
background_color: "{{ '#87CEEB' if state_attr('sun.sun', 'elevation') > 0 else '#191970' }}"

🎨 Real-World Examples

Dynamic Sunrise/Sunset Countdown

type: custom:timeflow-card
title: "{{ 'Next Sunrise' if states('sun.sun') == 'below_horizon' else 'Next Sunset' }}"
target_date: "{{ state_attr('sun.sun', 'next_rising') if states('sun.sun') == 'below_horizon' else state_attr('sun.sun', 'next_setting') }}"
color: "{{ '#FFD700' if states('sun.sun') == 'below_horizon' else '#FF6347' }}"

Event Countdown with Urgency Colors

type: custom:timeflow-card
title: "{{ states('input_text.event_name') or 'My Event' }}"
target_date: "{{ states('input_datetime.event_time') }}"
background_color: "{{ '#FF0000' if (as_timestamp(states('input_datetime.event_time')) - now()) < 86400 else '#1976d2' }}"

Weather-Responsive Styling

type: custom:timeflow-card
title: "Weekend Getaway"
target_date: "2025-08-01T15:00:00"
color: "{{ '#ff4444' if states('sensor.temperature')|float > 30 else '#4444ff' }}"
background_color: "{{ '#87CEEB' if states('weather.home') == 'sunny' else '#778899' }}"

πŸ”„ Backward Compatibility

  • βœ… 100% backward compatible - existing configurations work unchanged
  • βœ… Progressive enhancement - templates are completely optional
  • βœ… No breaking changes to current functionality
  • βœ… Seamless migration from v1.x

πŸ“š Documentation

Template support follows Home Assistant standards:

  • Compatible with all Jinja2 template functions
  • Supports states(), state_attr(), now(), filters
  • Works with custom template functions and macros

🎯 Migration Guide

From v1.x to v2.0.0:
No changes required! Your existing configuration will continue working exactly as before.

To use new template features:
Simply wrap any property value in {{ }} with your template expression.

πŸ™ Credits

Template system inspired by and compatible with:

  • Home Assistant's native template engine
  • button-card template patterns
  • mushroom-card template syntax

Full Changelog: v1.0.0...v2.0.0

Installation: Available through manual installation
Compatibility: Home Assistant 2023.4+
Browser Support: All modern browsers

This release transforms TimeFlow Card from a static countdown timer into a fully dynamic, template-driven component that adapts to your Home Assistant state in real-time! 🏠⏰✨