Miss any of our Open RFC calls?Watch the recordings here! »

homebridge-sonoff-wifi-switch

1.3.3 • Public • Published

Config Example:

{
"platforms" : [
  {
   "platform" : "SonoffWiFiSwitchHTTPPlatform",
   "accessories" : [
     {
      "initState" : "off",
      "action" : "on",
      "hostname" : "XXX.XX.X.XX",
      "password" : "*******"
      "pulse" : "false",
      "lock" : "false",
      "duration" : "5",
      "name" : "accessorie 1",
      "status" : "relay1",
      "sensor" : "true",
      "sensorService" : "ContactSensor",
      "sensorCharacteristic" : "ContactSensorState"
     },
     {
      "accessory" : "SonoffWiFiSwitchHTTP",
      "hostname" : "XXX.XX.X.XX",
      "sensor" : "true",
      "sensorUpdateIntervalMs" : "1000",
      "sensorService" : "TemperatureSensor",
      "TemperatureSensorCorrection" : "-30.5",
      "TemperatureSensorCorrectionMax" : "100",
      "TemperatureSensorCorrectionMim" : "-100",
      "sensorCharacteristic" : "CurrentTemperature",
      "status" : "temperature1",
      "name" : "ServerRoom"
     }
    ],
   "name" : "SonoffWiFiPlatform1"
  }
 ]
}

Default accessorie type is "Switch"
hostname - accessorie address
pulse - (true/false) Flag to change the state to the original after (duration) seconds
duration - timer (seconds)
status - (string, default: "relay" + RelayNum) Name of the Json -field containing the device status in status response
action - (on/off) click
RelayNum - (int, default: 1) relay number for internal requests (examples, where "2" is RelayNum: "cmd?command=relay off 2", "cmd?command=pulse on relay2 2000") lock - (true/false) accessorie is "LockMechanism"


sensor - (true/false) accessorie is "ContactSensor"
  -sensorService/sensorCharacteristic (both fields must be filled) - (string - name of sensor sensor service/sensor characteristic) accessorie is sensor (sensor = true)
  -sensorUpdateIntervalMs
  If sensorService is TemperatureSensor:
   -TemperatureSensorCorrection
   -TemperatureSensorCorrectionMax
   -TemperatureSensorCorrectionMim

Install

npm i homebridge-sonoff-wifi-switch

DownloadsWeekly Downloads

21

Version

1.3.3

License

ISC

Unpacked Size

27.4 kB

Total Files

3

Last publish

Collaborators

  • avatar