Skip to content

KrzysztofZurek1973/webthing-motion-sensor

Repository files navigation

webThing Motion Sensor

Introduction

WebThing Motion Sensor is prepared for ESP32 CPUs and uses esp-idf environment (freeRTOS and LwIP included).

It reads the output (default GPIO18 pin) from the motion sensor and communicates with the WebThings Gateway via the WebThing API.

The example motion sensor is here.

Dependencies

Requires:

Example

webthings-node-example-project

or

webthings-empty-project

Features

webThing interface

This webThing has the following properties and one event:

  • motion - motion detected
  • alarm ON/OFF - alarm activation, a notification is sent each time motion is detected
  • counter-1 - motion detection counter, 0..5000
  • last alarm - time of the last sent alarm (notification)
  • counter-2 - alarm counter, 0..99
  • alarm notification (event) - sent when motion detected and alarm is activated

Example event log is shown below.

motion sensor event log

Documentation

See webthings-empty-project and follow steps described in Build webThing Device chapter.

In point 5 download webthing-motion-sensor repository. In function init_things() call init_motion_sensor() and include webthing_motion_sensor.h in your main project file.

Source Code

The source is available from GitHub.

Links

License

This project is licensed under the MIT License.

Authors

About

WebThing: Motion sensor with counter and alarm event.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published