App-mqtt2job
view release on metacpan or search on metacpan
lib/App/mqtt2job.pm view on Meta::CPAN
=====================================================================
title: [% task %]
path: [% task %]
icon: mdi:widgets
type: panel
cards:
- type: entities
entities:
- entity: sensor.[% task %]_datetime
- entity: sensor.[% task %]_elapsed
- entity: sensor.[% task %]_message
- entity: sensor.[% task %]_status
- entity: sensor.[% task %]_output
subview: true
_HA_CFG_TPL
return \$tpl;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
App::mqtt2job - Helper module for mqtt2job
=head1 VERSION
version 0.03
=head1 SYNOPSIS
mqtt2job --mqtt_server mqtt.example.com --base_topic my/topic --job_dir /apps
=head1 DESCRIPTION
Subscribes to the my/topic/job mqtt topic and upon receiving a
correctly formatted json message will fork and run the requested
job in a wrapper script providing it is present and executable in
the job_dir directory.
This wrapper will generate two child mqtt messages under the base
topic, at my/topic/status. Message one is sent when the job is
initiated. The second is sent when the job has completed (or timed
out). This second message will also include any output from the job
amongst various other metadata (e.g. execution datetime, duration,
timeout condition, etc.)
=head1 NAME
App::mqtt2job - Subscribe to an MQTT topic and trigger job execution
=head1 FOR THE LOVE OF ALL THAT IS SACRED, WHY?
This is part one of my "Cursed Solutions" series, URL to be added
later when I've uploaded it.
=head1 COPYRIGHT
Copyright 2024 -- Chris Carline
=head1 LICENSE
This software is licensed under the same terms as Perl.
=head1 NO WARRANTY
This software is provided "as is" without any express or implied
warranty. Using it for any reason whatsoever is probably an
extremely bad idea and it should only ever be considered if you
understand the potential consequences. In no event shall the
author be held liable for any damages arising from the use of
this software. It is provided for demonstration purposes only.
=head1 AUTHOR
Chris Carline <chris@carline.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2024 by Chris Carline.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 2.262 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )