Giter VIP home page Giter VIP logo

ninja-daylight's Introduction

ninja-daylight

Ninjablocks driver that offers time to sunrise and time to sunset counters for your location and time

The driver calculates sun rise and set time from your position, so you can use precise day or night time information in your rules. The driver behaves like a temperature sensor, giving a new value every ten minutes. The values offered reprent the time remaining (in minutes) for the next sun event. Minutes to sunset during the day and minutes remaining to sunrise (negative) during night. You can choose negative values for events at night or positive for events at day time.

Installation

  • cd into your drivers directory (/opt/ninja/drivers on the block or client/drivers/ on Mac OS X)
cd /opt/ninja/drivers
  • And clone the repository:
git clone git://github.com/pablorodiz/ninja-daylight.git
  • Once the clone is over, cd into the driver directory and install it:
cd ninja-daylight
sudo npm install
  • Restart your block
sudo reboot
  • Once your block has restarted, you should then see a new text input Widget appear on your Dashboard and a new "temperature like" sensor for your rules will be also available.

Dependencies

Ninjablocks daylight driver extensively depends on SunCalc utilities for node.js https://github.com/mourner/suncalc

ninja-daylight's People

Contributors

pablorodiz avatar wichtounet avatar

Stargazers

 avatar

Watchers

 avatar

ninja-daylight's Issues

temperature widget reporting

The values shown in the widget are only correct if you have Celsius selected in your preferences, not Fahrenheit. Any ideas on how to address this?

Minutes until sun events are off if the system timezone is set correctly

I started using this module on my Ninjablock and saw that the minutes till sunset and sunrise were off by about a hundred. I checked the config, my latitude/longitude was set up correctly.

My Ninjablock's system timezone was set for my location (CEST). I was suspecting this to be the root of the problem and I think I was right: commenting out the following lines of lib/device.js fixed the problem:

sunrise_today.addMinutes(-now.getTimezoneOffset());
sunrise_tomorrow.addMinutes(-tomorrow.getTimezoneOffset());
sunset_today.addMinutes(-now.getTimezoneOffset());

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.