From 79f5abf668b6da5ce60a4cc6c66bdbd093b11e42 Mon Sep 17 00:00:00 2001 From: Martin Sebald Date: Wed, 15 Nov 2017 09:48:16 +0100 Subject: [PATCH] minor changes --- apcups/README.md | 4 ++-- apcups/USV_dump_log | 2 +- apcups/ups.items | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apcups/README.md b/apcups/README.md index 7186541..29c75ba 100644 --- a/apcups/README.md +++ b/apcups/README.md @@ -12,11 +12,11 @@ Then create a thing in Paper UI. Use the Exec binding and enter the following pa * **Transform:** REGEX((.*)) * **Interval:** 60 -The port for accessing the UPS device through apcupsd is a parameter as I check three UPS devices and only want to use one script. This is also the reason why I configured the remote UPS devices (all my UPS devices just have a USB cable, no network interfaces) in the local apcupsd. The data is received from the remote apcupsd installations. +The port (*3551* is the apcupsd standard port) for accessing the UPS device through apcupsd is a parameter as I check three UPS devices and only want to use one script. This is also the reason why I configured the remote UPS devices (all my UPS devices just have a USB cable, no network interfaces) in the local apcupsd. The data is received from the remote apcupsd installations. You can also modify the IP in the script to access a remote apcupsd installation. The new thing *USV_dump_log* gets an id like _exec:command:**a1b2c3d4**_ which you then need to enter in the item created through the *ups.items* file. * **ups.items**: Put this file into your */etc/openhab2/items* directory and modify it for your specific setup. Maybe everything suits your needs, but you need to modify the string item *USV_Log* and match the command id in the channel command to the thing you created earlier in Paper UI. * **ups.map**: Put this file into your */etc/openhab2/transform* directory. -* **ups.rules**: Put this file into your */etc/openhab2/rules* directory. You may want to modify it for your specific setup. +* **ups.rules**: Put this file into your */etc/openhab2/rules* directory. You may want to modify it for your specific setup. You find two excamples for actions if AC power fails. In this case a XMPP message and a message through Telegram is sent. * **ups.map**: Put the bash script into */home/openhabian/scripts* (or somewhere else you like) and *chmod 755* it to make it executable. \ No newline at end of file diff --git a/apcups/USV_dump_log b/apcups/USV_dump_log index 12502d2..e609edb 100644 --- a/apcups/USV_dump_log +++ b/apcups/USV_dump_log @@ -1,3 +1,3 @@ #!/bin/bash -export UPS_LOG="$(/sbin/apcaccess status 172.27.0.31:$1)" +export UPS_LOG="$(/sbin/apcaccess status 127.0.0.1:$1)" echo $UPS_LOG diff --git a/apcups/ups.items b/apcups/ups.items index d164c4b..f2193e5 100644 --- a/apcups/ups.items +++ b/apcups/ups.items @@ -1,10 +1,10 @@ String USV_Log "kompletter Inhalt des Logs [%s]" { channel="exec:command:a1b2c3d4:output" } -String USV_Status "USV Status [MAP(ups.map):%s]" -Number USV_Load "USV Load [%.1f %%]" +String USV_Status "USV Status [MAP(ups.map):%s]" +Number USV_Load "USV Load [%.1f %%]" Number USV_BattCharge "USV Battery Charge [%.1f %%]" Number USV_TimeLeft "USV Time Left [%.1f Minuten]" Number USV_BattVoltage "USV Battery Volts [%.1f V]" -Number USV_LineV "USV Input Volts [%.1f V]" +Number USV_LineV "USV Input Volts [%.1f V]" Number USV_OutputV "USV Output Volts [%.1f V]" -Number USV_ITemp "USV Temperatur [%.1f °C]" +Number USV_ITemp "USV Temperatur [%.1f °C]" String USV_BattDate "USV Battery Date [%s]"