Ajax icon

Ajax

Consume Ajax API (v.0.1.2)

Actions242

Overview

This node, named "Ajax," is designed to send commands to devices within a specified system via an Ajax API. It supports various device types and a wide range of commands that can be issued to those devices. This node is useful in scenarios where you need to remotely control or test devices such as sensors, alarms, switches, cameras, and other smart home or security equipment.

Practical examples include:

  • Sending a command to switch a device on or off.
  • Initiating a self-test or calibration on a device.
  • Starting or stopping detection or connection tests.
  • Triggering a device to make a photo or reset passwords.
  • Managing bypass states for tamper or engineer modes.

Properties

Name Meaning
User Id Identifier of the user issuing the command. Required to specify which user context the command is executed under.
Hub Id Identifier of the hub to which the device is connected. Required to route the command correctly within the network.
Device Id Identifier of the target device to which the command will be sent.
Command The specific command to send to the device. Options include: CONNECTION_TEST_START, CONNECTION_TEST_STOP, DETECTION_TEST_START, DETECTION_TEST_STOP, MUTE, SWITCH_ON, SWITCH_OFF, SOUND_TEST_START, UNLOCK_DEVICE, DEVICE_SWITCH_STATE, FIRE_SENSOR_TEST, MOTION_OUTDOOR_DETECTION_TEST_START, MOTION_OUTDOOR_UPPER_MOTION_SENSOR_DETECTION_TEST_START, MOTION_OUTDOOR_LOWER_MOTION_SENSOR_DETECTION_TEST_START, MOTION_OUTDOOR_ANTIMASKING_MOTION_SENSOR_DETECTION_TEST_START, MULTI_TRANSMITTER_POWER_RESET, DISABLE_BYPASS, ENABLE_ENGINEER_BYPASS, ENABLE_TAMPER_BYPASS, DISABLE_DEVICE_ONETIME_BYPASS, ENABLE_WHOLE_DEVICE_ONETIME_BYPASS, ENABLE_TAMPER_DEVICE_ONETIME_BYPASS, RESET_PASSWORD, RESET_FORCE_DISARM_PASSWORD, MAKE_PHOTO, UNREGISTERED_FIBRA_DEVICE_BLINK_START, UNREGISTERED_FIBRA_DEVICE_BLINK_STOP, START_CALIBRATION, STOP_CALIBRATION, BUS_POWER_ON, BUS_POWER_OFF, IWH_TEST_START, IWH_TEST_STOP, SELF_TEST.
Device Type The type of device receiving the command. Supported device types include DoorProtect, MotionProtect, FireProtect, GlassProtect, LeaksProtect, RangeExtender, CombiProtect, Keypad, SpaceControl, Button, Socket, WallSwitch, Relay, MotionCam, StreetSiren, MultiTransmitter, LifeQuality, WaterStop, LightSwitch variants, and many others as listed in the options.

Output

The node outputs JSON data representing the result of the command execution on the device. This typically includes status information confirming whether the command was successfully sent and any response data returned by the device or backend service.

If the device or command supports binary data (e.g., images from a camera when using the MAKE_PHOTO command), the node may output binary data accordingly, representing the raw content such as photos or sensor data.

Dependencies

  • Requires an API key credential for authenticating with the Ajax API service.
  • Depends on the external Ajax API backend to process commands and interact with devices.
  • The node uses internal helper classes for HTTP communication, state management, and operation resolution/execution.
  • Proper configuration of credentials and network access to the Ajax API endpoint is necessary.

Troubleshooting

  • Common Issues:

    • Invalid or missing credentials leading to authentication failures.
    • Incorrect device, hub, or user IDs causing command routing errors.
    • Unsupported commands for certain device types resulting in errors.
    • Network connectivity issues preventing communication with the Ajax API.
  • Error Messages:

    • Authentication errors: Verify that the API key credential is correctly configured and valid.
    • Device not found or invalid ID: Check that the deviceId, hubId, and userId are correct and exist in the system.
    • Command not supported: Ensure the selected command is valid for the chosen device type.
    • Timeout or network errors: Confirm network connectivity and API endpoint availability.

Resolving these usually involves verifying input parameters, ensuring proper credential setup, and checking network conditions.

Links and References

  • Ajax API Documentation (Replace with actual URL if available)
  • Device and Command Reference Guides provided by the device manufacturer or system integrator.
  • n8n documentation on creating and configuring custom nodes and credentials.

Discussion