HONEY Documents
HOMESHOPFACEBOOK
  • Get Started
  • HONEY Modbus IO
    • MODEBUS-IO 8 IN 8 OUT ( Relay ) [ HONEY-E32-8DI-8RO ]
      • การตั้งค่า WiFi Config
      • Modbus Protocol
      • การใช้งานร่วมกับ +WECON HMI
      • การใช้งานร่วมกับ +SAMKOON HMI
      • การใช้งานร่วมกับ +Node-RED (Modbus-TCP)
      • การใช้งานร่วมกับ +Home Assistant
      • การใช้งานร่วมกับ +V-BOX IIoT (V-net)
      • PIN Define ( Arduino )
    • RESTApi for Modbus IO
Powered by GitBook
On this page
  • RESTApi for Modbus IO
  • การอ่านสถานะต่างๆ ของบอร์ด Modbus IO
  • การสั่งงานสถานะต่างๆ ของบอร์ด Modbus IO
  1. HONEY Modbus IO

RESTApi for Modbus IO

PreviousPIN Define ( Arduino )

Last updated 1 year ago

RESTApi for Modbus IO

การใช้งาน RESTApi สำหรับอุปกรณ์ Modbus IO

การอ่านสถานะต่างๆ ของบอร์ด Modbus IO

🔗 [GET] https://api.honey.co.th/devices/:serial_number

Path Parameters

Name
Type
Description

:serial_number *

string

Device Serial Number

Query Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Headers Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Example Request

#️⃣ curl 'https://api.honey.co.th/devices/:serial_number?apikey=:apikey'

Response Success ( 200 : OK )

{
  "success": true,
  "data": {
	  // response data
  }
}

Response Unauthorized ( 401 : Unauthorized )

{
  "success": false,
  "data": {},
  "msg": "require query params! -> 'apikey' "
}

การสั่งงานสถานะต่างๆ ของบอร์ด Modbus IO

🔗 [POST] https://api.honey.co.th/devices/:serial_number

Path Parameters

Name
Type
Description

:serial_number *

string

Device Serial Number

Query Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Headers Parameters ( option )

Name
Type
Description

apikey

string

API Key (สามารถดูได้จากหน้า HONEYConsole)

Request Body

Name
Type
Description

VAR_Y0

bool

ควบคุม Y0 ให้เปิด / ปิด

VAR_Y(n)

bool

ควบคุม Y ที่ n ให้เปิด / ปิด เช่น ต้องการควบคุม Y7 จะต้อง key เป็น VAR_Y7 เป็นต้น

Example Request

#️⃣ curl 'https://api.honey.co.th/devices/:serial_number?apikey=:apikey' \ --header 'Content-Type: application/json' \ --data '{ "VAR_Y0":1 }'

Response Success ( 201 : Created )

{
  "success": true,
  "msg": "send command to device"
}

Response Unauthorized ( 401 : Unauthorized )

{
  "success": false,
  "data": {},
  "msg": "require query params! -> 'apikey' "
}
การอ่านสถานะต่างๆ ของบอร์ด Modbus IO
การสั่งงานสถานะต่างๆ ของบอร์ด Modbus IO