"Standards are great," the old saying goes; "everyone should have one of their very own." Nowhere is this more obvious than in the Internet of Things (IoT), where products from one manufacturer - Philips Hue lightbulbs, for instance, or Google-owned Nest's thermostats - so rarely integrate with those of another.
Shiny things vendor Apple has a standard of its own, dubbed HomeKit, which is designed to heavily integrate into its iOS mobile operating system and the Siri voice-activated assistant thereon. It's seen reasonable uptake with third party manufacturers, but it can still be difficult to find exactly what you need - unless, of course, you take the maker route of building it yourself.
Galen Wollenberg has published an Instructable which walks the reader through using an Arduino-compatible microcontroller with network connectivity - an Arduino MRK1000, for example, or ultra-affordable ESP8266 - to build a motion sensor which integrates with Apple's HomeKit. Each sensor can also be upgraded to include ambient light, temperature, and humidity sensing, at a cost a fraction that of a similar commercial product.
The secret behind Galen's success is HomeBridge, an open-source gateway which allows devices on the network to interface with HomeKit systems. Open source and compatible with a range of devices through Node.js-powered plugins, HomeBridge is quickly installed on any always-on computer, whether that's a home server, an open-source router, or a low-powered single-board computer (SBC). If you have an iOS device already, it's a great way to quickly build a clever network of devices on a very tight budget.
Galen's full guide can be found on Instructables.
I can put one of each of these in each room, and then use the iOs 'Eve' app to publish automatic HomeKit Automation rules and triggers, i.e.: "if is motion detected in the bedroom, automatically turn on the Bedroom lights". This can be combined with my CurrentAmbientLighLevel plugin, and the DS18B20 or DHT11/DHT22 plugins (or HttpTemperatureHum plugin) to make a super room sensor for HomeKit / HomeBridge.