Skip to content
Remote controller for Nexa devices using Raspberry Pi
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
apple-watch-app
templates
tests
.gitignore
LICENSE
README.md
blinker.py
controller.py
controller_config.ini.example
controller_config.py
datadog_stat.py
kodi_play_pause.py
manual_switch.py
presence_controller.py
requirements.txt
restart.sh
switch_nexa.py
time_controller.py
web_interface.py

README.md

nexa-controller-rpi

This small project was written in order to use Raspberry Pi as a central controller for Nexa remote-controlled electrical outlets.

Hardware

Besides Nexa electrical outlets itself and Raspberry Pi, you will need a 433 MHz transmitter module for Rasberry Pi like this one.

Configuration

All tests were performed on Raspberry Pi with Raspbian OS.

RPi.GPIO python package is required.

Currently I run this installation on Raspberry Pi 2 with Raspbian Wheezy.

Configuration can be done via controller_config.ini or the web interface (web_interface.py)

Manual switch

To perform manual switch on/off (e.g. to pair RPi with the outlet), use:

python manual_switch.py on|off data_pin_number transmitter_code

How to start

Start it using ./restart.sh

It also starts a simple REST server on port 8080, which accepts /open and /close GET requests.

Log will be written to /run/nexa_controller.log and /run/nexa_rest_server.log

Modules

  • TimeController module enables selected electric outlet between sunrise and sunset for your geographical location (fetched by public IP of Raspberry Pi gateway)
  • PresenceController module allows to enable selected electric outlet only when configured MAC addresses are connected to the local router (tested on ASUS RT-AC66U).

Many thanks to this blog author for a comprehensive Nexa protocol analysis

freegeoip.io public API is used to fetch geo position based on public IP address

sunrise-sunset.org public API is used to calculate twilight timings based on location

You can’t perform that action at this time.