power-outlet-mqtt-listener.pl - MQTT listener to control Power::Outlet devices
power-outlet-mqtt-listener.pl [-c /etc/power-outlet-mqtt-listener.yml]
This script provides an MQTT listener to control Power::Outlet devices
The YAML formatted file /etc/power-outlet-mqtt-listener.yml is a key-value hash.
The "host" key value is a string representing the host name of the MQTT server.
The "directives" key value is a list of individual directives with "name", "topic", "value" (topic payload to match) and "actions".
The "actions" key value is a list of individual actions to run when "topic" and "value" match. Individual actions have keys "name", "driver", "command", and "options". "options" is a hash of options that is passed to the driver.
Example:
--- host: mqtt directives: - name: Smart Outlet Top Button Press topic: cmnd/smartoutlet_button_topic/POWER1 value: TOGGLE actions: - name: Outside Lights driver: iBootBarGroup command: 'ON' options: outlets: '1,2,6,7' host: bar - name: Smart Outlet Bottom Button Press topic: cmnd/smartoutlet_button_topic/POWER2 value: TOGGLE actions: - name: Outside Lights driver: iBootBarGroup command: 'OFF' options: outlets: '1,2,6,7' host: bar
The included rpm spec file installs a systemd service file so you can run this process from systemd.
systemctl power-outlet-mqtt-listener.service enable systemctl power-outlet-mqtt-listener.service start
rpmbuild -ta Power-Outlet-*.tar.gz
sudo yum install perl-Power-Outlet-mqtt-listener
Copyright (c) 2020 Michael R. Davis <mrdvt92>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Power::Outlet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Power::Outlet
CPAN shell
perl -MCPAN -e shell install Power::Outlet
For more information on module installation, please visit the detailed CPAN module installation guide.