Git Product home page Git Product logo

homebridge-harmony's Introduction

homebridge-harmony

verified-by-homebridge

npm npm npm

Build Status code style: prettier CodeFactor

Known Vulnerabilities

Support via PayPal

Logitech Harmony plugin for HomeBridge using WebSockets.

You can discuss this plugin on Discord in #harmony channel

Discord Status

This plugin is publishing harmony hub activities and devices as switches, with some advanced option (see below) for custom needs like macros, sequences, and much more. The TV mode is focused on harmony hub activities only at the moment : each activity of the hub is mapped to an input. A main activity is linked to the on/off switch of the accessory. Buttons on the remote app and volume controls will be binded to the one defined in the activity (if so). VOLUME IS BIND TO PHYSICAL BUTTONS WHEN REMOTE FROM CONTROL CENTER IS SHOWN . There is an option to override default mappings.

Note

Installation

  1. Install Homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-harmony
  3. Update your Homebridge config.json using the sample below.

Note about homebridge configuration

Since this plugin can expose external accessories (TV), you should probably set ports configuration in your homebridge conf with a dedicated range, like this :

    "ports": {
        "start": 52100,
        "end": 52150,
        "comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to."
      },

Also, if you use child Bridge (since Homebridge 1.3.0), it makes sense only if you publish switches / bridges accessories. If you are only running a default TV accessory, it will publish an empty bridge that might be confusing (see #347 for more details)

Migration from 0.X to 1.X

You have to move your other platforms if you have more than one in a new key : "otherPlatforms": [{ }] , see sample below. The plugin MUST be adde donly One time in your config

  1. TV mode is now the default. If you want switches, use option switchAccessories (or activitiesToPublishAsAccessoriesSwitch )
  2. You have to rename skipedIfSameStateActivities to skippedIfSameStateActivities (with 2 p ) or addAllActivitiesToSkipedIfSameStateActivitiesList to addAllActivitiesToSkippedIfSameStateActivitiesList (also with 2 p ) if you were using one of those options.
  3. You have to rename publishActivitiesAsIndividualAccessories to publishSwitchActivitiesAsIndividualAccessories
  4. You have to modify devicesToPublishAsAccessoriesSwitch option if you were using it, see details below
  5. If you were overriding MENU through remoteOverrideCommandsList you have to use SETUP instead now (since it is in the settings of the remote).

In case of any trouble like accessories allready added (or missing), you can try to use the option cleanCache but please report in order for me to fix if possible (see Fields section).

To setup mutliple tv platorm, you will have to add others manually in homekit. Other ones (than the first one) won't be cached. See publishAllTVAsExternalAccessory for details.

Configuration samples

Simple Config (only TV Accessory)

"platforms": [
  {
    "platform": "HarmonyHubWebSocket",
    "name": "HubName",
    "hubIP": "192.168.1.XX"
  }
]

Only switch mode

"platforms": [
  {
    "platform": "HarmonyHubWebSocket",
    "name": "HubName",
    "TVAccessory" : false,
    "switchAccessories" : true
  }
]

Mutliple hubs - fixedIP

"platforms": [
  {
    "platform": "HarmonyHubWebSocket",
    "name": "HubName",
    "hubIP": "192.168.1.XX",
    "otherPlatforms": [{
      "name": "OtherHubName",
      "hubIP": "192.168.1.YY"
      }]
  }
]

Mutliple hubs - using harmonyNames

"platforms": [
  {
    "platform": "HarmonyHubWebSocket",
    "name": "HubName",
    "hubName": "myFirstHub",
    "otherPlatforms": [{
      "name": "OtherHubName",
      "hubName": "mySecondHub",
      }]
  }
]

Fields:

  • platform GLOBAL must be "HarmonyHubWebSocket" (required).

  • publishAllTVAsExternalAccessory GLOBAL publish all TV accessory as external Accessories. This way, if another plugin on the same homebridge instance as one, the one on harmony will also be visible, but you will have to add them manually after the hub itself. Defaults to TRUE (if set to false, only second tv accessory or following will be published by this plugin as external accessories, first one will be linked to the hub and might not display a TV icon).

  • cleanCache GLOBAL option to clean all cached Accessory. Please use with caution, might be needed if you change names / config of the hub and there is some ghost devices in Homekit. Be sure that all your icloud sync is done while launching Homebridge with this option set to true. Set it back to false after and launch again ! It does not affect external accessories.

  • DELAY_BEFORE_RETRY_AFTER_NETWORK_LOSS GLOBAL retry timer in case of network loss (optionnal - defaults 60s).

  • HUB_CONNECT_TIMEOUT GLOBAL connect timeout (optionnal - defaults 10s).

  • HUB_SEND_TIMEOUT GLOBAL send timeout (optionnal - defaults 30s).

  • name is the name of the published Platform (required).

  • hubName is the name of your hub in harmony app (optional, but mandatory if you have mutliple hubs). In case both hubName and hubIP are not set, it will discover your hub automatically, providing there is only one

  • hubIP is the static IP address of the hub (optional). A static IP address is required.

  • TVAccessory publish hub with its activities as a TV Accessory (defaults to true).

  • sortInput sort input list in TV accessory : 0-default,1:Alpha,2:activityOrder property of hub, 3:activitiesToPublishAsInputForTVMode order (defaults to 0).

  • switchAccessories publish all activities as a Switch Accessory (defaults to false).

  • activitiesToPublishAsAccessoriesSwitch array of Activities you want to expose as switches (all by default if switchAccessories is set to true, otherwise specify the list you want)

  • showTurnOffActivity configures whether to publish a "switch" accessory to turn off every activity (defaults to false).

    • if you set to true, The "switch" will be "on" if and only if there is no current activity, and toggling it while "on" does nothing.
    • if you set to "inverted", The "switch" will be "off" if and only if there is no current activity, and toggling it while "off" does nothing.
    • if you set to "stateless", it will always be off, but can be triggered to switch off current activity.
  • skippedIfSameStateActivities array of Activities name to trigger only if their state is different from the action sent. Can be useful if your devices in the activity have the same on / off command and you want to automate them outside off the home app. For TV mode, and PowerOff feature, "PowerOff" is added by default, but you have to add it manually to this list if this list is set.

  • addAllActivitiesToSkippedIfSameStateActivitiesList option to add all activities automatically to skippedIfSameStateActivities behavior. (defaults : false)

  • publishSwitchActivitiesAsIndividualAccessories option to publish activities as individual accessories. Defaults to true.

  • devicesToPublishAsAccessoriesSwitch array of Devices to exposes with on/off function or custom functions

  • publishDevicesAsIndividualAccessories option to publish devices as individual accessories. Defaults to true.

  • sequencesToPublishAsAccessoriesSwitch array of Sequences to exposes through a switch.

  • publishSequencesAsIndividualAccessories option to publish sequences as individual accessories. Defaults to true.

  • homeControlsToPublishAsAccessoriesSwitch array of home controls you want to publish as switches

  • publishHomeControlsAsIndividualAccessories option to publish home controls as individual accessories. Defaults to true.

  • mainActivity set the mainactivity of the TV mode

  • playPauseBehavior play/pause behavior in TV mode : if set to true, will send pause if played was set and vice-verca. Be aware that both commands must be available, and that it might be out of sync in case of external events (defaults : false - always send play command)

  • configureAccesscontrol configure Access control service (false by default)

  • publishGeneralMuteSwitch publish a mute switch, stateless, that will send a mute command to current activity.

  • publishGeneralVolumeSlider publish a volume slider, stateless, that will send a volume commands to current activity. Approximativley, it will send an Up / Down Volume command each 5%. It can be combined with numberOfCommandsSentForVolumeControl option to multiply the number of up / down commands sent.

  • publishGeneralVolumeSwitches publish switches, stateless, for volume up / down on TV Accessory. It can be combined with numberOfCommandsSentForVolumeControl option to multiply the number of up / down commands sent.

  • linkVolumeControlToTVlinks mute / volume switch to TV accessory if present

  • remoteOverrideCommandsList option to override default commands mapping in TV Platform Mode. See below for format.

  • activitiesToPublishAsInputForTVMode array of Activities you want to expose as inputs (all by default)

  • numberOfCommandsSentForVolumeControl option to set the number of commands to send for each volum (up or down) press. Defaults to 1

  • showCommandsAtStartup show commands and device losts at startup (defaults to false)

  • otherPlatforms is an array of hubs platform . All option are available except GLOBAL ones

All devices / Activites names are the one configured in harmony configuration, even if you rename them in home app.

Option devicesToPublishAsAccessoriesSwitch is an array that behaves this way :

  • You should put the name of the device as it is named in harmony app,
  • You can add a specific command or multiple ones JUST AFTER A ";" or a series of ";" if you want a switch to be added for this specific command or serie of commands (a default delay of 350ms will be added between each command if no sepecif delay is specified),
  • If you do not specify any specific command, the plugin will add either powerToggle if found in Power command group, or PowerOn and/or PowerOff if there is no powerToggle feature,

As a sample :

  "devicesToPublishAsAccessoriesSwitch" : ["Apple TV Gen 4|Button1;Play","Apple TV Gen 4;DirectionDown","Caisson","Sony PS4","MyDevice;Up;Up|2500;Down"]

will add

  • a switch for "Apple TV Gen 4" "Play" command, named Button1,
  • a switch for "Apple TV Gen 4" "DirectionDown" command,
  • a powerToggle switch for the device named "Caisson",
  • a powerOff switch only for PS4 (since there is no powerToggle nor powerOn command for it)
  • a switch that will send Up , then Up, then wait 2.5 seconds, then send Down to MyDevice

All commands available are displayed at startup. If no name is specified, it will be added with a generated name.

If you use a "/", it will do a non stateless switch and send commands before the / on On, and after on Off. Be aware that it can be out of sync .

As a sample :

  "devicesToPublishAsAccessoriesSwitch" : ["Apple TV Gen 4|Button1;Play/Pause","Caisson;/","Sony PS4;/","MyDevice;/","MyDevice;Up;Up|2500;Down/Down;Down|2500;Up"]

will add

  • a switch for "Apple TV Gen 4" "Play" command on on, "Pause" command on off, named Button1,
  • a powerToggle switch for the device named "Caisson", which will send PowerToggle on on and off,
  • a powerOff switch only for PS4 (since there is no powerToggle nor powerOn command for it) - thus no effect
  • a switch that will PowerOn on On and PowerOff on off to MyDevice since it doe not have a powerToggle and have both powerOn / PowerOff
  • a switch that will send Up , then Up, then wait 2.5 seconds, then send Down to MyDevice on On and reverse on Off

Option sequencesToPublishAsAccessoriesSwitch is an array that behaves this way :

  • You should put the name of the sequence as it is named in harmony app,

As a sample :

   "sequencesToPublishAsAccessoriesSwitch" : ["Test"]

will expose the sequence Test as a button.

See Logitech Harmony Sequence Configuration for sequences configuration.

Please note that the sequence can only be triggered if its activity is in use. (Sequences are linked to an activity by design in harmony app).

Option remoteOverrideCommandsList is an array that behaves this way :

  • You should put the name of the activity as it is named in harmony app,
  • Then an Array CommandsList with :
    • the name of the command you want to override
    • the commands like in devicesToPublishAsAccessoriesSwitch (with the name of the device first)
  "remoteOverrideCommandsList": [
      {
        "ActivityName": "La TV",
        "CommandsList": [
          {
            "CommandName": "PAUSE",
            "NewCommand": "Ampli;Number0;Number0"
          },
          {
            "CommandName": "BACK",
            "NewCommand": "TV;Back"
          }
        ]
      },
      {
        "ActivityName": "Un Film",
        "CommandsList": [
          {
            "CommandName": "ARROW_LEFT",
            "NewCommand": "TV;PreviousChannel"
          }
        ]
      }
    ]

will bahaves this way :

  • for "La TV" activity :
    • override PAUSE button in the remote with Number0 command for Ampli device, and send it 5 times
    • override BACK button in the remote with Back Command of TV device
  • for "Un Film" activity :
    • override ARROW_LEFT in the remote with PreviousChannel of TV device

Button List is :

  • REWIND
  • FAST_FORWARD
  • NEXT_TRACK
  • PREVIOUS_TRACK
  • ARROW_UP
  • ARROW_DOWN
  • ARROW_LEFT
  • ARROW_RIGHT
  • SELECT
  • BACK
  • EXIT
  • INFORMATION
  • PLAY
  • PAUSE
  • VOLUME_UP
  • VOLUME_DOWN
  • MUTE
  • SETUP

Commands of your device is shown in the log at startup in lines like : 'INFO - Command : COMMAND_NAME discovered for device : DEVICENAME'

Changelog

See CHANGELOG.

Inspiration

Thanks to

  • iandday for the Harmoney WebSocket protocol implementation and understanding of it.
  • lopelex for his clean plugin.
  • every tester / contributor that test, and give feedback in any way , and especially
    • gitgayhub for Home controls in 0.6.0
    • donavanbecker for testing multiple hubs auto discovery (and supporting homebirdge :) )

Donating

Support this project and others by nicoduj via PayPal.

Support via PayPal

License

As of Dec 01 2018, Nicolas Dujardin has released this repository and its contents to the public domain.

It has been released under the UNLICENSE.

homebridge-harmony's People

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

homebridge-harmony's Issues

Add an option to expose devices as individual tv platform accessories

For tv platform mode - equivalent to #15
On/off, keys and volume if available
The goal of this fetaure would be to match all device individualy to a remote, with inputs if avaliable and other commands that could be mapped the same way it is for activities, but at a device level

You can vote if you want it :)

Harmony control of HomeKit scenes?

I'm looking for a way to trigger HomeKit scenes from buttons on my Harmony. It looks like this plugin is designed in the opposite direction, triggering Harmony activities from HomeKit.

Is what I'm looking for possible?

homebridge failed to start on 0.2.4 upgrade - TypeError: Service.Television is not a constructor

just upgraded to 0.2.4 release via npm, seeing below on restart of homebridge.

Feb  3 14:28:51 vpie systemd[1]: Started Node.js HomeKit Server.
Feb  3 14:28:53 vpie homebridge[3896]: [2019-2-3 14:28:53] Loaded config.json with 1 accessories and 1 platforms.
Feb  3 14:28:53 vpie homebridge[3896]: [2019-2-3 14:28:53] ---
Feb  3 14:28:54 vpie homebridge[3896]: [2019-2-3 14:28:54] Loaded plugin: homebridge-harmony
Feb  3 14:28:54 vpie homebridge[3896]: [2019-2-3 14:28:54] Registering platform 'homebridge-harmonyHub.HarmonyHubWebSocket'
Feb  3 14:28:54 vpie homebridge[3896]: [2019-2-3 14:28:54] ---
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] Loaded plugin: homebridge-thermometer-am2320
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] Registering accessory 'homebridge-am2320.AM2320'
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] ---
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] Loading 1 platforms...
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] [vHarmonyHub] Initializing HarmonyHubWebSocket platform...
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] [vHarmonyHub] PlatformMode : true
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] [vHarmonyHub] Loading activities...
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] Loading 1 accessories...
Feb  3 14:28:55 vpie homebridge[3896]: [2019-2-3 14:28:55] [Sensor] Initializing AM2320 accessory...
Feb  3 14:28:55 vpie homebridge[3896]: AM23280 sensor options: {"i2cBusNo":1,"i2cAddress":92,"temperature":{"rate":1},"humidity":{"rate":1}}
Feb  3 14:28:56 vpie homebridge[3896]: data = {
Feb  3 14:28:56 vpie homebridge[3896]:   "temperature": 20.9,
Feb  3 14:28:56 vpie homebridge[3896]:   "humidity": 27.8
Feb  3 14:28:56 vpie homebridge[3896]: }
Feb  3 14:28:56 vpie homebridge[3896]: [2019-2-3 14:28:56] [vHarmonyHub] Creating Main TV Service
Feb  3 14:28:56 vpie homebridge[3896]: /usr/lib/node_modules/homebridge-harmony/harmonyAsTVPlatform.js:117
Feb  3 14:28:56 vpie homebridge[3896]:       controlService: new Service.Television(that.name, 'tvService'),
Feb  3 14:28:56 vpie homebridge[3896]:                       ^
Feb  3 14:28:56 vpie homebridge[3896]: TypeError: Service.Television is not a constructor
Feb  3 14:28:56 vpie homebridge[3896]:   at HarmonyPlatformAsTVPlatform.readAccessories (/usr/lib/node_modules/homebridge-harmony/harmonyAsTVPlatform.js:117:23)
Feb  3 14:28:56 vpie homebridge[3896]:   at harmonyPlatform.wsp.onUnpackedMessage.addListener.data (/usr/lib/node_modules/homebridge-harmony/harmonyBase.js:283:33)
Feb  3 14:28:56 vpie homebridge[3896]:   at Timeout._onTimeout (/usr/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/dist/index.js:2:4404)
Feb  3 14:28:56 vpie homebridge[3896]:   at ontimeout (timers.js:498:11)
Feb  3 14:28:56 vpie homebridge[3896]:   at tryOnTimeout (timers.js:323:5)
Feb  3 14:28:56 vpie homebridge[3896]:   at Timer.listOnTimeout (timers.js:290:5)
Feb  3 14:28:56 vpie systemd[1]: homebridge.service: Main process exited, code=exited, status=1/FAILURE
Feb  3 14:28:56 vpie systemd[1]: homebridge.service: Unit entered failed state.
Feb  3 14:28:56 vpie systemd[1]: homebridge.service: Failed with result 'exit-code'.

homebrige config:

"platforms": [

	   {
		"platform": "HarmonyHubWebSocket",
		"name": "HarmonyHub",
		"hubIP": "192.168.20.2",
		"TVPlatformMode" : true,
		"mainActivity" : "Watch Apple TV"
	   }

	]

Plugin Loading Error

Hello,

I saw a previous error related to what I have, but did not see a clear resolution.

I just uninstalled the old HarmonyHub plugin and installed yours using:

sudo npm install -g homebridge-harmony

config.json has:

{
"platform": "HarmonyHubWebSocket",
"name": "HarmonyHub",
"hubIP": "192.168.86.38",
"showTurnOffActivity" : true,
"turnOffActivityName" : "HT Off"
},

Node.js version is
npm node -v
4.2.0

and I am getting this error when launching HomeBridge:

12/28/2018, 4:08:32 PM] ====================
[12/28/2018, 4:08:32 PM] ERROR LOADING PLUGIN homebridge-harmony:
[12/28/2018, 4:08:32 PM] /usr/lib/node_modules/homebridge-harmony/index.js:29
);
^
SyntaxError: Unexpected token )
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Plugin.load (/usr/lib/node_modules/homebridge/lib/plugin.js:72:22)
[12/28/2018, 4:08:32 PM] ====================

Any Thoughts?

New option accessories

How should the entry for the folder (/var/homebridge-harmony/accessories/) in the config.json be?

[2019-1-27 15:02:32] [Harmony Ultimate] Initializing platform accessory 'Blu-ray wiedergeben'... /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:266 throw new Error("Cannot add a bridged Accessory with the same UUID as another bridged Accessory: " + existing.UUID); ^ Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 18cb95b1-a0e6-49c2-80ba-52b714c28019 at Bridge.Accessory.addBridgedAccessory (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:266:13) at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:399:24) at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:16:19 at that.wsp.onUnpackedMessage.addListener.data (/usr/local/lib/node_modules/homebridge-harmony/index.js:208:17) at Timeout.apply [as _onTimeout] (/usr/local/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/dist/webpack:/WebSocketAsPromised/node_modules/chnl/es5/channel.js:230:1) at listOnTimeout (timers.js:324:15) at processTimers (timers.js:268:5) homebridge-harmony.service: Main process exited, code=exited, status=1/FAILURE homebridge-harmony.service: Unit entered failed state. homebridge-harmony.service: Failed with result 'exit-code'. Stopped Node.js HomeKit homebridge-harmony.

(Im down to 0.0.9)

Thanks

Multiple Instances of everything!

Hi! I just installed this plugin to target one of my two Hubs. That hub has 5 activities:

  • Listen to Music
  • Blu-Ray
  • Apple TV
  • Shield TV
  • Nintendo Switch

However, after adding it to my HomeKit this shows up:
img_8383

I have 3 instances of "Apple TV" and multiple of the rest. Only one of the "Apple TV" switches work. The rest do nothing.

Here is my config file:

{
    "bridge": {
        "name": "HomebridgePi",
        "username": "CC:23:3D:E4:CE:32",
        "port": 51464,
        "pin": "031-45-157"
    },
    "description": "This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.",
    "accessories": [],
    "platforms": [
        {
            "platform": "HarmonyHubWebSocket",
            "name": "HarmonyLivingRoom",
            "hubIP": "10.0.1.32",
            "showTurnOffActivity": false,
            "refreshTimer": 30
        }
    ]
}

Here here is the log:

[2019-1-25 15:30:32] Homebridge is running on port 51464.
[2019-1-25 15:30:34] [homebridge-config-ui-x] Homebridge restart request received
[2019-1-25 15:30:34] [homebridge-config-ui-x] Executing restart command: killall -9 homebridge && killall -9 homebridge-config-ui-x
[2019-1-25 15:30:40] [homebridge-config-ui-x] Using Form Authentication
[2019-1-25 15:30:40] [homebridge-config-ui-x] Console v3.9.3 is listening on port 8180.
[2019-1-25 15:30:42] Loaded config.json with 0 accessories and 1 platforms.
[2019-1-25 15:30:42] ---
[2019-1-25 15:30:43] Loaded plugin: homebridge-dummy
[2019-1-25 15:30:43] Registering accessory 'homebridge-dummy.DummySwitch'
[2019-1-25 15:30:43] ---
[2019-1-25 15:30:44] Loaded plugin: homebridge-harmony
[2019-1-25 15:30:44] Registering platform 'homebridge-harmonyHub.HarmonyHubWebSocket'
[2019-1-25 15:30:44] ---
[2019-1-25 15:30:44] Loaded plugin: homebridge-config-ui-x
[2019-1-25 15:30:44] Registering platform 'homebridge-config-ui-x.config'
[2019-1-25 15:30:44] ---
[2019-1-25 15:30:44] Loading 1 platforms...
[2019-1-25 15:30:44] [HarmonyLivingRoom] Initializing HarmonyHubWebSocket platform...
[2019-1-25 15:30:44] [HarmonyLivingRoom] Loading activities...
[2019-1-25 15:30:44] Loading 0 accessories...
Failed to find plugin to handle accessory Harmony Hub 2
Failed to find plugin to handle accessory Harmony Hub Living Room
Failed to find plugin to handle accessory Harmony Hub 2
[2019-1-25 15:30:45] [HarmonyLivingRoom] Discovered Activity : Listen to Music
[2019-1-25 15:30:45] [HarmonyLivingRoom] Discovered Activity : Blu-Ray
[2019-1-25 15:30:45] [HarmonyLivingRoom] Discovered Activity : Apple TV
[2019-1-25 15:30:45] [HarmonyLivingRoom] Discovered Activity : SHIELD TV
[2019-1-25 15:30:45] [HarmonyLivingRoom] Discovered Activity : Nintendo Switch
[2019-1-25 15:30:45] [HarmonyLivingRoom] Initializing platform accessory 'HarmonyLivingRoom'...
Setup Payload:
X-HM://0023ISYX1CH4E
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐
    │ 031-45-157 │
    └────────────┘

[2019-1-25 15:30:46] Homebridge is running on port 51464.
[2019-1-25 15:33:32] [HarmonyLivingRoom] Apple TV activated

Do you have any idea what may be going on here?

Non Responsive

Harmony TV didn't do anything when switching on and off. Below is what showed on my log. Reboot fixed the issue

8:56:07 PM] [Harmony] ERROR - refreshCurrentActivity : RefreshCurrentActivity : Error: Can't send data because WebSocket is not opened.
[2/6/2019, 8:56:07 PM] [Harmony] ERROR - activityCommand : Error: Can't send data because WebSocket is not opened.
[2/6/2019, 8:56:19 PM] [Harmony] ERROR - activityCommand : Error: Can't send data because WebSocket is not opened.
[2/6/2019, 8:56:26 PM] [Harmony] ERROR - refreshCurrentActivity : RefreshCurrentActivity : Error: Can't send data because WebSocket is not opened.
[2/6/2019, 8:56:26 PM] [Harmony] ERROR - activityCommand : Error: Can't send data because WebSocket is not opened.
[2/6/2019, 8:56:32 PM] [Harmony] ERROR - activityCommand : Error: Can't send data because WebSocket is not opened.
[2/6/2019, 8:56:42 PM] [Harmony] ERROR - activityCommand : Error: Can't send data because WebSocket is not opened.

Plugin loading error

I have encountered errors of loading the plugin:

[12/28/2018, 12:46:28 PM] ERROR LOADING PLUGIN homebridge-harmony:
[12/28/2018, 12:46:28 PM] /usr/local/lib/node_modules/homebridge-harmony/index.js:29
);

SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Plugin.load (/usr/local/lib/node_modules/homebridge/lib/plugin.js:72:22)

  throw new Error("The requested platform '" + name + "' was not registered by any plugin.");

Error: The requested platform 'HarmonyHubWebSocket' was not registered by any plugin.
at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:122:13)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:315:45)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:85:36)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:43:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:502:3

With the configuration:

"platforms": [
{
"platform": "HarmonyHubWebSocket",
"name": "HarmonyHub",
"hubIP": "192.168.1.99",
"showTurnOffActivity" : true,
"turnOffActivityName" : "AV Off"
},
{
"platform": "HarmonyHubWebSocket",
"name": "HarmonyHub2",
"hubIP": "192.168.1.98"
}
]

Homebridge Crash when turning off activity

Hi team

When turning off activity using the same activity button in the home app, my homebridge crash (see error message bellow) .

I don't really understand why .. If someone can help me understand the issue ?

Thanks for your support

/usr/local/lib/node_modules/homebridge-harmony/index.js:454
'Turning on off Activity ' + serviceControl.displayName
^
TypeError: Cannot read property 'displayName' of undefined
at wsp.onUnpackedMessage.addListener.data (/usr/local/lib/node_modules/homebridge-harmony/index.js:454:65)
at Timeout.apply [as _onTimeout] (/usr/local/lib/node_modules/homebridge-harmony/node_modules/websocket-as-promised/dist/webpack:/WebSocketAsPromised/node_modules/chnl/es5/channel.js:230:1)
at ontimeout (timers.js:427:11)
at tryOnTimeout (timers.js:289:5)
at listOnTimeout (timers.js:252:5)
at Timer.processTimers (timers.js:212:10)

error after a while

ERROR - refreshCurrentActivity : RefreshCurrentActivity : Error: Can't send data because WebSocket is not opened.

Failed to find plugin to handle accessory Harmony Hub

Failed to find plugin to handle accessory Harmony Hub
Failed to find plugin to handle accessory Harmony Hub
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 23
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Watch TV
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 24
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater ON
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 21
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 27
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 20
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 26
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 25
[12/24/2018, 11:27:20 AM] [Harmony Hub] Discovered Activity : Heater 22
[12/24/2018, 11:27:20 AM] [Harmony Hub] Initializing platform accessory 'Harmony Hub'...

once added homebridge won't respond

I originally got this plugin to work great with my tcl, however now it won't let any accessories respond once added. if you can help at all please do i really love this plugin plus i only got the hub to do this specifically

Failed to start with WebSocket closed: connection failed (1006) with 0.3.x+

I'm seeing this behavior when i try to install anything higher than 0.2.7 Looks like the new harmony-websocket library doesn't like something in my environment. Any hints for more info I can/should provide to help troubleshoot?

[2/10/2019, 1:57:26 PM] [Living Room Harmony] Loading activities...
[2/10/2019, 1:57:27 PM] [Living Room Harmony] Error retrieving info from hub : WebSocket closed with reason: connection failed (1006).
[2/10/2019, 1:57:29 PM] [Living Room Harmony] Loading activities...
[2/10/2019, 1:57:30 PM] [Living Room Harmony] Error retrieving info from hub : WebSocket closed with reason: connection failed (1006).
[2/10/2019, 1:57:31 PM] [Living Room Harmony] Loading activities...
[2/10/2019, 1:57:33 PM] [Living Room Harmony] Error retrieving info from hub : WebSocket closed with reason: connection failed (1006).
[2/10/2019, 1:57:34 PM] [Living Room Harmony] Loading activities...
[2/10/2019, 1:57:36 PM] [Living Room Harmony] Error retrieving info from hub : WebSocket closed with reason: connection failed (1006).

HomeKit TV Profile Support

Hey, how realistic is it that you could get this plugin working with TV profile support? I know Khoas Tian has updated hap-nodejs and homebridge to support them:

https://twitter.com/KhaosT/status/1088678984970162176

But not sure how trivial that would be on your end to integrate. Obviously would be awesome to have a “proper” TV device that supports volume and direction keypads instead of multiple switches.

12.2 beta features not working?

I installed the plugin, and added the two additional parameters to my config file, but I’m still just getting a normal switch for my activity in the Home app. I’m running the 12.2 beta and the latest version of homebridge (46). Any suggestions on what to check to further diagnose?

Better default naming

See if there is a way to have simple names (without breaking multiple hub support)

Switching Activities

Hi, Thanks for the plugin.
I have a small issue, when switching from one activity to the another activity i.e TV to Movies, in the Home APP, the previous Activity remains ON, while the selected Activity is ON too..

Any advice?

Activities still showing in Home.app after removal from Harmony

Activities that previously existed but have been deleted in the Harmony app and thus from the hub are still showing in HomeKit. This may or may not be a problem with homebridge-harmony directly.

I have of course restarted home bridge, rebooted the server (Pi), upgraded both Homebridge and this plugin.

Looking for a troubleshooting path to follow. I am unable to find any config settings related to this. Please advise.

Multiple hubs not populating Apple TV Control Centre menu

Using the new TV Mode I've added two hubs (Lounge and Master Bedroom) to my config and they both show up in Home correctly and work flawlessly pretty much. But only one is showing up when I go into the control centre option for AppleTV. If I remove the one that is showing from the config.json the other one will replace it, but if I add it back in again it won't re-appear. I'm currently running 10.15.1 of nodeJS, Homebridge 0.4.46, and 0.2.7 of this plugin. I've got this setup as it's own separate Homebridge server so I've tried removing the bridge from Home, purging the cached and accessories folder and setting it up from scratch a few times. Any ideas?

(also side question.. does this mode support tv volume yet? If so where do I find it?)

Device switches see to not work

I see all my Logitech devices listed as switches (in addition to activities) in homekit but using the switches does not toggle devices on and of. Is this a work in progress and can the list of devices be filtered out?

(The older harmony-hub npm did not so a list of devices, only activities.)

No inputs available, HomeKit

Just installed the plugin. On my iPhone, using iOS 12.2 beta the TV accessory shows. However the input selection is empty... Under settings i can see the two activities i have, with a gray «V» on the left side of each input/activity.

Can't move accessories from two hubs into two different rooms

I have two harmony hubs which i use in two different rooms. However, all the activities appear in one room on my iPhone. When I move one activity from one room, it moves them all leaving no Harmony activities in the original room. Any ideas how to fix?

Thanks in advance!

  • David

Activities re-added when restarting HomeBridge

Hi,
Thanks for the great plugin!
I'd like to report an issue which I noticed recently. It seems that when I restart HomeBridge sometimes Harmony activities are "re-added" to HomeKit, they appear in default room and are gone from all automations. I didn't have this issue earlier on, so not sure if something introduced recently.

connect ECONNREFUSED

I am not sure what I am doing wrong. Could anyone help?

[1/16/2019, 6:09:41 PM] Loaded config.json with 0 accessories and 1 platforms.
[1/16/2019, 6:09:41 PM] ---
[1/16/2019, 6:09:43 PM] Loaded plugin: homebridge-harmony
[1/16/2019, 6:09:43 PM] Registering platform 'homebridge-harmonyHub.HarmonyHubWebSocket'
[1/16/2019, 6:09:43 PM] ---
[1/16/2019, 6:09:43 PM] Loading 1 platforms...
[1/16/2019, 6:09:43 PM] [Harmony Hub] Initializing HarmonyHubWebSocket platform...
[1/16/2019, 6:09:43 PM] [Harmony Hub] Loading activities...
[1/16/2019, 6:09:43 PM] [Harmony Hub] Error retrieving info from hub : connect ECONNREFUSED 192.168.1.62:8088

Trigger activity switching only if current state changed

Hello and thank you for the new Harmony plugin and your work.

I have the problem, if I incorporate an activity or the off switch in a scene that when running the scene, the devices are turned on if they have been previously turned off. The problem is that many devices only have one IR command for on and off. HomeKit does not check the real status of the device. Each command is sent when the scene is executed.

I used this pull request in the old homebridge-harmonyhub plugin to solve the problem.
KraigM/homebridge-harmonyhub#88

I hope that you also have the possibility for your plugin to install an option to solve the problem?

Thank you, I am looking forward to your answer.

Greeting Nastra

Integrate devices into homebridge

Hi!

Is it possible to integrate devices directly into this plugin.
What I want to to with this is the following:
I have roller shutters that can be driven by infrared. The Harmony Hub knows this infrared codes for them (Rademacher Rollotron 9490).
If I can have these codes available via a switch in homebridge it would be possible for me to control the roller shutters by time following sunrise/sunset. Also I can stop closing if the door is still open because someone is outside.

I don't know if something like this can be done with the new TV Option.

I can not make an activity with them, because eg. if someone watches TV the activity will be switched to the roller shutters and the TV will be switched off.

Possible to update status automatically?

I have set up triggers with the harmony hub “switches”. However, it won’t work if I am using the harmony remote itself because the status of the “switches” will not get updated till I open the HomeKit app. Is it possible to have HomeKit automatically check and update the status on the background?

Activities change bug with two harmonyhubs

Hello nicoduj,

i have two harmonyhubs. One is in the living room and one in the bedroom. I created a scene in HomeKit called TV change. In this scene, the PowerOff switch is turned off by the Harmony hub in the living room and the harmonyhub bedroom starts an activity at the same time in this scene.

When running the scene, the TV is turned off in the living room, unfortunately, the TV is not turned on in the bedroom. The Homebridge Log displays both activities as completed.

I also tried without problems to start or stop all activities individually in a HomeKit scene.

From my experience with the old homebridge-harmonyhub plugin I know that the homekit scene described above worked earlier. Therefore, I could imagine that it is the plugin. What do you think?

Greeting Nastra

Error

I'm getting an error when starting up home bridge with this module (see below). I'm configuring two Harmony Hubs as follows:

"platforms": [
    {
        "platform": "HarmonyHub",
        "name": "LivingRoom",
        "hubIP": "192.168.1.10"
    },
    {
        "platform": "HarmonyHub",
        "name": "Kitchen",
        "hubIP": "192.168.1.11"
    },
/usr/lib/node_modules/homebridge/lib/api.js:122
throw new Error("The requested platform '" + name + "' was not registered by any plugin.");
^
Error: The requested platform 'HarmonyHub' was not registered by any plugin.
at API.platform (/usr/lib/node_modules/homebridge/lib/api.js:122:13)
at Server._loadPlatforms (/usr/lib/node_modules/homebridge/lib/server.js:314:45)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:85:36)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
homebridge.service: main process exited, code=exited, status=1/FAILURE
Unit homebridge.service entered failed state.

Starting activity throws js error

I can see my activities, so the readout works. Altough upon switching one on, I get the follwoing error in my log

Jan 09 19:17:29 deodsrv001 homebridge[14084]: Uncaught exception error:  TypeError: Cannot read property 'includes' of undefined
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at HarmonyPlatform.<anonymous> (/usr/lib/node_modules/homebridge-harmony/index.js:460:44)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at Characteristic.On.emit (events.js:188:13)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at Characteristic.On.Characteristic.setValue (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:320:10)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at Bridge.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:871:22)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at Array.forEach (<anonymous>)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at Bridge.Accessory._handleSetCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:811:8)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at HAPServer.emit (events.js:188:13)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at HAPServer._handleCharacteristics (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at HAPServer.<anonymous> (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at IncomingMessage.emit (events.js:188:13)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at endReadableNT (_stream_readable.js:1129:12)
Jan 09 19:17:29 deodsrv001 homebridge[14084]:     at process.internalTickCallback (internal/process/next_tick.js:72:19)

HarmonyHub - not supported

I am trying out the new support for TVPlatformMode.

The log looks fine in when starting up:

[2/2/2019, 7:07:22 PM] [HarmonyHub] Creating Main TV Service | stdout
-- | --
[2/2/2019, 7:07:22 PM] [HarmonyHub] Initializing platform accessory 'HarmonyHub'...

The UI in Home shows "Not Supported" for "HarmonyHub".

And the following error is in the logs:

Unhandled rejection TimeoutError: operation timed out
at afterTimeout (/usr/local/lib/node_modules/homebridge-harmonyhub/node_modules/bluebird/js/release/timers.js:46:19)
at Timeout.timeoutTimeout [as _onTimeout] (/usr/local/lib/node_modules/homebridge-harmonyhub/node_modules/bluebird/js/release/timers.js:76:13)

Add a switch or switches for repairing activities

Either static or dynamic when an activity is on, in order to fix devices states if needed.

Maybe with an option has one switch or multiple ones. In this case the number of switch won't be always the same so will need to had / remove them dyamically. In the other hand, if we have only one switch, maybe some devices that don't have distincts power on and off function will have trouble using those options.

Activities triggered by Harmony remote not showing in Homebridge or Home.app

Since updating to the latest version (0.1.2) activities triggered via the Harmony remote no longer show in the Homebridge log and are not changing state in Home.app. I triggered several activities via the remote and none showed in either place.

Activities triggered in Home.app DO show in the Homebridge log and update their state correctly in Home.app

Getting some errors in the log too but it's not entirely clear when they are triggered. Seemingly when I triggered an activity in the Home.app but not every time.

0|homebridge  | ReferenceError: callback is not defined
0|homebridge  |     at Timeout._onTimeout (/usr/lib/node_modules/homebridge-harmony/index.js:425:47)
0|homebridge  |     at listOnTimeout (timers.js:324:15)
0|homebridge  |     at processTimers (timers.js:268:5)

Also nothing except sometimes this deprecation warning on startup or maybe when triggering with the remote.

0|homebridge  | (node:16430) [DEP0112] DeprecationWarning: Socket.prototype._handle is deprecated

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.