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

forked-daapd-homebridge-middleware

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

For use in conjunction with

to play your favourite radio stations with just a voice command and control multiple output devices.

Examples:

  • "Hey Siri, start ROCK ANTENNE"
  • "Hey Siri, start [YOUR_FAVOURITE_RADIO_STATION]"
  • "Hey Siri, turn on Speaker in Hallway"
  • "Hey Siri, turn off [SPEAKER_NAME] in [ROOM_NAME]"
  • You can use the brightness setting to control the output volume: "Hey Siri, set brightness of [SPEAKER_NAME] in [ROOM_NAME] to 70%"

Overview

This package acts like a standalone proxy server which endpoints get to be called by the homebridge-better-http-rgb plugin.The plugin is responsible for then advertising the various accessories to homebridge (see config.json).The middleware is using the amazing forked-daapd JSON APIto control the various accessories and redirect their actions to forked-daapd. Therefore it is possible to advertise almostany forked-daapd action to HomeKit.

Prerequisites

  • Node.js >= v10.15.1 with npm >= v6.4.1
  • forked-daapd >= v26.4 available in your local network
  • homebridge >= v0.4.46 with homebridge-better-http-rgb >= v2.0.0 plugin available in your local network
  • At least one output device (AirPlay, Chromecast, etc) in your local network which can be controlled by forked-daapd
  • At least one playlist with an internet radio stream url in it, available in your forked-daapd library

Installation and execution

Option 1: Installing as npm dependency

$ mkdir forked-daapd-homebridge-middleware
$ npm init
$ npm install --save forked-daapd-homebridge-middleware

For the npm init command answer all questions with [ENTER] key.

Configuration

See configuration.

Run as npm dependency

$ cd forked-daapd-homebridge-middleware
$ npx forked-daapd-homebridge-middleware

Option 2: Installing as separate project

$ git clone https://github.com/moecre/forked-daapd-homebridge-middleware.git
$ cd forked-daapd-homebridge-middleware
$ npm install

Configuration

See configuration.

Run as separate project

$ cd forked-daapd-homebridge-middleware
$ npm start

Running with PM2

In production I strongly advise you to use a process manager like PM2 to run forked-daapd-homebridge-middleware.In case anything unexpected happens the middleware is going to be restarted automatically by PM2.

By the way, that's a good solution for your Homebridge process, too.

Configuration

Create forked-daapd-homebridge-middleware configuration file

Copy the distributed index.dist.json to index.json in the same directory and change the fileaccording to your setup and needs.

Param Description
baseUrl URL to your forked-daapd JSON API

Adding your accessories to Homebridge

Please take a look at the provided config.json for examples. In general your Homebridgeconfiguration file is located in ~/.homebridge/config.json.

Radio station

Please replace placeholders, eg. {NAME YOUR RADIO STATION} for ROCK ANTENNE. Keep in mind that the name mustbe unique over all your accessories (UUID in Homebridge).

{
  "accessory": "HTTP-RGB",
  "name": "{NAME YOUR RADIO STATION}",
  "service": "Light",
  "switch": {
    "status": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/playlists/{URL ENCODED NAME OF THE PLAYLIST IN FORKED-DAAPD}",
    "powerOn": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/playlists/{URL ENCODED NAME OF THE PLAYLIST IN FORKED-DAAPD}/play[?shuffle=true]",
    "powerOff": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/player/stop"
  }
}

The /playlists/:playlist/play endpoint has an optional parameter shuffle. If applied all the playlist items get added to the queue shuffled.

Speaker (output device)

Please replace placeholders, eg. {NAME YOUR SPEAKER} for Hallway speaker. Keep in mind that the name must beunique over all your accessories (UUID in Homebridge).

{
  "accessory": "HTTP-RGB",
  "name": "{NAME YOUR SPEAKER}",
  "service": "Light",
  "switch": {
    "status": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/outputs/{URL ENCODED NAME OF OUTPUT DEVICE IN FORKED-DAAPD}",
    "powerOn": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/outputs/{URL ENCODED NAME OF OUTPUT DEVICE IN FORKED-DAAPD}/state/on",
    "powerOff": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/outputs/{URL ENCODED NAME OF OUTPUT DEVICE IN FORKED-DAAPD}/state/off"
  },
  "brightness": {
     "status": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/outputs/{URL ENCODED NAME OF OUTPUT DEVICE IN FORKED-DAAPD}/volume",
     "url": "http://{HOSTNAME ON WHICH FORKED-DAAPD-HOMEBRIDGE-MIDDLEWARE IS RUNNING}:3000/outputs/{URL ENCODED NAME OF OUTPUT DEVICE IN FORKED-DAAPD}/volume/%s"
  }
}

How to create playlists in your forked-daapd server

Please have a look here.

 相关资料
  • Homebridge 是一个轻量级 NodeJS 服务器,它模拟 iOS HomeKit API,提供从 HomeKit 到“智能家居”设备制造商提供的各种第三方 API 的基本桥接。通过 Homebridge 的桥接,可以让 Siri 控制完全不支持 HomeKit 的设备。 此外 Homebridge 支持插件。

  • homebridge-vsx homebridge-vsx is a plugin made for homebridge,which allows switching on and off your Pioneer AV receiver. All AV receivers (VSX and SC),which work with the iControl AV5 App are support

  • homebridge-sesame Control and monitor your Sesame smart lock with HomeKit integration. Prerequisites Installation of Homebridge iOS 11 or later Sesame lock with enabled cloud integration Sesame Wifi A

  • homebridge-panasonictv A homebridge plugin for turning on and off your Panasonic Viera TV. The plugin also has experimental support for changing the volume and channel. These characteristics are not r

  • Quick Start | Contribute A Wake on Lan plugin for Homebridge Turn your PCs, laptops, servers and more on and off through Siri Quick Start To install the plugin, head over to the machine with Homebridg

  • Docker Homebridge This Alpine/Ubuntu Linux based Docker image allows you to run Nfarina's Homebridge on your home network which emulates the iOS HomeKit API. This is a multi-arch image and will also r