Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v1.4-rc1'
Browse files Browse the repository at this point in the history
* origin/v1.4-rc1: (474 commits)
  Blockly: Disabled tests (they are deprecated)
  Blockly: Disabled tests (they are deprecated)
  Blockly: Fix for changes made to Backend plugin
  Backend: Bugfix
  Backend: updated more icons to fontawesome
  Backend: updated spinner to fontawesome 5
  Backend: moved fill_logicdict call after enable / disable to be aware of these properties
  Backend: fixed item refresh after font awesome migration
  Backend: one more icon fixed
  Backend: fixed icons in item view
  Backend: migrated font awesome to 5.0.1 Free
  # init.py - remove 6 x return None. Was forgotten to remove
  # eep_parser.py - only send logger.info for Eltako FAH60 when Brigthness > 0 - add header for RORG = D2 - small improvements of comments
  - add empty line between two methods.
  - Add Example for Eltako FAH60
  - optimize logger format - introduce headings for differrent RORGs - optimize comments - add parser for Eltako brigthness sensor - correction of logger (logger --> self.logger)
  - add device # also in the info log text
  - improve error message
  - add exlamation mark in error message!
  - add device into error message
  ...

# Conflicts:
#	hue/__init__.py
  • Loading branch information
msinn committed Dec 17, 2017
2 parents 26da3f4 + 5d8ae25 commit a9c235a
Show file tree
Hide file tree
Showing 4,543 changed files with 468,794 additions and 4,161 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 25 additions & 0 deletions alexa/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Metadata for the Smart-Plugin
plugin:
# Global plugin attributes
type: web # plugin type (gateway, interface, protocol, system, web)
description:
de: 'Plugin zur Ansteuerung von SmartHomeNG via Amazon Echo / Alexa, **seit SmartHomeNG v1.3**'
en: ''
maintainer: hotzen
tester: psilo909
# keywords: iot xyz
# documentation: https://github.com/smarthomeNG/smarthome/wiki/CLI-Plugin # url of documentation (wiki) page
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1021150-amazon-alexa-plugin

version: 1.3.0.9.0 # Plugin version
sh_minversion: 1.3 # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
multi_instance: False # plugin supports multi instance
classname: Alexa # class containing the plugin

parameters:
# Definition of parameters to be configured in etc/plugin.yaml

item_attributes:
# Definition of item attributes defined by this plugin

240 changes: 231 additions & 9 deletions apcups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

## Requirements

A running apcupsd with configured netserver (NIS). The plugin retrieves the information via network from the netserver. No local apcupsd is required.
The apcupsd package must be installed also on the local system (running daemon is not required). The plugin uses the "apcaccess" helper tool from the package.
A running **apcupsd** with configured netserver (NIS). The plugin retrieves the information via network from the netserver. No local apcupsd is required.
The apcupsd package must be installed also on the local system (running daemon is not required). The plugin uses the **apcaccess** helper tool from the package.

If running the daemon locally and using the netserver, then the ``/etc/apcupsd/apcupsd.conf`` should contain additionally the following entries:

```
NETSERVER on
NISPORT 3551
NISIP 127.0.0.1
```

## Supported Hardware

Expand All @@ -13,7 +21,7 @@ Should work on all APC UPS devices. Tested only on a "smartUPS".

### plugin.conf

Please provide a plugin.yaml snippet for your plugin with ever option your plugin supports. Optional attributes should be commented out.
Add the following lines to activate the plugin:

```yaml
ApcUps:
Expand All @@ -23,9 +31,9 @@ ApcUps:
port: 3551
```
If you use the old plugin.conf config file format add the following lines to activate the plugin:
or the same for deprecated *.conf file format:
```
```ini
[apcups]
class_name = APCUPS
class_path = plugins.apcups
Expand All @@ -42,13 +50,97 @@ Description of the attributes:

### items.conf

There is only one attribute: apcups
There is only one attribute: **apcups**

For a list of values for this attribute call "apcaccess" on the command line. This command will give back a text block containing a list of ``statusname : value`` entries like the following:

For a list of values for this attribute call "apcaccess" on the command line. The plugin returns strings (status "online") or floats (235 = 235 Volt).
```
APC : 001,050,1127
DATE : 2017-11-02 07:59:15 +0100
HOSTNAME : sh11
VERSION : 3.14.12 (29 March 2014) debian
UPSNAME : UPS_IDEN
CABLE : Ethernet Link
DRIVER : PCNET UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2017-11-02 07:59:11 +0100
MODEL : Smart-UPS 1400 RM
STATUS : ONLINE
LINEV : 227.5 Volts
LOADPCT : 31.2 Percent
BCHARGE : 100.0 Percent
TIMELEFT : 30.0 Minutes
MBATTCHG : 10 Percent
MINTIMEL : 5 Minutes
MAXTIME : 0 Seconds
MAXLINEV : 227.5 Volts
MINLINEV : 226.0 Volts
OUTPUTV : 227.5 Volts
SENSE : High
DWAKE : 0 Seconds
DSHUTD : 120 Seconds
DLOWBATT : 2 Minutes
LOTRANS : 208.0 Volts
HITRANS : 253.0 Volts
RETPCT : 0.0 Percent
ITEMP : 25.6 C
ALARMDEL : Low Battery
BATTV : 27.7 Volts
LINEFREQ : 49.8 Hz
LASTXFER : Line voltage notch or spike
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STESTI : 336
STATFLAG : 0x05000008
REG1 : 0x00
REG2 : 0x00
REG3 : 0x00
MANDATE : 08/16/00
SERIALNO : GS0034003173
BATTDATE : 06/20/15
NOMOUTV : 230 Volts
NOMBATTV : 24.0 Volts
EXTBATTS : 0
FIRMWARE : 162.3.I
END APC : 2017-11-02 08:00:39 +0100
```

The plugin will check the items type. If the type is a string, then the value will we returned as a string (e.g. status "ONLINE").
If it is of type num, then the item will be set to a float. To convert to a float, the returned string will be cut after first space and the converted (e.g. 235 Volt = 235).

### Example

The example below will read the keys **LINEV**, **STATUS** and **TIMELEFT** and returns their values.

```yaml
# items/apcups.yaml
serverroom:

apcups:

linev:
visu_acl: ro
type: num
apcups: linev

status:
# will be 'ONLINE', 'ONBATT', or in case of a problem simply empty
visu_acl: ro
type: str
apcups: status

timeleft:
visu_acl: ro
type: num
apcups: timeleft
```
or in (deprecated) *.conf format:
```ini
# items/apcups.conf
[serverroom]
[[apcups]]
Expand All @@ -58,14 +150,144 @@ For a list of values for this attribute call "apcaccess" on the command line. Th
apcups = linev

[[[status]]]
# will be 'ONLINE', 'ONBATT', or in case of a problem simply empty
visu_acl = ro
type = str
type = str
apcups = status

[[[timeleft]]]
visu_acl = ro
type = num
apcups = timeleft
```
"type" depends on the values.
**type** depends on the values.

### Status Report Fields

Due to a look into this http://apcupsd.org/manual/manual.html#configuration-examples file the meaning of the above variables are as follows

```
APC
Header record indicating the STATUS format revision level, the number of records that follow the APC statement, and the number of bytes that follow the record.
DATE
The date and time that the information was last obtained from the UPS.
HOSTNAME
The name of the machine that collected the UPS data.
UPSNAME
The name of the UPS as stored in the EEPROM or in the UPSNAME directive in the configuration file.
VERSION
The apcupsd release number, build date, and platform.
CABLE
The cable as specified in the configuration file (UPSCABLE).
MODEL
The UPS model as derived from information from the UPS.
UPSMODE
The mode in which apcupsd is operating as specified in the configuration file (UPSMODE)
STARTTIME
The time/date that apcupsd was started.
STATUS
The current status of the UPS (ONLINE, ONBATT, etc.)
LINEV
The current line voltage as returned by the UPS.
LOADPCT
The percentage of load capacity as estimated by the UPS.
BCHARGE
The percentage charge on the batteries.
TIMELEFT
The remaining runtime left on batteries as estimated by the UPS.
MBATTCHG
If the battery charge percentage (BCHARGE) drops below this value, apcupsd will shutdown your system. Value is set in the configuration file (BATTERYLEVEL)
MINTIMEL
apcupsd will shutdown your system if the remaining runtime equals or is below this point. Value is set in the configuration file (MINUTES)
MAXTIME
apcupsd will shutdown your system if the time on batteries exceeds this value. A value of zero disables the feature. Value is set in the configuration file (TIMEOUT)
MAXLINEV
The maximum line voltage since the UPS was started, as reported by the UPS
MINLINEV
The minimum line voltage since the UPS was started, as returned by the UPS
OUTPUTV
The voltage the UPS is supplying to your equipment
SENSE
The sensitivity level of the UPS to line voltage fluctuations.
DWAKE
The amount of time the UPS will wait before restoring power to your equipment after a power off condition when the power is restored.
DSHUTD
The grace delay that the UPS gives after receiving a power down command from apcupsd before it powers off your equipment.
DLOWBATT
The remaining runtime below which the UPS sends the low battery signal. At this point apcupsd will force an immediate emergency shutdown.
LOTRANS
The line voltage below which the UPS will switch to batteries.
HITRANS
The line voltage above which the UPS will switch to batteries.
RETPCT
The percentage charge that the batteries must have after a power off condition before the UPS will restore power to your equipment.
ITEMP
Internal UPS temperature as supplied by the UPS.
ALARMDEL
The delay period for the UPS alarm.
BATTV
Battery voltage as supplied by the UPS.
LINEFREQ
Line frequency in hertz as given by the UPS.
LASTXFER
The reason for the last transfer to batteries.
NUMXFERS
The number of transfers to batteries since apcupsd startup.
XONBATT
Time and date of last transfer to batteries, or N/A.
TONBATT
Time in seconds currently on batteries, or 0.
CUMONBATT
Total (cumulative) time on batteries in seconds since apcupsd startup.
XOFFBATT
Time and date of last transfer from batteries, or N/A.
SELFTEST
The results of the last self test, and may have the following values:
OK: self test indicates good battery
BT: self test failed due to insufficient battery capacity
NG: self test failed due to overload
NO: No results (i.e. no self test performed in the last 5 minutes)
STESTI
The interval in hours between automatic self tests.
STATFLAG
Status flag. English version is given by STATUS.
DIPSW
The current dip switch settings on UPSes that have them.
REG1
The value from the UPS fault register 1.
REG2
The value from the UPS fault register 2.
REG3
The value from the UPS fault register 3.
MANDATE
The date the UPS was manufactured.
SERIALNO
The UPS serial number.
BATTDATE
The date that batteries were last replaced.
NOMOUTV
The output voltage that the UPS will attempt to supply when on battery power.
NOMINV
The input voltage that the UPS is configured to expect.
NOMBATTV
The nominal battery voltage.
NOMPOWER
The maximum power in Watts that the UPS is designed to supply.
HUMIDITY
The humidity as measured by the UPS.
AMBTEMP
The ambient temperature as measured by the UPS.
EXTBATTS
The number of external batteries as defined by the user. A correct number here helps the UPS compute the remaining runtime more accurately.
BADBATTS
The number of bad battery packs.
FIRMWARE
The firmware revision number as reported by the UPS.
APCMODEL
The old APC model identification code.
END APC
The time and date that the STATUS record was written.
```
7 changes: 5 additions & 2 deletions apcups/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def stop(self):

def parse_item(self, item):
if self.has_iattr(item.conf, ITEM_TAG[0]):
apcups_key = (self.get_iattr_value(ITEM_TAG[0])).lower()
apcups_key = (self.get_iattr_value(item.conf, ITEM_TAG[0])).lower()
self._items[apcups_key]=item
logger.debug("item {0} added with apcupd_key {1}".format(item,apcups_key))
return self.update_item
Expand All @@ -58,7 +58,10 @@ def update_item(self, item, caller=None, source=None, dest=None):
logger.debug("update item: {0}".format(item.id()))

def update_status(self):
# go and grab
"""
Start **apcaccess** on a shell, capture the output and parse it.
The items attribut parameter will be matched against the shell output
"""
command = '/sbin/apcaccess status {0}:{1}'.format(self._host, self._port) # the command goes here
output = subprocess.check_output(command.split(), shell=False)
# decode byte string to string
Expand Down
25 changes: 25 additions & 0 deletions apcups/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Metadata for the Smart-Plugin
plugin:
# Global plugin attributes
type: interface # plugin type (gateway, interface, protocol, system, web)
description:
de: 'Unterstützung für smartUPS Geräte der Firma APC'
en: ''
maintainer: cmalo
tester: Sandman60
# keywords: iot xyz
# documentation: https://github.com/smarthomeNG/smarthome/wiki/CLI-Plugin # url of documentation (wiki) page
# support: https://knx-user-forum.de/forum/supportforen/smarthome-py

version: 1.3.1 # Plugin version
sh_minversion: 1.3 # minimum shNG version to use this plugin
# sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
multi_instance: True # plugin supports multi instance
classname: APCUPS # class containing the plugin

parameters:
# Definition of parameters to be configured in etc/plugin.yaml

item_attributes:
# Definition of item attributes defined by this plugin

13 changes: 12 additions & 1 deletion artnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OLA supports most USB -> DMX Adapters available at the moment.

## Configuration

### plugin.conf
### plugin.conf (deprecated) / .yaml

```
[dmx1]
Expand All @@ -25,6 +25,17 @@ OLA supports most USB -> DMX Adapters available at the moment.
port = 6454
```

```
dmx1:
class_name: ArtNet
class_path: plugins.artnet
artnet_subnet: 0
artnet_net: 0
artnet_universe: 0
ip: 192.168.1.123
port: 6454
```

### items.conf

Not needed yet.
Expand Down
Loading

0 comments on commit a9c235a

Please sign in to comment.