GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — NodeAPIServer/README.md at master · shnere/NodeAPIServer

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
86 lines (69 loc) · 1.53 KB
/

README.md

Copy path

File metadata and controls

86 lines (69 loc) · 1.53 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

#Node JS + Express API for a domotic framework.

MongoDB + xbee

API

All _id's use mongodb's ObjectId() default assignation.

Spaces

{
	_id: ObjectId(),
	name: ""
 }

Devices

{
	_id: ObjectId(),
	name: "",
	space_id: ObjectId(),
	protocol_id: ObjectId(),
	pan_id: "",
	network_address: "",
	node_identifier: "",
	is_sensor: "0",
	is_actuator: "1",
	subdevice_count: "0",
	subdevices: {
		subdevice_id: ObjectId(),
		status: "0",
	},
	status: "1"
}

Data

Historical information of a device

{
	_id: ObjectId(),
	device_id: ObjectId(),
	protocol_id: ObjectId(),
	value: "",
	date_time: ""
}

Protocols

Each device implements a protocol that contains a data type

{
	_id: ObjectId(),
	name: "",
	min_value: ,
	max_value: ,
	data_type: "",
	units: ""
}

Rules

Actions of the type "if this then that". Can involve two different devices (origin + destination)

{
	_id: ObjectId(),
	origin_id: ObjectId(),
	destination_id: ObjectId(),
	condition: "",
	action: "" 
}

CURL Tests

Create

curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "Sala"}' http://localhost:3000/space

Read

curl -i -X GET http://localhost:3000/space/5175d8d1f825f92185000001

Update

curl -i -X PUT -H 'Content-Type: application/json' -d '{"name": "Comedor"}' http://localhost:3000/space/5175d8d1f825f92185000001

Delete

curl -i -X DELETE http://localhost:3000/space/5175d8d1f825f92185000001

Configuration

  1. Create or know Space
  2. Create or know Protocol
  3. Register Device
  4. Add Data
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.