Home Assistant is great at automations, but adding a custom AI sensor usually means setting up an MQTT broker, writing YAML, or shipping a custom Python integration. This project does it without any of that — an AI model runs locally on your Grablo device, watches your camera feed for people, and exposes the live count as a Home Assistant entity using a Long-Lived Access Token.
Once the project is running, the entity shows up in Home Assistant and updates the moment the count changes. Drop it into your dashboard, use it in occupancy automations, or graph it on the History panel — it behaves like any other native HA sensor.
- Real-time AI people counting on any network camera
- Home Assistant entity auto-exposed via the HA REST API
- Live updates the moment the count changes
- Camera + count live dashboard in Grablo
- No MQTT broker, no YAML, no code
People keep asking how to add a real AI sensor to Home Assistant without standing up a separate stack. Most tutorials route you through an MQTT broker, Frigate, or a custom integration that you have to maintain. We wanted to show that with a visual block editor and the HA Long-Lived Access Token, you can do it end-to-end in a few clicks — and the same pattern works for any variable, not just people counts.
What You'll Build- An AI camera that counts people in real time
- A variable that stores the live count
- A Home Assistant entity exposed automatically by Grablo
- A live dashboard with the camera feed and current count
- Automatic entity updates the moment the count changes
- Download and install Grablo software on your device from grablo.co/download
- Get this project from the Grablo Gallery
- Fill in your camera's connection details in Settings → Camera → Edit → enter the address and credentials
- Fill in your Home Assistant connection in Settings → Home Assistant → Edit → enter the server address and paste a Long-Lived Access Token from HA → Profile → Security → Long-lived access tokens
- Connect to your device and hit RUN
- In Home Assistant, click the search icon in the top right and search for your count variable name — the new entity appears automatically
The Grablo dashboard has two widgets — a Camera widget showing the live feed for monitoring, and a Label widget bound to the People Count variable so you can see the AI's count update in real time. The same value is also visible inside Home Assistant as a native sensor entity, so you can build HA automations on top of it.
The whole project runs on a single logic with two controls. The first control fires once at startup with a Once condition and runs two AI Analysis actions — Add Analysis creates a Count Specific Objects task with the person class at 40% confidence, and Start Analysis kicks off the model on the camera feed. The count is automatically written to the People Count variable.
The second control watches the People Count variable with an On Change condition and a 100ms sampling period, so it reacts the moment the AI updates the count. Its single action is a Home Assistant Integration with the Expose Variables command — Grablo handles the REST API call to register the entity and push the new value, so Home Assistant sees a live sensor without any broker or YAML.
Two controls, one variable, and your camera is now a real Home Assistant sensor.
Expected Results- The Grablo dashboard shows the camera feed with a live people count
- In Home Assistant, search for your variable name in the top-right search — the entity appears automatically
- The HA entity value updates in real time as the AI count changes
- You can drop the entity into HA dashboards or use it in any automation, just like a native sensor
The project ships with the Camera and Home Assistant blocks already defined but with blank connection details — every setup is different, so you fill these in after copying the project.
Go to Settings → Camera → Edit and enter the connection details for your camera. Both ONVIF and RTSP are supported, and an old analog CCTV works too if you bridge it through a USB video capture adapter (then use CSI/USB).
For the AI mode, Balanced is the default — switch to Fast on lower-end devices like a Raspberry Pi, or Accurate if you have a more capable machine. If your device has a powerful GPU, turn on GPU acceleration for a major speed boost.
Then go to Settings → Home Assistant → Edit and enter your HA server address and a Long-Lived Access Token (HA → Profile → Security → Long-lived access tokens).
What's Next?- Add an HA automation that turns on lights when the people count goes above zero
- Send a phone notification when occupancy exceeds a threshold
- Log the count history in Home Assistant's History panel over weeks or months
- Expose more variables — face detection, gesture, sound level — to build a multi-sensor AI hub
- Combine multiple cameras into a single occupancy total exposed as one entity
- Camera feed not showing: Double-check Settings → Camera → Edit — the project ships without camera credentials, so you need to enter your camera's address and login manually
- Entity not appearing in Home Assistant: Make sure the HA address is reachable from your Grablo device and that the Long-Lived Access Token was pasted correctly and has not expired
- AI is slow or laggy: Switch the AI mode to Fast, or enable GPU acceleration if your device has a capable GPU
- Counts updating too frequently: Increase the Sampling Period on the On Change condition so Grablo checks for changes less often









Comments