machinaos 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/package.json +1 -1
- package/client/src/components/OutputPanel.tsx +3 -2
- package/client/src/components/parameterPanel/InputSection.tsx +4 -3
- package/package.json +1 -1
- package/server/routers/websocket.py +5 -5
- package/server/services/ai.py +38 -13
- package/server/services/deployment/manager.py +14 -0
- package/server/services/execution/executor.py +2 -0
- package/server/services/execution/models.py +8 -0
- package/server/services/handlers/ai.py +71 -23
- package/server/services/handlers/tools.py +103 -6
- package/server/skills/android_agent/app-launcher-skill/SKILL.md +137 -0
- package/server/skills/android_agent/app-list-skill/SKILL.md +148 -0
- package/server/skills/android_agent/audio-skill/SKILL.md +169 -0
- package/server/skills/android_agent/battery-skill/SKILL.md +114 -0
- package/server/skills/android_agent/bluetooth-skill/SKILL.md +151 -0
- package/server/skills/android_agent/camera-skill/SKILL.md +148 -0
- package/server/skills/android_agent/environmental-skill/SKILL.md +140 -0
- package/server/skills/android_agent/location-skill/SKILL.md +163 -0
- package/server/skills/android_agent/motion-skill/SKILL.md +141 -0
- package/server/skills/android_agent/screen-control-skill/SKILL.md +164 -0
- package/server/skills/android_agent/wifi-skill/SKILL.md +182 -0
- package/server/skills/assistant/subagent-skill/SKILL.md +62 -30
- package/server/skills/coding_agent/javascript-skill/SKILL.md +196 -0
- package/server/skills/coding_agent/python-skill/SKILL.md +165 -0
- package/server/skills/social_agent/whatsapp-db-skill/SKILL.md +284 -0
- package/server/skills/social_agent/whatsapp-send-skill/SKILL.md +180 -0
- package/server/skills/task_agent/cron-scheduler-skill/SKILL.md +215 -0
- package/server/skills/task_agent/task-manager-skill/SKILL.md +251 -0
- package/server/skills/task_agent/timer-skill/SKILL.md +168 -0
- package/server/skills/travel_agent/geocoding-skill/SKILL.md +186 -0
- package/server/skills/travel_agent/nearby-places-skill/SKILL.md +234 -0
- package/server/skills/web_agent/http-request-skill/SKILL.md +211 -0
- package/server/skills/android/skill/SKILL.md +0 -84
- package/server/skills/assistant/code-skill/SKILL.md +0 -176
- package/server/skills/assistant/http-skill/SKILL.md +0 -163
- package/server/skills/assistant/maps-skill/SKILL.md +0 -172
- package/server/skills/assistant/scheduler-skill/SKILL.md +0 -86
- package/server/skills/assistant/whatsapp-skill/SKILL.md +0 -285
- /package/server/skills/{android → android_agent}/personality/SKILL.md +0 -0
- /package/server/skills/{assistant → web_agent}/web-search-skill/SKILL.md +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: camera-skill
|
|
3
|
+
description: Control Android camera - get camera info, take photos, and access camera capabilities.
|
|
4
|
+
allowed-tools: camera_control
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: android
|
|
9
|
+
icon: "📷"
|
|
10
|
+
color: "#EC4899"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Camera Control Tool
|
|
14
|
+
|
|
15
|
+
Control camera on Android device.
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
This skill provides instructions for the **Camera Control** tool node. Connect the **Camera Control** node to Zeenie's `input-tools` handle to enable camera control.
|
|
20
|
+
|
|
21
|
+
## camera_control Tool
|
|
22
|
+
|
|
23
|
+
Access camera and capture photos.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| action | string | Yes | Action to perform (see below) |
|
|
30
|
+
| parameters | object | No | Additional parameters |
|
|
31
|
+
|
|
32
|
+
### Actions
|
|
33
|
+
|
|
34
|
+
| Action | Description |
|
|
35
|
+
|--------|-------------|
|
|
36
|
+
| `status` | Get camera info and capabilities |
|
|
37
|
+
| `capture` | Take a photo |
|
|
38
|
+
|
|
39
|
+
### Examples
|
|
40
|
+
|
|
41
|
+
**Get camera info:**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"action": "status"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Take a photo:**
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"action": "capture"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Capture with front camera:**
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"action": "capture",
|
|
59
|
+
"parameters": {
|
|
60
|
+
"camera": "front"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Response Formats
|
|
66
|
+
|
|
67
|
+
**Status response:**
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"success": true,
|
|
71
|
+
"service": "camera_control",
|
|
72
|
+
"action": "status",
|
|
73
|
+
"data": {
|
|
74
|
+
"cameras": [
|
|
75
|
+
{
|
|
76
|
+
"id": "0",
|
|
77
|
+
"facing": "back",
|
|
78
|
+
"megapixels": 48,
|
|
79
|
+
"has_flash": true,
|
|
80
|
+
"supports_video": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "1",
|
|
84
|
+
"facing": "front",
|
|
85
|
+
"megapixels": 12,
|
|
86
|
+
"has_flash": false,
|
|
87
|
+
"supports_video": true
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"flash_available": true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Capture response:**
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"success": true,
|
|
99
|
+
"service": "camera_control",
|
|
100
|
+
"action": "capture",
|
|
101
|
+
"data": {
|
|
102
|
+
"photo_path": "/storage/emulated/0/DCIM/Camera/IMG_20250130_120000.jpg",
|
|
103
|
+
"camera_used": "back",
|
|
104
|
+
"resolution": "4000x3000",
|
|
105
|
+
"timestamp": "2025-01-30T12:00:00Z"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Response Fields
|
|
111
|
+
|
|
112
|
+
| Field | Description |
|
|
113
|
+
|-------|-------------|
|
|
114
|
+
| cameras | List of available cameras |
|
|
115
|
+
| facing | `"back"` or `"front"` |
|
|
116
|
+
| megapixels | Camera resolution |
|
|
117
|
+
| has_flash | Flash available |
|
|
118
|
+
| photo_path | Path to captured photo |
|
|
119
|
+
|
|
120
|
+
## Use Cases
|
|
121
|
+
|
|
122
|
+
| Use Case | Action | Description |
|
|
123
|
+
|----------|--------|-------------|
|
|
124
|
+
| Check cameras | status | Get camera capabilities |
|
|
125
|
+
| Take photo | capture | Capture image |
|
|
126
|
+
| Selfie | capture (front) | Use front camera |
|
|
127
|
+
| Document | capture | Capture document/scene |
|
|
128
|
+
|
|
129
|
+
## Common Workflows
|
|
130
|
+
|
|
131
|
+
### Quick photo capture
|
|
132
|
+
|
|
133
|
+
1. Optionally check camera status
|
|
134
|
+
2. Capture photo
|
|
135
|
+
3. Photo saved to device gallery
|
|
136
|
+
|
|
137
|
+
### Automated documentation
|
|
138
|
+
|
|
139
|
+
1. Trigger (time/event based)
|
|
140
|
+
2. Capture photo
|
|
141
|
+
3. Process/send photo
|
|
142
|
+
|
|
143
|
+
## Setup Requirements
|
|
144
|
+
|
|
145
|
+
1. Connect the **Camera Control** node to Zeenie's `input-tools` handle
|
|
146
|
+
2. Android device must be paired
|
|
147
|
+
3. Camera permission must be granted
|
|
148
|
+
4. Storage permission for saving photos
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: environmental-skill
|
|
3
|
+
description: Get Android environmental sensor data - temperature, humidity, pressure, and ambient light level.
|
|
4
|
+
allowed-tools: environmental_sensors
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: android
|
|
9
|
+
icon: "🌡️"
|
|
10
|
+
color: "#84CC16"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Environmental Sensors Tool
|
|
14
|
+
|
|
15
|
+
Access environmental sensors on Android device.
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
This skill provides instructions for the **Environmental Sensors** tool node. Connect the **Environmental Sensors** node to Zeenie's `input-tools` handle to enable environmental sensing.
|
|
20
|
+
|
|
21
|
+
## environmental_sensors Tool
|
|
22
|
+
|
|
23
|
+
Get temperature, humidity, pressure, and light data.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| action | string | Yes | `"status"` - Get sensor data |
|
|
30
|
+
|
|
31
|
+
### Example
|
|
32
|
+
|
|
33
|
+
**Get environmental data:**
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"action": "status"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Response Format
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"success": true,
|
|
45
|
+
"service": "environmental_sensors",
|
|
46
|
+
"action": "status",
|
|
47
|
+
"data": {
|
|
48
|
+
"temperature": 23.5,
|
|
49
|
+
"humidity": 45.0,
|
|
50
|
+
"pressure": 1013.25,
|
|
51
|
+
"light": 350.0,
|
|
52
|
+
"sensors_available": {
|
|
53
|
+
"temperature": true,
|
|
54
|
+
"humidity": true,
|
|
55
|
+
"pressure": true,
|
|
56
|
+
"light": true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Response Fields
|
|
63
|
+
|
|
64
|
+
| Field | Type | Unit | Description |
|
|
65
|
+
|-------|------|------|-------------|
|
|
66
|
+
| temperature | float | Celsius | Ambient temperature |
|
|
67
|
+
| humidity | float | % | Relative humidity |
|
|
68
|
+
| pressure | float | hPa | Atmospheric pressure |
|
|
69
|
+
| light | float | lux | Ambient light level |
|
|
70
|
+
| sensors_available | object | - | Which sensors exist |
|
|
71
|
+
|
|
72
|
+
### Sensor Availability
|
|
73
|
+
|
|
74
|
+
Not all devices have all sensors. Check `sensors_available` to see what's supported.
|
|
75
|
+
|
|
76
|
+
### Light Level Guide
|
|
77
|
+
|
|
78
|
+
| Lux | Condition |
|
|
79
|
+
|-----|-----------|
|
|
80
|
+
| < 50 | Dark/dim room |
|
|
81
|
+
| 50-300 | Indoor lighting |
|
|
82
|
+
| 300-1000 | Bright indoor |
|
|
83
|
+
| 1000-10000 | Overcast outdoor |
|
|
84
|
+
| 10000-100000 | Direct sunlight |
|
|
85
|
+
|
|
86
|
+
### Temperature Notes
|
|
87
|
+
|
|
88
|
+
- Device temperature sensor may be affected by device heat
|
|
89
|
+
- For accurate ambient temperature, device should be idle
|
|
90
|
+
- Some devices don't have temperature sensor
|
|
91
|
+
|
|
92
|
+
### Pressure Guide
|
|
93
|
+
|
|
94
|
+
| hPa | Weather |
|
|
95
|
+
|-----|---------|
|
|
96
|
+
| < 1000 | Low pressure (storms) |
|
|
97
|
+
| 1000-1020 | Normal |
|
|
98
|
+
| > 1020 | High pressure (clear) |
|
|
99
|
+
|
|
100
|
+
## Use Cases
|
|
101
|
+
|
|
102
|
+
| Use Case | Sensor | Description |
|
|
103
|
+
|----------|--------|-------------|
|
|
104
|
+
| Weather tracking | pressure | Monitor local pressure |
|
|
105
|
+
| Humidity alert | humidity | Warn on high/low humidity |
|
|
106
|
+
| Light-based actions | light | Trigger on dark/bright |
|
|
107
|
+
| Temperature monitoring | temperature | Track ambient temp |
|
|
108
|
+
|
|
109
|
+
## Common Workflows
|
|
110
|
+
|
|
111
|
+
### Auto-brightness trigger
|
|
112
|
+
|
|
113
|
+
1. Read light level
|
|
114
|
+
2. If light < 100, suggest dark mode
|
|
115
|
+
3. If light > 1000, suggest bright mode
|
|
116
|
+
|
|
117
|
+
### Environment monitoring
|
|
118
|
+
|
|
119
|
+
1. Periodically read all sensors
|
|
120
|
+
2. Log data points
|
|
121
|
+
3. Alert on thresholds
|
|
122
|
+
|
|
123
|
+
### Weather correlation
|
|
124
|
+
|
|
125
|
+
1. Track pressure over time
|
|
126
|
+
2. Correlate with weather changes
|
|
127
|
+
3. Predict weather patterns
|
|
128
|
+
|
|
129
|
+
## Limitations
|
|
130
|
+
|
|
131
|
+
- Sensor availability varies by device model
|
|
132
|
+
- Temperature sensor may read higher due to device heat
|
|
133
|
+
- Indoor pressure differs from outdoor
|
|
134
|
+
- Light sensor is typically near front camera
|
|
135
|
+
|
|
136
|
+
## Setup Requirements
|
|
137
|
+
|
|
138
|
+
1. Connect the **Environmental Sensors** node to Zeenie's `input-tools` handle
|
|
139
|
+
2. Android device must be paired
|
|
140
|
+
3. Sensors depend on device hardware
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: location-skill
|
|
3
|
+
description: Get Android device GPS location - latitude, longitude, accuracy, speed, and provider information.
|
|
4
|
+
allowed-tools: location
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: android
|
|
9
|
+
icon: "📍"
|
|
10
|
+
color: "#EF4444"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Location Tool
|
|
14
|
+
|
|
15
|
+
Get GPS location from Android device.
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
This skill provides instructions for the **Location** tool node. Connect the **Location** node to Zeenie's `input-tools` handle to enable location tracking.
|
|
20
|
+
|
|
21
|
+
## location Tool
|
|
22
|
+
|
|
23
|
+
Get current GPS location from the Android device.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| action | string | Yes | `"status"` - Get current location |
|
|
30
|
+
|
|
31
|
+
### Actions
|
|
32
|
+
|
|
33
|
+
| Action | Description |
|
|
34
|
+
|--------|-------------|
|
|
35
|
+
| `status` | Get current GPS coordinates and location info |
|
|
36
|
+
|
|
37
|
+
### Example
|
|
38
|
+
|
|
39
|
+
**Get current location:**
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"action": "status"
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Response Format
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"success": true,
|
|
51
|
+
"service": "location",
|
|
52
|
+
"action": "status",
|
|
53
|
+
"data": {
|
|
54
|
+
"latitude": 37.7749,
|
|
55
|
+
"longitude": -122.4194,
|
|
56
|
+
"altitude": 10.5,
|
|
57
|
+
"accuracy": 15.0,
|
|
58
|
+
"speed": 0.0,
|
|
59
|
+
"bearing": 180.0,
|
|
60
|
+
"provider": "gps",
|
|
61
|
+
"timestamp": "2025-01-30T12:00:00Z"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Response Fields
|
|
67
|
+
|
|
68
|
+
| Field | Type | Description |
|
|
69
|
+
|-------|------|-------------|
|
|
70
|
+
| latitude | float | Latitude in degrees |
|
|
71
|
+
| longitude | float | Longitude in degrees |
|
|
72
|
+
| altitude | float | Altitude in meters (if available) |
|
|
73
|
+
| accuracy | float | Horizontal accuracy in meters |
|
|
74
|
+
| speed | float | Speed in m/s (if moving) |
|
|
75
|
+
| bearing | float | Direction of travel in degrees |
|
|
76
|
+
| provider | string | `"gps"`, `"network"`, `"fused"` |
|
|
77
|
+
| timestamp | string | When location was obtained |
|
|
78
|
+
|
|
79
|
+
### Error Response
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"error": "Location not available - GPS may be disabled",
|
|
84
|
+
"service": "location",
|
|
85
|
+
"action": "status"
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Accuracy Guide
|
|
90
|
+
|
|
91
|
+
| Accuracy (m) | Quality | Typical Source |
|
|
92
|
+
|--------------|---------|----------------|
|
|
93
|
+
| < 5 | Excellent | GPS with clear sky |
|
|
94
|
+
| 5-15 | Good | GPS |
|
|
95
|
+
| 15-50 | Fair | Network/WiFi |
|
|
96
|
+
| 50-100 | Poor | Cell tower |
|
|
97
|
+
| > 100 | Very Poor | Coarse location |
|
|
98
|
+
|
|
99
|
+
## Provider Types
|
|
100
|
+
|
|
101
|
+
| Provider | Description |
|
|
102
|
+
|----------|-------------|
|
|
103
|
+
| gps | GPS satellites (most accurate outdoors) |
|
|
104
|
+
| network | WiFi/Cell towers |
|
|
105
|
+
| fused | Combined sources (Android Fused Location) |
|
|
106
|
+
|
|
107
|
+
## Use Cases
|
|
108
|
+
|
|
109
|
+
| Use Case | Description |
|
|
110
|
+
|----------|-------------|
|
|
111
|
+
| Location tracking | Get device position |
|
|
112
|
+
| Geofencing | Check if in specific area |
|
|
113
|
+
| Speed monitoring | Track movement speed |
|
|
114
|
+
| Navigation | Get coordinates for routing |
|
|
115
|
+
|
|
116
|
+
## Common Workflows
|
|
117
|
+
|
|
118
|
+
### Share location via WhatsApp
|
|
119
|
+
|
|
120
|
+
1. Get location from device
|
|
121
|
+
2. Use `whatsapp_send` with message_type="location"
|
|
122
|
+
3. Pass latitude/longitude from location result
|
|
123
|
+
|
|
124
|
+
### Location-based reminder
|
|
125
|
+
|
|
126
|
+
1. Get current location
|
|
127
|
+
2. Calculate distance to target
|
|
128
|
+
3. Trigger reminder when near target
|
|
129
|
+
|
|
130
|
+
### Track movement
|
|
131
|
+
|
|
132
|
+
1. Periodically get location
|
|
133
|
+
2. Store coordinates
|
|
134
|
+
3. Calculate distance traveled
|
|
135
|
+
|
|
136
|
+
## Integration with Other Tools
|
|
137
|
+
|
|
138
|
+
### Send location to contact
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
1. location.status -> get lat/lng
|
|
142
|
+
2. whatsapp_send with:
|
|
143
|
+
- message_type: "location"
|
|
144
|
+
- latitude: <from location>
|
|
145
|
+
- longitude: <from location>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Find nearby places
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
1. location.status -> get lat/lng
|
|
152
|
+
2. nearby_places with:
|
|
153
|
+
- lat: <from location>
|
|
154
|
+
- lng: <from location>
|
|
155
|
+
- type: "restaurant"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Setup Requirements
|
|
159
|
+
|
|
160
|
+
1. Connect the **Location** node to Zeenie's `input-tools` handle
|
|
161
|
+
2. Android device must be paired
|
|
162
|
+
3. Location permission must be granted
|
|
163
|
+
4. GPS/Location services must be enabled on device
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: motion-skill
|
|
3
|
+
description: Get Android motion sensor data - accelerometer, gyroscope, detect motion, shake gestures, and device orientation.
|
|
4
|
+
allowed-tools: motion_detection
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: android
|
|
9
|
+
icon: "📈"
|
|
10
|
+
color: "#14B8A6"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Motion Detection Tool
|
|
14
|
+
|
|
15
|
+
Access motion sensors on Android device.
|
|
16
|
+
|
|
17
|
+
## How It Works
|
|
18
|
+
|
|
19
|
+
This skill provides instructions for the **Motion Detection** tool node. Connect the **Motion Detection** node to Zeenie's `input-tools` handle to enable motion sensing.
|
|
20
|
+
|
|
21
|
+
## motion_detection Tool
|
|
22
|
+
|
|
23
|
+
Get accelerometer, gyroscope, and motion data.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| action | string | Yes | `"status"` - Get motion sensor data |
|
|
30
|
+
|
|
31
|
+
### Example
|
|
32
|
+
|
|
33
|
+
**Get motion data:**
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"action": "status"
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Response Format
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"success": true,
|
|
45
|
+
"service": "motion_detection",
|
|
46
|
+
"action": "status",
|
|
47
|
+
"data": {
|
|
48
|
+
"accelerometer": {
|
|
49
|
+
"x": 0.12,
|
|
50
|
+
"y": 9.78,
|
|
51
|
+
"z": 0.34
|
|
52
|
+
},
|
|
53
|
+
"gyroscope": {
|
|
54
|
+
"x": 0.01,
|
|
55
|
+
"y": 0.02,
|
|
56
|
+
"z": 0.00
|
|
57
|
+
},
|
|
58
|
+
"orientation": {
|
|
59
|
+
"azimuth": 45.0,
|
|
60
|
+
"pitch": -5.0,
|
|
61
|
+
"roll": 2.0
|
|
62
|
+
},
|
|
63
|
+
"is_moving": false,
|
|
64
|
+
"is_shaking": false,
|
|
65
|
+
"device_position": "flat"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Response Fields
|
|
71
|
+
|
|
72
|
+
| Field | Type | Description |
|
|
73
|
+
|-------|------|-------------|
|
|
74
|
+
| accelerometer | object | X, Y, Z acceleration (m/s^2) |
|
|
75
|
+
| gyroscope | object | X, Y, Z rotation rate (rad/s) |
|
|
76
|
+
| orientation | object | Device orientation angles |
|
|
77
|
+
| is_moving | boolean | Significant movement detected |
|
|
78
|
+
| is_shaking | boolean | Shake gesture detected |
|
|
79
|
+
| device_position | string | Inferred position |
|
|
80
|
+
|
|
81
|
+
### Orientation Fields
|
|
82
|
+
|
|
83
|
+
| Field | Description |
|
|
84
|
+
|-------|-------------|
|
|
85
|
+
| azimuth | Compass heading (0-360 degrees) |
|
|
86
|
+
| pitch | Forward/backward tilt (-180 to 180) |
|
|
87
|
+
| roll | Left/right tilt (-90 to 90) |
|
|
88
|
+
|
|
89
|
+
### Device Positions
|
|
90
|
+
|
|
91
|
+
| Position | Description |
|
|
92
|
+
|----------|-------------|
|
|
93
|
+
| `flat` | Laying flat on surface |
|
|
94
|
+
| `upright` | Standing vertical |
|
|
95
|
+
| `tilted` | Angled position |
|
|
96
|
+
| `face_down` | Screen facing down |
|
|
97
|
+
| `face_up` | Screen facing up |
|
|
98
|
+
|
|
99
|
+
## Accelerometer Interpretation
|
|
100
|
+
|
|
101
|
+
When device is stationary and flat:
|
|
102
|
+
- X ~ 0 (left-right)
|
|
103
|
+
- Y ~ 9.8 (gravity)
|
|
104
|
+
- Z ~ 0 (forward-backward)
|
|
105
|
+
|
|
106
|
+
Movement creates deviations from gravity baseline.
|
|
107
|
+
|
|
108
|
+
## Use Cases
|
|
109
|
+
|
|
110
|
+
| Use Case | Data | Description |
|
|
111
|
+
|----------|------|-------------|
|
|
112
|
+
| Shake detection | is_shaking | Trigger on shake gesture |
|
|
113
|
+
| Movement alert | is_moving | Detect device moved |
|
|
114
|
+
| Orientation | device_position | Check how device is held |
|
|
115
|
+
| Compass heading | azimuth | Get direction |
|
|
116
|
+
| Tilt detection | pitch, roll | Detect angles |
|
|
117
|
+
|
|
118
|
+
## Common Workflows
|
|
119
|
+
|
|
120
|
+
### Shake to trigger action
|
|
121
|
+
|
|
122
|
+
1. Poll motion status
|
|
123
|
+
2. When is_shaking = true
|
|
124
|
+
3. Execute action
|
|
125
|
+
|
|
126
|
+
### Security monitor
|
|
127
|
+
|
|
128
|
+
1. Place device as monitor
|
|
129
|
+
2. Check is_moving periodically
|
|
130
|
+
3. Alert if movement detected
|
|
131
|
+
|
|
132
|
+
### Orientation-based response
|
|
133
|
+
|
|
134
|
+
1. Check device_position
|
|
135
|
+
2. Adjust behavior based on orientation
|
|
136
|
+
|
|
137
|
+
## Setup Requirements
|
|
138
|
+
|
|
139
|
+
1. Connect the **Motion Detection** node to Zeenie's `input-tools` handle
|
|
140
|
+
2. Android device must be paired
|
|
141
|
+
3. Motion sensors must be available on device
|