Giter VIP home page Giter VIP logo

entities_calendar's Introduction

Entities Calendar

A custom component for Home Assistant to allow regular entities to be used as a calendar

Installation

Via HACS

Simply search for Entities Calendar in HACS.

Testing pre-release features

Some new features may be made available in beta versions. To use these you need to enable betas for this integration in HACS. This can be done by toggling on the "Show beta versions" option when installing. If you have already installed it and want to enable betas, do the following:

  • Open HACS
  • Find the Entities Calendar integration under the Integrations tab
  • Click the three dots menu button
  • Select Reinstall from the menu
  • Toggle on “Show beta versions”
  • Select the latest beta version
  • Click Install

Basic Configuration

calendar:
  - platform: entities_calendar
    calendars:
      - name: Bin Collection
        entities:
          - entity: sensor.bin_collection_general
            name: General Waste Collection
          - entity: sensor.bin_collection_recycling
            name: Recycling Collection
          - entity: sensor.bin_collection_garden
            name: Garden Waste Collection
      - name: Other Entities
        entities:
          - entity: sensor.other_entity1
          - entity: sensor.other_entity2
          - entity: sensor.other_entity3

Event start and end time

By default the start and end time of the event will be determined based on the device_class attribute of the entity:

Device class "timestamp"

These will create all-day calendar events using the state of the sensor as the date.

Other device classes

These will create all-day events based on the last_changed attribute.

This can be overridden by using the start_time and/or end_time options.

Entity Configuration Options

Option Description
entity (Required) The entity id of the entity
name (Optional) The name to use for the event (defaults to the friendly name of the entity)
start_time (Optional) A time object as defined below specifying how the start time is determined (defaults are determined based on device class)
end_time (Optional) A time object as defined below specifying how the end time is determined (defaults are determined based on device class)

time object

Option Description
timestamp_in_state (Optional) Setting this to true forces the state to be used for the start/end time event if the device class is not "timestamp"
timestamp_attribute (Optional) Setting this to the name of an attribute will use that for the time (even for "timestamp") entities

Example

Given three sensors:

  • sensor.attribute_test - a sensor with a start_time and end_time attribute
  • sensor.state_test - a sensor with a timestamp in the state but without a device_class of "timestamp"
  • sensor.default_test - a sensor with a device_class of "timestamp"

The following configuration would be used:

calendar:
  - platform: entities_calendar
    calendars:
      - name: Entities
        entities:
          - entity: sensor.attribute_test
            name: Attribute Test
            start_time:
              timestamp_attribute: start_time
            end_time:
              timestamp_attribute: end_time
          - entity: sensor.state_test
            name: State Test
            start_time:
              timestamp_in_state: true
            end_time:
              timestamp_in_state: true
          - entity: sensor.default_test
            name: Default Test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.