IoT & Sensors

Smart Home Event JSON Example

A JSON example for a smart home device event — covers door sensors, thermostats, and smart lights with device state, trigger source, and automation metadata.

{
  "eventId": "evt_H7mQpXnL3w",
  "eventType": "door.opened",
  "deviceId": "dev_FrontDoor01",
  "deviceName": "Front Door Sensor",
  "deviceCategory": "door-sensor",
  "roomId": "room_entrance",
  "roomName": "Entrance",
  "homeId": "home_4k9JrTvBx",
  "timestamp": "2025-06-01T07:32:14Z",
  "state": {
    "contact": "open",
    "previousContact": "closed",
    "battery": 91,
    "tamper": false,
    "linkQuality": 255
  },
  "automation": {
    "triggered": true,
    "ruleId": "rule_morning_lights",
    "ruleName": "Morning Arrival Lights",
    "actionsExecuted": [
      {
        "deviceId": "dev_Hall_Light",
        "action": "turn_on",
        "success": true
      },
      {
        "deviceId": "dev_Alarm",
        "action": "disarm",
        "success": true
      }
    ]
  },
  "source": "zigbee"
}

Field Reference

eventIdrequiredstringUnique identifier for this event instance
eventTyperequiredstringEvent type in dot notation: device.action (e.g. door.opened, light.turned_on)
timestamprequiredstring (ISO 8601)UTC time the event occurred on the device
staterequiredobjectCurrent device state after the event
state.previousContactoptionalstringState before this event — useful for transition-based automations
automationoptionalobjectAutomation context — which rule fired and what actions were taken
sourceoptionalstringProtocol the device uses: zigbee, z-wave, wifi, matter, bluetooth

Variants

Thermostat ChangedThermostat setpoint changed by the user.
{
  "eventId": "evt_T8rNqWzP2v",
  "eventType": "thermostat.setpoint_changed",
  "deviceId": "dev_Thermostat01",
  "deviceName": "Living Room Thermostat",
  "timestamp": "2025-06-01T18:30:00Z",
  "state": {
    "mode": "cool",
    "setpoint": 24,
    "previousSetpoint": 26,
    "currentTemperature": 28.4,
    "humidity": 55
  },
  "source": "wifi",
  "changedBy": "user"
}

Common Use Cases

  • Triggering webhook notifications to a home automation hub (Home Assistant, Hubitat)
  • Storing device state history in a time-series database
  • Building conditional automation rules based on device state transitions
smart-homeioteventautomationwebhook

Validate or format this JSON

One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.

Frequently Asked Questions

Use dot-notation: entity.action (e.g. door.opened, light.turned_on, thermostat.mode_changed). This is consistent with Stripe, Shopify, and GitHub webhook conventions and makes filtering by category easy with a prefix match.

Include the previous value for the fields that changed (like previousContact or previousSetpoint) and the full current state. Consumers building timelines or detecting transitions need to know what it was before.

Related JSON Examples