• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

keybuk/homebridge-sun-position: Homebridge plugin to expose the position of the ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

keybuk/homebridge-sun-position

开源软件地址:

https://github.com/keybuk/homebridge-sun-position

开源编程语言:

JavaScript 100.0%

开源软件介绍:

homebridge-sun-position

npm npm

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:

Characteristics Automation

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




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
gyuque/SNESZoi: SNES homebrew test发布时间:2022-06-14
下一篇:
MoeweX/homebridge-octoprint: Octoprint Plugin for Homebridge发布时间:2022-06-14
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap