You are currently viewing the Homey Apps SDK v2 documentation. New apps should use Homey Apps SDK v3 ››

Prontohex

A signal-definition consists of two types of properties; signal encoding properties and radio configuration properties. The first part specifies the characteristics of the data encoding of a signal whereas the radio part specifies the required radio configuration to receive the signal. This section discusses the signal encoding properties of the Prontohex Signal Definitions.

Properties

The table below shows the encoding properties in the Prontohex signal definition.

Attribute Description Remark
cmds Static commands String => Prontohex string
type Type of Signal Set to prontohex to enable prontohex mode

Commands

Sometimes, devices have a static set of commands and do not include any dynamic data such as an address. This is the case for most infrared devices. In these cases, the cmds attribute can be used to predefine all commands. This property consists of an object that maps commands (specified as identifier string) to a prontohex payload (specified as String). The carrier in the prontohex String overrides the carrier in the signal radio specification.

Example

/app.json

{
  "signals": {
    "ir": {
      "philips": {
        "type": "prontohex",
        "cmds": {
          "ON": "0000 0073 0000 000D 0020 0020 0040 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0040 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0CA4",
          "OFF": "0000 0073 0000 000C 0020 0020 0040 0020 0020 0020 0020 0020 0020 0020 0020 0020 0020 0040 0020 0020 0020 0020 0020 0020 0040 0040 0020 0CA4"
        }
      }
    }
  }
}

/app.js

let philipsSignal = new SignalInfrared('philips');
  philipsSignal.register()
    .then( () => {

      philipsSignal.cmd('ON')
        .catch( this.error )
        .then( this.log )

    })
    .catch( this.error )