Context for developing and debugging Hubitat Elevation apps, drivers, and hub environment — sandbox constraints, lifecycle idioms, capability contracts, plus grounded deploy/log-tail/lint mechanisms.
81
94%
Does it follow best practices?
Impact
27%
Average score across 2 eval scenarios
Advisory
Suggest reviewing before use
Hubitat has two distinct persistence mechanisms. Choosing the wrong one is a design bug that surfaces later as "my automation never fires" or "my data vanished".
sendEvent(name: "switch", value: "on", descriptionText: "${device.displayName} switch is on").isStateChange: true. type is "physical" (user acted on the device) or "digital" (hub commanded it).createEvent(...) builds an event map without sending — used when returning events from parse().state is a Map-like store for the app/driver's own data between wakes, serialized to/from JSON. state.foo = "bar".DeviceWrapper, a closure, or other live objects in state breaks — keep device references out of state.state writes just before the instance sleeps. atomicState commits immediately — use it only when overlapping executions can race, and prefer singleThreaded: true in definition as the cheaper alternative.state is serialized every execution; don't store large blobs there.sendEvent.state.