Nspanel pro api

Hi,

I have followed the guide https://sonoff.tech/nspanelpro-api

But when I try the example they have provided for adding a device ( I already got the token), I get an this error:
This is the request:

{
  "event": {
    "header": {
      "name": "DiscoveryRequest",
      "message_id": "8cd0bcb1-8ff3-400f-8a9e-8cdab32907508",
      "version": "1"
    },
    "payload": {
      "endpoints": [
        {
          "third_serial_number": "34923849283429839",
          "name": "my plug",
          "display_category": "plug",
          "capabilities": [
            {
              "capability": "power",
              "permission": "readWrite"
            }
          ],
          "state": {
            "power": {
              "powerState": "on"
            }
          },
          "manufacturer": "Demo",
          "model": "Demo model",
          "firmware_version": "1.0.0",
          "service_address": "https://httpbin.org/post"
        }
      ]
    }
  }
}

This is the response

{
	"header": {
		"name": "ErrorResponse",
		"message_id": "8cd0bcb1-8ff3-400f-8a9e-8cdab32907508",
		"version": "1"
	},
	"payload": {
		"type": "INVALID_PARAMETERS",
		"description": "invalid parameters."
	}
}

Any idea what it could be

Hi mate, did you manage to get it working? I have same problem

No, ended up installing home habit on it, and fully kiosk

1 Like

I have found that this request fails, becouse you need to match exact capability matrix eg. sometimes add rssi or battery (or both) capabilities even if device doesnt have it (they doesnt show anywhere in the panel btw).
Tried mixing all possible (and reasonable) caps and I’ve discovered how to add curtain, rgb light, color temp light, detection sensors, button and plug (switch) - with working state updates from both sides.
Sometimes the examples are invalid, you need to read and understand whole documentation to find such quirks.

Still can’t get working temperature, humidity and temperatureAndSensor :frowning:

Device/caps matrix (tested and working):

  1. Button (this cannot emit events from panel itself, this can only show remote “press”)
  • rssi
  • battery
  • press
  1. contactSensor, motionSensor, waterLeakDetector, smokeDetector
  • rssi
  • battery
  • detect
  1. light (color temp only)
  • power
  • brightness
  • color-temperature
  • rssi
  1. light (color rgb)
  • power
  • brightness
  • color-temperature
  • color-rgb
  • rssi
  1. curtain
  • rssi
  • battery
  • percentage (NOTE: you need to set motor-clb value to normal to get percentage working)
  • motor-control
  • motor-reverse
  • motor-clb
  1. switch / plug
  • rssi
  • power
  1. temperatureAndHumiditySensor (doesnt work, but shows up in panel)
  • rssi
  • battery
  • temperature
  • humiditiy

Anybody can help with temperature, humi or both sensors? They doesnt display value and entering widget show “failure” toast.
This is great product with awesome potential, but buggy docs/api makes me and guys giving up. Also, you cant attach 3rd party devices to other screens, associate them to thermostats yet, which can be killer feature.

I wish somebody from ewelink helped. Maybe I can help with docs in some way? What do you think @Daniel_Zhan , @StephenJ ? :slight_smile:

Greetings

1 Like