npm

Need private packages and team management tools?Check out npm Orgs. »

homebridge-vestel-network-remote

0.6.4 • Public • Published

Vestel TV Network Remote plugin for Homebridge

Homebridge plugin for controlling Vestel smart TVs. Vestel manufactures TVs as a lot of brand names so if your TV is from a smaller brand or a store's own brand it's probably worth checking if it's a Vestel TV.

(I wouldn't recommend these TVs as they have no security protections at all. Use them on an isolated network if possible.)

npm install -g homebridge
npm install -g git+https://gitlab.fancy.org.uk/samuel/homebridge-vestel-network-remote
{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.223"
}

The TV generates a new UUID every time it is turned on so there's no way of discovering the IP address so you need to set a static IP address on the TV.

Features

Apparently Vestel TVs support a lot more commands. I haven't tested all of these.

Accessory information

You can set the manufacturer, model and serial number of your TV if you want to. By default the IP address is used as the serial number.

{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.223",
    "manufacturer": "Vestel",
    "model": "Model Number",
    "serial_number": "Serial Number"
}

Multiple TVs

If you have multiple TVs they should be published separately as the iOS TV Remote only allows one Television service per HAP server. You'll have to use the platform to do this instead of the accessory. Each object in the tvs array should be the same as if you were using the accessory type, but without the accessory property.

{
    "platform": "vestel-network-remote.TVs",
    "tvs": [
        {
            "name": "Samuel's Bedroom TV",
            "ip_address": "192.168.3.223"
        }
    ]
}

The first TV will be published on the bridge and any additional TVs will be published separately. If you have a TV from another plugin on the bridge you'll have to set the external property explicitly.

{
    "platform": "vestel-network-remote.TVs",
    "external": true,
    "tvs": [...]
}

Turning the TV on

To turn the TV on you need another device capable of turning the TV on with HDMI CEC or IR.

Apple TV 4th generation

Using an Apple TV 4th generation requires node-appletv. This isn't listed as a dependency so you need to install it seperately.

# https://github.com/socalrds/node-appletv uses a working sodium
npm install -g socalrds/node-appletv
  1. Run appletv pair to create a pairing identifier.
  2. Add the credentials string to your config.json. You can split it at the colons if you want.
{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.223",
    "apple_tv": {
        "unique_identifier": "00000000-0000-0000-0000-000000000000",
        "identifier": "000000000000000000000000000000000000000000000000000000000000000000000000",
        "pairing_id": "000000000000000000000000000000000000000000000000000000000000000000000000",
        "public_key": "0000000000000000000000000000000000000000000000000000000000000000",
        "encryption_key": "0000000000000000000000000000000000000000000000000000000000000000"
    }
}

Power state timeout

The current power state is checked by trying to connect to the TV. By default if the TV doesn't respond within 2000 milliseconds it is assumed the TV is off. If two seconds is too long/too short you can change it.

{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.223",
    "apple_tv": "00000000-0000-0000-0000-000000000000:000000000000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000000000000000000000000000000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000",
    "tv_power_timeout": 1000
}

Controlling volume

If your TV exposes a RenderingControl service you can control the volume. By default this will use "http://{ip_address}:2869/dmr.xml" - if it's different on your TV or it doesn't have a RenderingControl service you can change the location of the MediaRenderer description or set it to null.

{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.231",
    "media_renderer_location": "http://192.168.3.231:2869/dmr.xml"
}

This will add a Speaker service. As the Speaker service is not supported by the Home app, you can also choose to use a Lightbulb service instead of or in addition to the Speaker service.

{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.231",
    "expose_speaker_service": false,
    "expose_speaker_lightbulb_service": true
}

iOS 12.2 Television service

You can enable the Television service (supported in the Home app on iOS 12.2 and later) by setting the expose_television_service flag.

{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.231",
    "expose_television_service": true,
    "tv_sources": {
        "0": ["TV", "TUNER"],
        "1": ["EXT 1", "COMPOSITE_VIDEO"],
        "5": ["SIDE AV", "COMPOSITE_VIDEO"],
        "6": ["DVD", "APPLICATION", "PLAYBACK"],
        "7": ["HDMI 1", "HDMI"],
        "8": ["HDMI 2", "HDMI"],
        "11": ["YPbPr", "COMPONENT_VIDEO"],
        "12": ["VGA", "COMPONENT_VIDEO"]
    },
    "default_input": 0,
    "apple_tv_input": 4
}

The tv_sources object defines how the sources should be switched. The key is the internal identifier of the source. The value is either an array (the first item can be anything you can use to reference the source ("HDMI 1" is preferred over "Apple TV" for example as you can set your own name in the Home app), the second item being the name of an Input Source Type and the third being the name of an Input Device Type) or an object:

        ...,
        "6"{
            "name": "DVD",
            "input_source_type": "APPLICATION",
            "input_device_type": "PLAYBACK"
        },
        ...

You can find the internal identifier of the source by trying different identifiers. These are incremental and start from 0 but include sources for other hardware models, so some do nothing.

npm install -g git+https://gitlab.fancy.org.uk/samuel/vestel-network-remote
vestel-followme-tv 192.168.3.246 set-source 0

You can also set the picture zoom after changing the source, as this is sometimes set to auto:

        ...,
        "7"{
            "name": "HDMI 1",
            "input_source_type": "HDMI",
            "picture_zoom": "full"
        },
        ...

Values for picture_zoom can be found here.

The apple_tv_input property should be set to the index of the input the Apple TV used to turn the TV on is connected to. This is used to display the correct source after turning the TV on with an Apple TV (which should set the source to the Apple TV). The default is the first HDMI source.

The default_input property should be set to the index of the input to display when the plugin doesn't know what source is currently active. The default is 0 (the first source).

Enabling the Television service will disable the Switch and Speaker service. Set their flags explicitly to enable them.

{
    "accessory": "vestel-network-remote.TV",
    "name": "Samuel's Bedroom TV",
    "ip_address": "192.168.3.231",
    "expose_television_service": true,
    "tv_sources": ...,
    "expose_power_service": true,
    "expose_speaker_lightbulb_service": true
}

Enabling the Television service also enables a TelevisionSpeaker service, which is exactly the same as the Speaker service but has an additional VolumeControlType characteristic. Don't enable both speaker services as they use the same UUID.

TV apps

You can add TV apps by adding them to the tv_apps object.

    ...,
    "tv_apps"[
        {
            "name": "Internet Portal",
            "input_source_type": "HOME_SCREEN",
            "remote_key": "INTERNET"
        },
        {
            "name": "Browser",
            "input_device_type": "OTHER",
            "app_url": "browser://open"
        }
    ],
    ...

TV channels

You can add TV channels by adding them to the tv_channels object. Channels names will be retrieved from the TV.

    ...,
    "tv_channels"[
        1,
        2,
        3
    ],
    ...

install

npm i homebridge-vestel-network-remote

Downloadsweekly downloads

14

version

0.6.4

license

MIT

repository

Gitgitlab

last publish

collaborators

  • avatar
Report a vulnerability