Git Product home page Git Product logo

homebridge-logic's Introduction

homebridge-logic

npm npm GitHub last commit

This is a plugin for homebridge to create powerful variables like timers and counters within homekit. You can download it via npm.

Feel free to leave any feedback here.

What can I do with this plugin?

  • Add variables to homekit.
  • Remove variables from homekit.
  • Define options for variables.
  • Do all this from within homekit without the need to configure the variables in a file.
  • Do all this during runtime without the need to restart homebridge.
  • List and use variables.
  • Utilize the variables in homekit rules.

Variable types and options

  • Timer (Days, Hours, Minutes, Seconds)
  • Counter (Min, Max, Count up, Count down)
  • Switch (On, Off)
  • Text (Value, Readonly)

Coming soon

  • Event (Date, Time)
  • Recurring Event (Day of month, Weekday, Hour, Minute, Second)

Compatible Homekit Apps

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-logic
  3. Update your configuration file. See the sample below.

Configuration

Add the following information to your config file. Set a writable folder as cache directory.

"platforms": [
	{
		"platform": "Logic",
		"name": "Logic",
		"cacheDir": "/var/lib/homebridge/logic"
	}
]

Troubleshooting

I cannot add my variable

Check if a variable with the same name already exists.

My added variable does not show up in the list

In the current Eve app you have to change the room twice and then open the variable list again to a refresh it.

Example use cases

Find and add your own here here

Screenshots

Choose a variable type to add

Variable types to add

Define variable options

Define variable options for counter Define variable options for timer

List and use your variables

List and use your variables

Remove a variable

Remove a variable

(c) Screenshots are taken from Elgato Eve app

homebridge-logic's People

Contributors

naofireblade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-logic's Issues

Persistent variables. Possible?

Hello,

I need to do some logic that I think requires a persistent variable.
If amps of watts of a certain accessory is above 10 amps for more than 10 mins= set homebridge accessory. Can this plugin do something like that?
Many thanks!

Timer not working after homebridge restart

Solution: When starting a timer, store the calculated end time in the cache. When loading from cache after a homebridge restart, start the timer with the seconds until the calculated end time. Remove end time from timer in cache after timer ends.

Home app visualization?

Just a little wish.
It’s possible to have an option these variables of the Logic-plugin are NOT visible in the Home App start / favorites screen. An extra button “Shown in favorites” on/off?

Edit variables

A way to edit and renaming existing variables would be useful.

Interesting, but unclear how to use

This seems like a very interesting idea with a lot of potential, but I couldn't really get it to work. I've been using statefuldummy switches to do basic logic: like indicate if a scene is active to use as a conditional for automations to run.

Here's an example usage: when you see motion in the bedroom, turn on the hot water pump for 15m, but only if the Night Scene is not set (the is the dummy switch, turned on by the Night Scene and off by all other scenes). For this you need both the Eve and Apple Home apps. Eve lets you set multiple value conditionals (motion detected + dummy switch showing Night Scene off). Home lets you create custom one-off scenes that you can turn off after a period of time (turn on the pump, turn off after 15 minutes). So together, they can accomplish it.

But I can see where timers and specifically date-based switches would be very useful. For example: you could set a "vacation" variable that ends on a specific date, which can be used to disable various automations around the home until that date arrives. I could probably do this with a "vacation" scene and a dummy switch (without the date-based switching). But it will get complicated fast.

In any case, a short tutorial with more information would be useful. I eventually discovered you can use the Eve app, go to Settings->Accessories->New Counter/Text/Timer, where you can add and rename variables. But they don't then show up anywhere for use in Rules, for example. I couldn't find out how to actually use these variables.

Also, for counters, etc., are they implemented by HomeKit, or does your plugin actually perform the logic (increment/decrement the counters)?

Thanks for an interesting homebridge plugin.

Unable to remove the variable devices from the main home page of the home app

I want to remove the devices created but he plugin from the main home page of the iOS app but when I inspect the settings they do not have an "include in favorites" switch so it appears impossible to remove them. I the app, they are listed as "not supported." I don't know if that is related but I've never see a device show that before and I've also never seen a device not have an "include in favorites" switch.

This is from iOS 14.3, iPadOS 14.3 and MacOS 11.1

Error in wiki

You say you support the Home app but the link goes to a third party app.

New Variable: Event

A switch that triggers on a specific date (e.g. 31.12.2017 0:00)

Options

  • Year
  • Month
  • Day
  • Hours
  • Minutes
  • Seconds

New Variable: Recurring Event

A switch that triggers on a recurring date (e.g. Monday 7:00 or every hour and at minute 30).

Options

  • day of month (1-31, any)
  • weekday (mon-sun, any)
  • hour (0-24, any)
  • minute (0-60, any)

Delete variable not working?

Using Eve app, I select Remove Variable. Then at Name, I enter the name of an existing variable. Then select "On" on the next line. But the variable persists.

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.