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

eventIdstringrequiredUnique identifier for this event instance
eventTypestringrequiredEvent type in dot notation: device.action (e.g. door.opened, light.turned_on)
timestampstring (ISO 8601)requiredUTC time the event occurred on the device
stateobjectrequiredCurrent device state after the event
state.previousContactstringoptionalState before this event — useful for transition-based automations
automationobjectoptionalAutomation context — which rule fired and what actions were taken
sourcestringoptionalProtocol the device uses: zigbee, z-wave, wifi, matter, bluetooth

Variants

Thermostat ChangedThermostat setpoint changed by the user.
Thermostat Changed
{
  "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

Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.

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