Skip to content

Smart Home Integrations

RS-1 integrates with major smart home platforms for seamless automation. This guide covers setup and configuration for each platform.

PlatformConnectionFeatures
Home AssistantMQTT / NativeFull control, all entities
Apple HomeKitDirect / MatterOccupancy, motion sensors
Google HomeMatterOccupancy, presence
Amazon AlexaMatterOccupancy, routines
SmartThingsMatterOccupancy, automations

Home Assistant provides the deepest integration with RS-1.

MethodSetupBest For
MQTTAuto-discoveryMost users
Native IntegrationHACS installAdvanced features
ESPHome ProxyManual configCustom setups

RS-1 supports MQTT auto-discovery for easy Home Assistant integration.

  • Home Assistant with MQTT broker (Mosquitto)
  • RS-1 on same network
  • MQTT credentials
  1. In OpticWorks App:
    • Open room → Sensor settings
    • Tap “Integrations”
    • Enable “MQTT”
    • Enter broker details:
MQTT Broker: 192.168.1.100
Port: 1883
Username: homeassistant
Password: ********
Discovery Prefix: homeassistant
  1. Verify Connection:
    • Sensor LED flashes green twice
    • Check Home Assistant → Devices

RS-1 creates these entities automatically:

# Binary Sensors
binary_sensor.rs1_living_room_occupancy # Room occupied
binary_sensor.rs1_living_room_motion # Motion detected
# Sensors
sensor.rs1_living_room_occupancy_count # Number of people
sensor.rs1_living_room_target_1_x # Person 1 X position
sensor.rs1_living_room_target_1_y # Person 1 Y position
sensor.rs1_living_room_target_1_z # Person 1 Z position
sensor.rs1_living_room_target_1_speed # Person 1 velocity
sensor.rs1_living_room_activity_level # Overall activity
# Per-Zone Sensors (if configured)
binary_sensor.rs1_living_room_zone_couch # Couch zone occupied
binary_sensor.rs1_living_room_zone_desk # Desk zone occupied
# Diagnostic
sensor.rs1_living_room_wifi_signal # WiFi RSSI
sensor.rs1_living_room_uptime # Uptime seconds

For advanced features, install the OpticWorks integration via HACS.

  1. Open HACS in Home Assistant
  2. Search “OpticWorks”
  3. Install
  4. Restart Home Assistant
  5. Add Integration:
    • Settings → Devices & Services
    • Add Integration → OpticWorks
    • Devices are auto-discovered

The native integration provides:

# Camera Entity (optional)
camera.rs1_living_room_presence_map # Real-time presence visualization
# Number Controls
number.rs1_living_room_sensitivity # Detection sensitivity
number.rs1_living_room_timeout # Absence timeout
# Select Controls
select.rs1_living_room_mode # Detection mode
# Buttons
button.rs1_living_room_recalibrate # Trigger recalibration

Example automations using RS-1:

automation:
- alias: "Living Room Lights - Presence"
trigger:
- platform: state
entity_id: binary_sensor.rs1_living_room_occupancy
to: "on"
condition:
- condition: sun
after: sunset
action:
- service: light.turn_on
target:
entity_id: light.living_room
data:
brightness_pct: 80
- alias: "Living Room Lights - Empty"
trigger:
- platform: state
entity_id: binary_sensor.rs1_living_room_occupancy
to: "off"
for: "00:05:00"
action:
- service: light.turn_off
target:
entity_id: light.living_room
automation:
- alias: "Desk Lamp - Working"
trigger:
- platform: state
entity_id: binary_sensor.rs1_office_zone_desk
to: "on"
condition:
- condition: time
after: "08:00:00"
before: "18:00:00"
action:
- service: light.turn_on
target:
entity_id: light.desk_lamp
- alias: "Desk Lamp - Away"
trigger:
- platform: state
entity_id: binary_sensor.rs1_office_zone_desk
to: "off"
for: "00:02:00"
action:
- service: light.turn_off
target:
entity_id: light.desk_lamp
automation:
- alias: "Office HVAC - Presence"
trigger:
- platform: state
entity_id: binary_sensor.rs1_office_occupancy
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.rs1_office_occupancy
state: "on"
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.office
data:
hvac_mode: heat_cool
- conditions:
- condition: state
entity_id: binary_sensor.rs1_office_occupancy
state: "off"
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.office
data:
hvac_mode: "off"
automation:
- alias: "Party Mode Detected"
trigger:
- platform: numeric_state
entity_id: sensor.rs1_living_room_occupancy_count
above: 4
action:
- service: notify.mobile_app
data:
message: "Party detected! {{ states('sensor.rs1_living_room_occupancy_count') }} people in living room"
type: entities
title: Living Room Presence
entities:
- entity: binary_sensor.rs1_living_room_occupancy
name: Occupied
- entity: sensor.rs1_living_room_occupancy_count
name: People
- entity: sensor.rs1_living_room_activity_level
name: Activity

Using the custom Floorplan card:

type: picture-elements
image: /local/floorplan.png
elements:
- type: state-icon
entity: binary_sensor.rs1_living_room_occupancy
style:
left: 30%
top: 40%
- type: state-label
entity: sensor.rs1_living_room_occupancy_count
style:
left: 30%
top: 45%

RS-1 integrates with Apple Home for Siri control and automations.

RS-1 supports HomeKit natively.

  1. Open Apple Home app on iPhone
  2. Tap ”+” → Add Accessory
  3. Scan HomeKit QR code:
    • Find in OpticWorks app: Room → Sensor → Settings → HomeKit
    • Or on the Quick Start Guide card
  4. Assign to room
  5. Done!

RS-1 appears as:

AccessoryTypeDescription
RS-1 OccupancyOccupancy SensorBinary occupied/empty
RS-1 MotionMotion SensorMovement detected

Create automations in Apple Home:

Lights When Occupied:

  1. Home app → Automation → ”+”
  2. “An Accessory is Controlled”
  3. Select RS-1 Occupancy → “Detects Occupancy”
  4. Add lights → Turn On
  5. Done

Turn Off When Empty:

  1. Home app → Automation → ”+”
  2. “An Accessory is Controlled”
  3. Select RS-1 Occupancy → “Stops Detecting Occupancy”
  4. Wait 5 minutes
  5. Add lights → Turn Off
  • Only occupancy and motion (no zones)
  • No position data
  • No sensitivity control
  • For full features, use Home Assistant

RS-1 supports Matter over WiFi for universal smart home compatibility.

  1. Enable Matter in RS-1:

    • OpticWorks app → Room → Sensor → Settings
    • Enable “Matter”
    • Note the pairing code
  2. Add to Controller:

    Apple Home:

    • Home app → ”+” → Add Accessory
    • Enter pairing code or scan QR

    Google Home:

    • Google Home app → ”+” → Set up device
    • Matter-enabled device
    • Enter pairing code

    Amazon Alexa:

    • Alexa app → More → Add Device
    • Matter → Enter pairing code
FeatureSupported
Occupancy Sensing
Motion Detection
Multi-Admin
OTA Updates

RS-1 can be added to multiple Matter controllers simultaneously:

  1. After initial pairing, open OpticWorks app
  2. Go to Sensor → Settings → Matter
  3. Tap “Add Another Controller”
  4. Generate new pairing code
  5. Pair with additional controller

For custom integrations or non-Home Assistant MQTT systems.

opticworks/rs1/<device_id>/state # JSON state object
opticworks/rs1/<device_id>/availability # online/offline
opticworks/rs1/<device_id>/command # Command input
{
"occupancy": true,
"motion": true,
"count": 2,
"targets": [
{
"id": 1,
"x": 2.3,
"y": 0.9,
"z": 1.5,
"speed": 0.2
},
{
"id": 2,
"x": 1.1,
"y": 0.8,
"z": 3.2,
"speed": 0.0
}
],
"zones": {
"couch": true,
"desk": false
},
"activity_level": 45,
"wifi_rssi": -52
}

Send JSON to command topic:

// Set sensitivity
{"command": "set_sensitivity", "value": 75}
// Trigger recalibration
{"command": "recalibrate"}
// Set night mode
{"command": "night_mode", "enabled": true}

Integrate RS-1 with Node-RED for advanced automation flows.

{
"server": "192.168.1.100",
"port": 1883,
"topic": "opticworks/rs1/+/state"
}

Presence → Lighting Control:

[MQTT In] → [JSON Parse] → [Switch] → [Function] → [MQTT Out]
| |
RS-1 state occupancy
true/false

Function node:

if (msg.payload.occupancy && msg.payload.count > 0) {
msg.payload = {
"brightness": Math.min(100, msg.payload.count * 30),
"state": "on"
};
} else {
msg.payload = {"state": "off"};
}
return msg;

RS-1 provides a local REST API for custom integrations.

EndpointMethodDescription
/api/statusGETCurrent state
/api/configGET/POSTConfiguration
/api/zonesGETZone status
/api/targetsGETTarget positions
/api/calibratePOSTTrigger calibration
Terminal window
curl http://192.168.1.50/api/status

Response:

{
"device_id": "rs1-a1b2c3",
"firmware": "1.2.3",
"occupancy": true,
"count": 2,
"last_motion": "2024-01-15T10:30:00Z",
"uptime": 86400
}

Enable API authentication in settings:

Terminal window
curl -H "Authorization: Bearer YOUR_API_KEY" \
http://192.168.1.50/api/status

Configure RS-1 to send webhooks on presence events.

  1. Sensor Settings → Integrations → Webhooks
  2. Add webhook URL
  3. Select events
{
"event": "occupancy_changed",
"device_id": "rs1-a1b2c3",
"room": "Living Room",
"data": {
"occupancy": true,
"count": 1,
"timestamp": "2024-01-15T10:30:00Z"
}
}
  • occupancy_changed
  • motion_detected
  • zone_entered
  • zone_exited
  • count_changed
IssueSolution
Connection refusedCheck broker IP and port
Auth failedVerify username/password
No entities appearCheck discovery prefix matches HA
Entities unavailableVerify RS-1 is online
IssueSolution
Can’t find accessoryEnsure on same network
Pairing failsReset HomeKit in RS-1 settings
No responseRestart RS-1
Automations don’t runCheck Home app automation settings
IssueSolution
Pairing timeoutMove phone closer to RS-1
Code rejectedVerify code, try regenerating
Device offlineCheck WiFi connection
Multi-admin failsEnsure first controller allows it
FeatureHome AssistantHomeKitMatterMQTT
Occupancy
Motion
Person Count
Position Data
Zones
Sensitivity Control
Calibration

Recommendation: Use Home Assistant with MQTT for full functionality, or HomeKit/Matter for simple presence-based automations.