当前位置: 首页 > 软件库 > 其他开源 > 物联网 >

homebridge-sun-position

授权协议 Readme
开发语言 JavaScript
所属分类 其他开源、 物联网
软件类型 开源软件
地区 不详
投 递 者 苍志文
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

homebridge-sun-position

This is a plugin for Homebridge to create a HomeKit accessory representing the position of the sun in the sky.

The intended use is with automation rules when combined with accessories such as window coverings, to adjust their position based on the true position of the sun.

You can download it from npm.

Installation

  1. Install and setup Homebridge.

  2. Install this plugin:

npm install -g homebridge-sun-position
  1. Add a SunPosition accessory to your Homebridge config.json, providing the latitude and longitude of your location:
    "accessories" : [
        {   
            "accessory" : "SunPosition",
            "name" : "Sun",
            "location" : {
            	"lat" : 37.2343,
            	"long" : -115.8067
            }
        }
    ]

Screenshots

A single "Sun" accessory is added to your home, represented as a Light Sensor; the lux values are somewhat arbitrary and are based on the current phase of the day. HomeKit requires a recognized service for automation, and this seemed like the closest thing.

To use the Altitude and Azimuth characteristics, you will need an app such as Matthias Hochgatterer's Home - Smart Home Automation app. Using this app you can see the current position of the sun, and create automations based on it:

CharacteristicsAutomation

Usage

To use this plugin you need to be reasonably comfortable with HomeKit automation, and understand the differences between Triggers and Conditions, and their limitations.

As of iOS 11.3, Threshold Range Event triggers do not seem to work with custom characteristics. Fortunately you can still check for Any Change, and combine that with conditions to verify the range.

If your HomeKit Automation app does not allow you to set two different conditions for the same characteristic, simply create two Sun accessories (Sun A and Sun B) in your config.json.

In addition, a trigger's End Event only seems to support Time Events, and not full characteristics as documented. You will need a second automation to "undo" the first, use a dummy switch such as from homebridge-dummy to track the state.

Here is an example of rules to close window blinds when the sun shines through a South-facing window, and open them again once it passes:

Close Blinds

Triggers:
Sun Azimuth Any Change

Conditions:
Sun Azimuth ≥ 115.0°
Sun Azimuth < 235.0°

Actions:
Set Scene blinds down
Set Dummy Switch on

Open Blinds

Triggers:
Sun Azimuth Any Change

Conditions:
Sun Azimuth ≥ 235.0°
Dummy Switch = on

Actions:
Set Scene blinds up
Set Dummy Switch off

More advanced rules can be created by combing the azimuth and altitude of the sun, and by combing weather information such as from homebridge-weather-extended.

He is an example for west-facing blinds that, only on a sunny day, come down in two phases based on the altitude of the sun, and go back up again once it's behind the houses or hills.

Half-close Blinds

Triggers:
Sun Azimuth Any Change

Conditions:
Weather Condition Category = 0
Sun Azimuth ≥ 220.0°
Sun Altitude ≤ 50.0°
Sun Altitude > 30.0°

Actions:
Set Scene blinds half down
Set Dummy Switch on

Fully-close Blinds

Triggers:
Sun Azimuth Any Change

Conditions:
Weather Condition Category = 0
Sun Azimuth ≥ 220.0°
Sun Altitude ≤ 30.0°
Sun Altitude > 10.0°

Actions:
Set Scene blinds fully down
Set Dummy Switch on

Open Blinds at Sunset

Triggers:
Sun Azimuth Any Change

Conditions:
Sun Azimuth ≥ 220.0°
Sun Altitude ≤ 10.0°
Dummy Switch = on

Actions:
Set Scene blinds up
Set Dummy Switch off

Open Blinds when Cloudy

Triggers:
Weather Condition Category Any Change

Conditions:
Weather Condition Category > 0
Dummy Switch = on

Actions:
Set Scene blinds up
Set Dummy Switch off

 相关资料
  • Sun SPOT 是一个为传感器网络和供电电池、无线通讯、嵌入式开发之开源硬件和软件平台。

  • 问题内容: 在JRE中,Sun的内部软件包以2个顶级域(sun和com)为前缀。例如, 对我来说,他们选择哪个前缀似乎很随意。我很好奇Sun为此使用了什么规则。 问题答案: “ com.sun”约定是更可取的格式,因为它遵循为命名Java软件包而建立的“命名约定”。 http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html 您

  • 问题内容: 我尝试通过tomcat7运行我的项目。jax ws maven插件生成了我的Web服务的wsdl文件后(成功生成),但尝试在浏览器中查看wsdl文件,但未得到结果。 我试图通过tomcat7服务器运行我的项目,但出现此错误,并且我没有解决此问题的方法,这是我的错误: 任何建议,解决方案…谢谢 问题答案: 在即将上课的地方加罐子。 同样存在于 尝试将这些jar添加到服务器/库中,或将其与

  • 我正在使用pdfbox(pdfbox-app-2.0.0-RC3.jar)将文件转换为文件。我也在使用jodconverter-2.2.1.jar库。 我写的代码(如下所示): 任何摆脱这种情况的想法都将受到欢迎。

  • SUN公司专业的Java系统消息服务器,分为平台版和企业版,平台版可以免费使用,但是不支持一些高级特性例如集群等等。 下载地址:http://www.sun.com/download/index.jsp?cat=Application%20%26%20Integration%20Services&tab=3&subcat=Integration%20Services

  • 您知道Netbeans如何决定应用程序范围内的资源使用哪个文件名:sun资源。xml或glassfish资源。xml?此名称是可配置的还是硬编码的? 据我所知,GlassFish支持太阳资源.xml向后兼容。但根据《应用部署指南》首选文件名是玻璃鱼资源.xml。 我使用GlassFish 4.1运行相对较新版本的Netbean-8.0.2,但我生成sun-resources.xml文件。这看起来很