From 225f193fd72582442d903225505e0f219ac19a63 Mon Sep 17 00:00:00 2001 From: George Gougoudis Date: Wed, 12 Jun 2024 10:55:32 +0300 Subject: [PATCH 1/6] Add discovery name --- calimero-server/config.json | 2 ++ calimero-server/run.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/calimero-server/config.json b/calimero-server/config.json index cbac398..8dc91fa 100644 --- a/calimero-server/config.json +++ b/calimero-server/config.json @@ -12,6 +12,7 @@ "uart": true, "usb": true, "options": { + "discovey_name": "Hass OS KNXnet/IP Server", "knx_address": "1.1.0", "client_address_start": "1.1.101", "client_address_count": 5, @@ -21,6 +22,7 @@ "knx_source_override": true }, "schema": { + "discovey_name": "str", "knx_address": "str", "client_address_start": "str", "client_address_count": "int", diff --git a/calimero-server/run.sh b/calimero-server/run.sh index e0d64a1..3744242 100644 --- a/calimero-server/run.sh +++ b/calimero-server/run.sh @@ -1,5 +1,6 @@ #!/usr/bin/with-contenv bashio +DISCOVERY_NAME=$(bashio::config 'discovery_name') KNX_ADDRESS=$(bashio::config 'knx_address') CLIENT_ADDRESS_START=$(bashio::config 'client_address_start') CLIENT_ADDRESS_COUNT=$(bashio::config 'client_address_count') @@ -37,7 +38,7 @@ fi CONFIG_XML=" - + From 430bc56a0da742eaaa48000b96df985c77b1f428 Mon Sep 17 00:00:00 2001 From: George Gougoudis Date: Wed, 12 Jun 2024 11:09:27 +0300 Subject: [PATCH 2/6] fix typo --- calimero-server/config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calimero-server/config.json b/calimero-server/config.json index 8dc91fa..a19057d 100644 --- a/calimero-server/config.json +++ b/calimero-server/config.json @@ -12,7 +12,7 @@ "uart": true, "usb": true, "options": { - "discovey_name": "Hass OS KNXnet/IP Server", + "discovery_name": "Hass OS KNXnet/IP Server", "knx_address": "1.1.0", "client_address_start": "1.1.101", "client_address_count": 5, @@ -22,7 +22,7 @@ "knx_source_override": true }, "schema": { - "discovey_name": "str", + "discovery_name": "str", "knx_address": "str", "client_address_start": "str", "client_address_count": "int", From 9e5a20ea1c0d820359012383f92e0c7eff9a9557 Mon Sep 17 00:00:00 2001 From: georgegougoudis <156668518+georgegougoudis@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:32:50 +0200 Subject: [PATCH 3/6] Update Dockerfile Update repositories --- calimero-server/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/calimero-server/Dockerfile b/calimero-server/Dockerfile index 5fc29b1..3a52567 100644 --- a/calimero-server/Dockerfile +++ b/calimero-server/Dockerfile @@ -57,11 +57,10 @@ RUN cd /opt/calimero/ \ && rm -R org # https://s01.oss.sonatype.org/#nexus-search;quick~io.calimero RUN cd /opt/calimero/ \ - && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-rxtx/3.0-SNAPSHOT/calimero-rxtx-3.0-20240209.103824-5.jar \ - && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-core/3.0-SNAPSHOT/calimero-core-3.0-20240209.103824-6.jar \ - && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-device/3.0-SNAPSHOT/calimero-device-3.0-20240209.103824-5.jar \ - && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-server/3.0-SNAPSHOT/calimero-server-3.0-20240209.103824-5.jar - + && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-rxtx/3.0-SNAPSHOT/calimero-rxtx-3.0-20240331.030215-6.jar \ + && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-core/3.0-SNAPSHOT/calimero-core-3.0-20240818.140036-12.jar \ + && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-device/3.0-SNAPSHOT/calimero-device-3.0-20240818.140053-9.jar \ + && wget https://s01.oss.sonatype.org/service/local/repositories/snapshots/content/io/calimero/calimero-server/3.0-SNAPSHOT/calimero-server-3.0-20240818.140122-11.jar ARG BUILD_FROM FROM $BUILD_FROM @@ -76,4 +75,4 @@ COPY --from=build /opt/calimero /opt/calimero COPY run.sh / RUN chmod a+x /run.sh -CMD [ "/run.sh" ] \ No newline at end of file +CMD [ "/run.sh" ] From e624c5243f01d80b871282825567e756bb6082eb Mon Sep 17 00:00:00 2001 From: georgegougoudis <156668518+georgegougoudis@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:33:30 +0200 Subject: [PATCH 4/6] Delete snmp-trap directory --- snmp-trap/Dockerfile | 16 --------- snmp-trap/README.md | 42 ----------------------- snmp-trap/config.json | 21 ------------ snmp-trap/icon.png | Bin 2823 -> 0 bytes snmp-trap/logo.png | Bin 2823 -> 0 bytes snmp-trap/run.sh | 9 ----- snmp-trap/trap.py | 77 ------------------------------------------ 7 files changed, 165 deletions(-) delete mode 100644 snmp-trap/Dockerfile delete mode 100644 snmp-trap/README.md delete mode 100644 snmp-trap/config.json delete mode 100644 snmp-trap/icon.png delete mode 100644 snmp-trap/logo.png delete mode 100644 snmp-trap/run.sh delete mode 100644 snmp-trap/trap.py diff --git a/snmp-trap/Dockerfile b/snmp-trap/Dockerfile deleted file mode 100644 index 31d7ebe..0000000 --- a/snmp-trap/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -ARG BUILD_FROM -FROM $BUILD_FROM - -ENV LANG C.UTF-8 - -RUN apk update \ - && apk add --no-cache python3 py3-pip - -RUN pip install -f https://wheels.home-assistant.io/musllinux/ pysnmplib - -COPY trap.py / -RUN chmod a+x /trap.py -COPY run.sh / -RUN chmod a+x /run.sh - -CMD [ "/run.sh" ] \ No newline at end of file diff --git a/snmp-trap/README.md b/snmp-trap/README.md deleted file mode 100644 index e16d5a4..0000000 --- a/snmp-trap/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Home Assistant Add-On: SNMP Trap Reciever - -A SNMP trap reciever that will publish them as events to Home Assisstant via HTTP API based on the [pysnmp](https://github.com/pysnmp/pysnmp) python library. - -In Home Assisstant the traps can be used in an automation. Each event has a JSON payload like this: -``` -{"_source": "127.0.0.1", "_uptime": "123", "_trap_oid": "1.3.6.1.6.3.1.1.5.3", "1.3.6.1.2.1.2.2.1.1.5": "5"} -``` - -OIDs for my switch: -* "1.3.6.1.6.3.1.1.5.3" = link down -* "1.3.6.1.6.3.1.1.5.4" = link up -* "1.3.6.1.2.1.2.2.1.1.x" = port x - -Blueprint for deactivating the LAN port on link down: -https://gist.github.com/aschamberger/0ab0bd03561288cbb2ab079cad8f8a86 - -## Add-On Configuration - -The add-on requires the following configuration: -``` -port: 162 -community_string: public -``` - -`port` The port the reciever listens on (default: 162). - -`community_string` SNMP community string name (default: public). - -## Testing - -Sending traps via `snmptrap` from a Linux system: -``` -sudo apt-get install snmp -snmptrap -v2c -c public homeassistant:162 123 1.3.6.1.6.3.1.1.5.3 1.3.6.1.2.1.2.2.1.1.5 i 5 -``` -The command above sends a link down for port 5. - -## Links - -* supervisor token for HTTP API access: https://developers.home-assistant.io/docs/add-ons/communication/ -* based on https://pysnmp.readthedocs.io/en/latest/examples/v3arch/asyncio/manager/ntfrcv/transport-tweaks.html diff --git a/snmp-trap/config.json b/snmp-trap/config.json deleted file mode 100644 index ee35cac..0000000 --- a/snmp-trap/config.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "SNMP Trap Reciever", - "version": "0.1.4", - "slug": "snmp_trap", - "description": "Recieve SNMP v1/v2c traps and publish them as events to Home Assisstant", - "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], - "url": "https://github.com/aschamberger/hassio-addons/", - "init": false, - "startup": "services", - "boot": "auto", - "host_network": true, - "homeassistant_api": true, - "options": { - "port": 162, - "community_string": "public" - }, - "schema": { - "port": "int", - "community_string": "str" - } -} \ No newline at end of file diff --git a/snmp-trap/icon.png b/snmp-trap/icon.png deleted file mode 100644 index 1e8628dc22e8b0a7b7d72fde30394d2a00d7d355..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001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;qTM+gBP+(hXeHz zF9gRw7$=ra3yZI9D#rM}cU0bw@cMk_?*Z2{RqZYg)JIKasu#58uZII}Pfwrl{4%v>yagHb0vv*Yf71MKV!y>Ljr#-^LzCxx|&9S4k#vx za01zsZ_|%cl;*$Amz_Hu9VQW^Rm;um_%r0W|J>|S09)Jcx8QMOHF+ CommunityName mapping -config.addV1System(snmpEngine, 'my-area', communityString) - -# Callback function for receiving notifications -# noinspection PyUnusedLocal -def cbFun(snmpEngine, stateReference, contextEngineId, - contextName, varBinds, cbCtx): - - transportDomain, transportAddress = snmpEngine.msgAndPduDsp.getTransportInfo(stateReference) - - #print('Notification from %s, SNMP Engine %s, ' - # 'Context %s' % (transportAddress, contextEngineId.prettyPrint(), - # contextName.prettyPrint())) - - data = {'_source': transportAddress[0]} - - for name, val in varBinds: - #print('%s = %s' % (name.prettyPrint(), val.prettyPrint())) - name = name.prettyPrint() - if (name == '1.3.6.1.2.1.1.3.0'): - name = '_uptime' - elif (name == '1.3.6.1.6.3.1.1.4.1.0'): - name = '_trap_oid' - data[name] = val.prettyPrint() - - data = json.dumps(data) - print(data) - print(requests.post(url, headers=headers, data=data)) - -# Register SNMP Application at the SNMP engine -ntfrcv.NotificationReceiver(snmpEngine, cbFun) - -# Run asyncio main loop -loop.run_forever() \ No newline at end of file From c36698d50ad5d00bc22b9535b358844976a019af Mon Sep 17 00:00:00 2001 From: georgegougoudis <156668518+georgegougoudis@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:33:42 +0200 Subject: [PATCH 5/6] Delete remote-backup directory --- remote-backup/Dockerfile | 20 --------- remote-backup/LICENSE.md | 21 ---------- remote-backup/README.md | 49 ---------------------- remote-backup/config.json | 32 --------------- remote-backup/icon.png | Bin 2447 -> 0 bytes remote-backup/logo.png | Bin 2447 -> 0 bytes remote-backup/run.sh | 83 -------------------------------------- 7 files changed, 205 deletions(-) delete mode 100644 remote-backup/Dockerfile delete mode 100644 remote-backup/LICENSE.md delete mode 100644 remote-backup/README.md delete mode 100644 remote-backup/config.json delete mode 100644 remote-backup/icon.png delete mode 100644 remote-backup/logo.png delete mode 100644 remote-backup/run.sh diff --git a/remote-backup/Dockerfile b/remote-backup/Dockerfile deleted file mode 100644 index 4d016bf..0000000 --- a/remote-backup/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -ARG BUILD_FROM -FROM $BUILD_FROM - -# Add env -ENV LANG C.UTF-8 - -# Setup base -RUN apk add --no-cache openssh-client - -# Hass.io CLI -ARG BUILD_ARCH -RUN apk add --no-cache curl \ - && curl -Lso /usr/bin/ha https://github.com/home-assistant/cli/releases/download/4.18.0/ha_${BUILD_ARCH} \ - && chmod a+x /usr/bin/ha - -# Copy data -COPY run.sh / -RUN chmod a+x /run.sh - -CMD [ "/run.sh" ] diff --git a/remote-backup/LICENSE.md b/remote-backup/LICENSE.md deleted file mode 100644 index 463f43b..0000000 --- a/remote-backup/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Nicolai Bjerre Pedersen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/remote-backup/README.md b/remote-backup/README.md deleted file mode 100644 index 9526461..0000000 --- a/remote-backup/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Remote Backup Hass.io Add-On - -Automatically create Hass.io snapshots to remote server location using SCP. - -When the add-on is started the following happens: -1. Snapshot is created locally with a timestamp name, e.g. `Automated backup 2018-03-04 04:00`. -1. It is copied to the specified remote location using SCP. -1. The local backup is removed again (optional). - -Based on https://github.com/rccoleman/hassio-remote-backup / https://github.com/overkill32/hassio-remote-backup - -## Add-On Configuration - -The add-on requires the following configuration: -```json -{ - "ssh_host": "192.168.1.2", - "ssh_port": 22, - "ssh_user": "root", - "ssh_key": [ -"-----BEGIN RSA PRIVATE KEY-----", -"MIICXAIBAAKBgQDTkdD4ya/Qxz5xKaKojVIOVWjyeyEoEuAafAvYvppqmaBhyh4N", -"5av4i87y8tdGusdq7V0Zj0+js4jEdvJRDrXJBrp1neLfsjkF6t1XLfrA51Ll9SXF", -"...", -"X+6r/gTvUEQv1ufAuUE5wKcq9FsbnTa3FOF0PdQDWl0=", -"-----END RSA PRIVATE KEY-----" - ], - "remote_directory": "~/hassio-backups", - "password": "password_protect_it", - "keep_local_backup": "14" -} -``` - -`password` and `keep_local_backup` are optional attributes. `keep_local_backup` controls how many local backups you want to preserve. Default (`""`) is to keep no local backups created from this addon. If `all` then all local backups will be preserved. A positive integer will determine how many of the latest backups will be preserved. Note this will delete other local backups created outside this addon. - -## Example automating daily backups - -_configuration.yaml_ -```yaml -automations: - - alias: Daily Backup at 4 AM - trigger: - platform: time - at: '4:00:00' - action: - - service: hassio.addon_start - data: - addon: local_remote_backup -``` \ No newline at end of file diff --git a/remote-backup/config.json b/remote-backup/config.json deleted file mode 100644 index c4585e5..0000000 --- a/remote-backup/config.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "Remote Backup", - "version": "0.9", - "slug": "remote_backup", - "description": "Exploit hass cli backups and SCP to create remote backups to specified server", - "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], - "url": "https://github.com/aschamberger/hassio-addons/", - "init": false, - "startup": "once", - "boot": "manual", - "hassio_api": true, - "hassio_role": "backup", - "map": ["backup:rw"], - "options": { - "ssh_host": "", - "ssh_port": 22, - "ssh_user": "", - "ssh_key": [], - "remote_directory": "", - "password": "", - "keep_local_backup": "" - }, - "schema": { - "ssh_host": "str", - "ssh_port": "int", - "ssh_user": "str", - "ssh_key": ["str"], - "remote_directory": "str", - "password": "str", - "keep_local_backup": "match(^(all|[+]?\\d*)$)" - } -} diff --git a/remote-backup/icon.png b/remote-backup/icon.png deleted file mode 100644 index 32c4729896002a538064acbfe161d407f2a82c4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2447 zcmbtWi8mAq7oQDd$&9i4iqVs;C|i+K82i$Yp?VX8kQF_KwWJuZ5$it`a`xCx<&hOm&JNKM>&hOrH@3{$RN2?KpHSJ2gJN@MhxU+|tVW)(^KRIx&xFj89Z@jQp~);X^If_n>NBC)Rb2sJcY+cXn-p z)3d7CX8tMYyV>r9XW?npC5`=$3R&E_FIBCtA7n8Clm286eTc3Y)xO(sC8;x_bhx;4 zCb8~a+t}jt(x!LL0EX5bQZQsqeaRS{%WD4HIHtufZ!o`|yS%~Y@9uqG+3ueB(m1?e z5Xsuu{yE6~My?r~_`GgLY8&~un%eLIo6%d@_wi6l-{9+pLuYo!+41V3qW{kTC>i)+ zF@SK0_4RN7K)mZ0fPKN`cmMzju|b)-{M-E7jey`!=i&9NQ_il`y1=9cSfzV*+X)IC z_HEn}Iks^SJ8t58D^IqNQmN!xm6tUkPowqCSp}-Cgmc38_Sq&alf0OhvE~Us#A6jD zoC=WZD~^x^=q>AK+W`ukRXzG<<>+PTo1t|#Bp|$z$p2xs+M6H?2R!Q5Y|ib8R&p<6m*CZX|0rcN(CiWq4i%3k4L|+(XmOfTdv4Zn{G;e|52MXc3-XF`^{Jn z;z1GNk`rOKN@Vr7S(-!0oNLfrScWUyY=LTxSDKEah!naL#5%O5I;Y6Q8in5*x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Qk~jl{ThU-}38Au(5DN)tcc*{{c "/.ssh/config" - - while read -r line; do - echo "$line" >> /.ssh/id - done <<< "$SSH_KEY" - - chmod 600 "/.ssh/config" - chmod 600 "/.ssh/id" -} - -function copy-backup-to-remote { - - cd /backup/ - echo "Copying ${slug}.tar to ${REMOTE_DIRECTORY} on ${SSH_HOST} using SCP" - scp -F "/.ssh/config" "${slug}.tar" remote:"${REMOTE_DIRECTORY}" -} - -function delete-local-backup { - - ha backups reload - - if [[ ${KEEP_LOCAL_BACKUP} == "all" ]]; then - : - elif [[ -z ${KEEP_LOCAL_BACKUP} ]]; then - echo "Deleting local backup: ${slug}" - ha backups remove ${slug} - else - - last_date_to_keep=$($HA --raw-json backups list | jq .data.backups[].date | sort -r | \ - head -n "${KEEP_LOCAL_BACKUP}" | tail -n 1 | xargs date -D "%Y-%m-%dT%T" +%s --date ) - - ha --raw-json backups list | jq -c .data.backups[] | while read backup; do - if [[ $(echo ${backup} | jq .date | xargs date -D "%Y-%m-%dT%T" +%s --date ) -lt ${last_date_to_keep} ]]; then - echo "Deleting local backup: $(echo ${backup} | jq -r .slug)" - ha backups remove $(echo ${backup} | jq -r .slug) - fi - done - - fi - echo Exiting -} - -function create-local-backup { - name="Automated backup $(date +'%Y-%m-%d %H:%M')" - echo "Creating local backup: \"${name}\"" - if [[ -z $PASSWORD ]]; then - slug=$(ha backups new --name="${name}" | cut -d' ' -f2) - else - slug=$(ha backups new --name="${name}" --password="${PASSWORD}" | cut -d' ' -f2) - fi - echo "Backup created: ${slug}" -} - -add-ssh-key -create-local-backup -copy-backup-to-remote -delete-local-backup - -echo "Backup process done!" -exit 0 From 3a18454b19d2927b86eda662552498188ead3b12 Mon Sep 17 00:00:00 2001 From: georgegougoudis <156668518+georgegougoudis@users.noreply.github.com> Date: Sat, 30 Nov 2024 10:34:37 +0200 Subject: [PATCH 6/6] Update repository.json --- repository.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repository.json b/repository.json index 5ca85d1..0445663 100644 --- a/repository.json +++ b/repository.json @@ -1,5 +1,5 @@ { - "name": "aschamberger Hass.io add-on repository", - "url": "https://github.com/aschamberger/hassio-addons", - "maintainer": "Andreas Schamberger" + "name": "George Gougoudis Hass.io add-on repository", + "url": "https://github.com/georgegougoudis/hassio-addons", + "maintainer": "George Gougoudis" }