Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change name to amr2mqtt #17

Merged
merged 2 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ updates:
schedule:
interval: daily
- package-ecosystem: docker
directory: "/amridm2mqtt"
directory: "/amr2mqtt"
schedule:
interval: daily
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Home Assistant Add-on: AMRIDM2MQTT
# Home Assistant Add-on: AMR2MQTT

[![GitHub Release][releases-shield]][releases]
![Project Stage][project-stage-shield]
Expand All @@ -23,9 +23,16 @@ with a specific repository URL pre-filled.][add-repo-shield]][add-repo]

## About

Port of ragingcomputer's [amridm2mqtt][amridm2mqtt] to a Home Assistant add-on
in order to make it easier to install and use in supervised and HAOS setups. Allows
you to use an rtl-sdr dongle to listen for signals from compatible smart meters.
Allows you to use an rtl-sdr dongle to listen for signals from ERT compatible
smart meters using [rtlamr][rtlamr]. This runs as a daemon by launching rtl-tcp
and rtlamr, parsing the output and pushing it into MQTT so Home Assistant can
consume it.

This began as a port of ragingcomputer's [amridm2mqtt][amridm2mqtt] to a Home
Assistant add-on in order to make it easier to use in HAOS and supervised setups.
There are a number of other modifications as well such as support for other formats
like `scm` and a wider variety of MQTT configurations. Big thanks to ragingcomputer's
for their work as well as all the info in the `rtlamr` repo.

## Support

Expand All @@ -44,7 +51,7 @@ You could also [open an issue here][issue] on GitHub.

The original setup of this repository is by [Mike Degatano][mdegat01].

The amridm2mqtt service ported here was created by [ragingcomputer][ragingcomputer].
The amridm2mqtt service this was built off of was created by [ragingcomputer][ragingcomputer].

For a full list of all authors and contributors,
check [the contributor's page][contributors].
Expand Down Expand Up @@ -75,28 +82,29 @@ SOFTWARE.

[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[add-addon-shield]: https://my.home-assistant.io/badges/supervisor_addon.svg
[add-addon]: https://my.home-assistant.io/redirect/supervisor_addon/?addon=39bd2704_amridm2mqtt
[add-addon]: https://my.home-assistant.io/redirect/supervisor_addon/?addon=39bd2704_amr2mqtt
[add-repo-shield]: https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg
[add-repo]: https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgit.luolix.top%2Fmdegat01%2Fhassio-addons
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[amridm2mqtt]: https://github.com/ragingcomputer/amridm2mqtt
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
[commits-shield]: https://img.shields.io/github/commit-activity/y/mdegat01/addon-amridm2mqtt.svg
[commits]: https://github.com/mdegat01/addon-amridm2mqtt/commits/main
[contributors]: https://github.com/mdegat01/addon-amridm2mqtt/graphs/contributors
[commits-shield]: https://img.shields.io/github/commit-activity/y/mdegat01/addon-amr2mqtt.svg
[commits]: https://github.com/mdegat01/addon-amr2mqtt/commits/main
[contributors]: https://github.com/mdegat01/addon-amr2mqtt/graphs/contributors
[discord-ha]: https://discord.gg/c5DvZ4e
[forum-centralcommand]: https://community.home-assistant.io/u/CentralCommand/?u=CentralCommand
[forum-shield]: https://img.shields.io/badge/community-forum-brightgreen.svg
[forum]: https://community.home-assistant.io
[mdegat01]: https://github.com/mdegat01
[github-actions-shield]: https://github.com/mdegat01/addon-amridm2mqtt/workflows/CI/badge.svg
[github-actions]: https://github.com/mdegat01/addon-amridm2mqtt/actions
[github-actions-shield]: https://github.com/mdegat01/addon-amr2mqtt/workflows/CI/badge.svg
[github-actions]: https://github.com/mdegat01/addon-amr2mqtt/actions
[i386-shield]: https://img.shields.io/badge/i386-no-red.svg
[issue]: https://github.com/mdegat01/addon-amridm2mqtt/issues
[license-shield]: https://img.shields.io/github/license/mdegat01/addon-amridm2mqtt.svg
[issue]: https://github.com/mdegat01/addon-amr2mqtt/issues
[license-shield]: https://img.shields.io/github/license/mdegat01/addon-amr2mqtt.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
[ragingcomputer]: https://github.com/ragingcomputer
[releases-shield]: https://img.shields.io/github/release/mdegat01/addon-amridm2mqtt.svg
[releases]: https://github.com/mdegat01/addon-amridm2mqtt/releases
[releases-shield]: https://img.shields.io/github/release/mdegat01/addon-amr2mqtt.svg
[releases]: https://github.com/mdegat01/addon-amr2mqtt/releases
[rtlamr]: https://github.com/bemasher/rtlamr
File renamed without changes.
15 changes: 7 additions & 8 deletions amridm2mqtt/DOCS.md → amr2mqtt/DOCS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Home Assistant Add-on: HedgeDoc
# Home Assistant Add-on: AMR2MQTT

## Install

Expand Down Expand Up @@ -127,7 +127,7 @@ You could also [open an issue here][issue] on GitHub.

The original setup of this repository is by [Mike Degatano][mdegat01].

The amridm2mqtt service ported here was created by [ragingcomputer][ragingcomputer].
The amridm2mqtt service this was built off of was created by [ragingcomputer][ragingcomputer].

For a full list of all authors and contributors,
check [the contributor's page][contributors].
Expand Down Expand Up @@ -157,18 +157,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[add-addon-shield]: https://my.home-assistant.io/badges/supervisor_addon.svg
[add-addon]: https://my.home-assistant.io/redirect/supervisor_addon/?addon=39bd2704_amridm2mqtt
[add-addon]: https://my.home-assistant.io/redirect/supervisor_addon/?addon=39bd2704_amr2mqtt
[add-addon-mosquitto]: https://my.home-assistant.io/redirect/supervisor_addon/?addon=core_mosquitto
[add-repo-shield]: https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg
[add-repo]: https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgit.luolix.top%2Fmdegat01%2Fhassio-addons
[addon-mosquitto]: https://github.com/home-assistant/addons/tree/master/mosquitto
[amridm2mqtt]: https://github.com/ragingcomputer/amridm2mqtt
[contributors]: https://github.com/mdegat01/addon-hedgedoc/graphs/contributors
[contributors]: https://github.com/mdegat01/addon-amr2mqtt/graphs/contributors
[discord-ha]: https://discord.gg/c5DvZ4e
[forum-centralcommand]: https://community.home-assistant.io/u/CentralCommand/?u=CentralCommand
[forum]: https://community.home-assistant.io/t/home-assistant-add-on-hedgedoc/296809?u=CentralCommand
[issue]: https://github.com/mdegat01/addon-hedgedoc/issues
[forum]: https://community.home-assistant.io
[issue]: https://github.com/mdegat01/addon-amr2mqtt/issues
[mdegat01]: https://github.com/mdegat01
[ragingcomputer]: https://github.com/ragingcomputer
[releases]: https://github.com/mdegat01/addon-hedgedoc/releases
[releases]: https://github.com/mdegat01/addon-amr2mqtt/releases
[semver]: http://semver.org/spec/v2.0.0
8 changes: 4 additions & 4 deletions amridm2mqtt/Dockerfile → amr2mqtt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ RUN set -eux; \
update-ca-certificates; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
\
echo "Add user for AMRIDM2MQTT"; \
mkdir -p /data/amridm2mqtt; \
useradd -u 12345 -U -d /data/amridm2mqtt abc;
echo "Add user for AMR2MQTT"; \
mkdir -p /data/amr2mqtt; \
useradd -u 12345 -U -d /data/amr2mqtt abc;

# Add rtlamr
COPY --from=build_rtlamr /usr/bin/rtlamr /usr/bin/rtlamr
RUN rtlamr --version

COPY rootfs /
WORKDIR /data/amridm2mqtt
WORKDIR /data/amr2mqtt

# Build arguments
ARG BUILD_ARCH
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions amridm2mqtt/config.yaml → amr2mqtt/config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: AMRIDM2MQTT
url: https://github.com/mdegat01/addon-amridm2mqtt
name: AMR2MQTT
url: https://github.com/mdegat01/addon-amr2mqtt
version: dev
slug: amridm2mqtt
slug: amr2mqtt
arch:
- aarch64
- amd64
- armv7
- armhf
description: AMRIDM2MQTT for Home Assistant
description: AMR2MQTT for Home Assistant
uart: true
udev: true
usb: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
Runs rtlamr to watch for IDM broadcasts from power meter. If meter id
Runs rtlamr to watch for broadcasts from power meter. If meter id
is in the list, usage is sent to 'readings/{meter id}/meter_reading'
topic on the MQTT broker specified in settings.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Add-on: AMRIDM2MQTT
# Home Assistant Add-on: AMR2MQTT
# This validates config and sets up app files/folders
# ==============================================================================

Expand Down
2 changes: 2 additions & 0 deletions amr2mqtt/rootfs/etc/fix-attrs.d/permissions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/data/amr2mqtt true abc 0755 0755
/amr2mqtt true abc 0555 0555
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Add-on: AMRIDM2MQTT
# Take down the S6 supervision tree when AMRIDM2MQTT fails
# Home Assistant Add-on: AMR2MQTT
# Take down the S6 supervision tree when AMR2MQTT fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Home Assistant Add-on: Hedgedoc
# Runs Hedgedoc
# Home Assistant Add-on: AMR2MQTT
# Runs AMR2MQTT
# ==============================================================================

declare host
Expand Down Expand Up @@ -69,6 +69,6 @@ export LOG_LEVEL="${log_level}"
bashio::log.info "Log level set to ${log_level}"


bashio::log.info 'Handing over control to AMRIDM2MQTT...'
bashio::log.info 'Handing over control to AMR2MQTT...'
exec s6-setuidgid abc \
/usr/bin/python3 /amridm2mqtt/amridm2mqtt.py
/usr/bin/python3 /amr2mqtt/amr2mqtt.py
2 changes: 0 additions & 2 deletions amridm2mqtt/rootfs/etc/fix-attrs.d/permissions

This file was deleted.