Giter Site home page Giter Site logo

appliance-sensor's Introduction

Appliance Sensor Custom Component for Home Assistant

This custom component for Home Assistant allows you to monitor the power usage of home appliances, count the number of times they have been turned on during the current day, and forecast future usage based on historical data. The component includes several sensors:

  • Appliance Sensor: Determines if the appliance is on or off based on a power threshold and hysteresis time.
  • Appliance Sensor On Counter: Counts the number of times the appliance has been turned on during the current day and resets at midnight.
  • Appliance Sensor Peak Power: Tracks the peak power usage of the appliance and resets at midnight.
  • Appliance Sensor Energy Consumption: Tracks the energy consumption in kWh and resets at midnight.
  • Appliance Sensor Runtime: Tracks the runtime of the appliance and resets at midnight.

Features

  • Appliance Sensor: Uses power threshold and hysteresis time to determine if an appliance is on or off.
  • Appliance Sensor On Counter: Tracks the number of times the appliance is turned on each day and resets the count at midnight.
  • Appliance Sensor Peak Power: Monitors the peak power usage of the appliance and resets at midnight.
  • Appliance Sensor Energy Consumption: Calculates energy consumption in kWh and resets at midnight.
  • Appliance Sensor Runtime: Records the total runtime of the appliance and resets at midnight.

Installation

  1. Download and Extract:

    • Download the latest release of the custom component from the GitHub releases page.
    • Extract the contents of the zip file to your Home Assistant custom_components directory.
  2. Directory Structure: Ensure your directory structure looks like this:

    config
    └── custom_components
        └── appliance_sensor
            ├── __init__.py
            ├── const.py
            ├── config_flow.py
            ├── manifest.json
            ├── sensor.py
            ├── strings.json
            └── translations
                └── en.json
    
  3. Restart Home Assistant:

    • Restart Home Assistant to recognize the new custom component.

Configuration

The custom component can be configured via the Home Assistant GUI.

  1. Add Integration:

    • Go to Configuration > Devices & Services.
    • Click on Add Integration and search for Appliance Sensor.
    • Follow the on-screen instructions to configure the integration.
  2. Configuration Options:

    • Entity ID: The entity ID of the power sensor that monitors the appliance.
    • Threshold: The power threshold above which the appliance is considered to be on.
    • Hysteresis Time: The time (in seconds) the power must remain below the threshold before the appliance is considered off.

Example Configuration

Here is an example of how to configure the custom component using YAML (if needed):

sensor:
  - platform: appliance_sensor
    devices:
      - entity_id: sensor.appliance_power
        threshold: 10.0
        hysteresis_time: 60

Debugging and Logging

For debugging purposes, you can enable logging for this custom component by adding the following to your configuration.yaml:

logger:
  default: warning
  logs:
    custom_components.appliance_sensor: debug

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

This custom component was inspired by the need to monitor and count appliance usage in a smart home setup. Special thanks to the Home Assistant community for their continuous support and development.

appliance-sensor's People

Contributors

doig007 avatar

Stargazers

 avatar

Watchers

 avatar

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.