Skip to content

Commit f86f45c

Browse files
committed
S0 meter, option to configure meter 1,2 and 3
Updated openzwave config files
1 parent 395f0c9 commit f86f45c

34 files changed

+173
-331
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ IF(RaspberryPi)
374374
find_path(WiringPi wiringPi.h)
375375
IF(WiringPi)
376376
message(STATUS "WiringPi include was found in ${WiringPi}...")
377-
find_library(WIRINGPI_LIBRARY wiringPi)
377+
find_library(WIRINGPI_LIBRARY NAMES libwiringPi.a)
378378
IF(WIRINGPI_LIBRARY)
379379
message(STATUS "WiringPi library was found in ${WIRINGPI_LIBRARY}...")
380380
add_definitions(-DWITH_GPIO)

Config/fibaro/fgd211.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<Item label="Enable" value="1"/>
7676
</Value>
7777
<Value type="byte" genre="config" instance="1" index="20" label="ADVANCED Impulse length" min="100" max="170" value="110">
78-
<Help>This function will enable decreasing the minimum level of the Dimmer by extending the control impulse.[100 - 170]. By changing the minimem level, the user may completely dim LED bulbs. Not all LED bulbs available on the market have the dimmming option. WARNING: Wrong setting of the function may cause incorrect operation of the Dimmer. INFO: THIS PARAMETER IS NOT AVAILABLE IN DEVICE FGD211 v2.1-2.3</Help>
78+
<Help>This function will enable decreasing the minimum level of the Dimmer by extending the control impulse.[100 - 170]. By changing the minimum level, the user may completely dim LED bulbs. Not all LED bulbs available on the market have the dimmming option. WARNING: Wrong setting of the function may cause incorrect operation of the Dimmer. INFO: THIS PARAMETER IS NOT AVAILABLE IN DEVICE FGD211 v2.1-2.3</Help>
7979
</Value>
8080
<Value type="list" genre="config" instance="1" index="30" label="Alarm" size="1" value="3">
8181
<Help>Alarm of any type (general alarm, water flooding alarm, smoke alarm: CO, CO2, temperature alarm).

Config/manufacturer_specific.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@
442442
</Manufacturer>
443443
<Manufacturer id="0096" name="NorthQ">
444444
<Product type="0001" id="0001" name="NQ-92021 Power Reader" config="northq/nq92021.xml"/>
445+
<Product type="0001" id="0002" name="NQ-9021 Power Reader"/>
445446
<Product type="0010" id="0001" name="NQ-9121 Gas Reader" config="northq/nq9121.xml"/>
446447
</Manufacturer>
447448
<Manufacturer id="0040" name="Novar EDS">

Config/popp/123580.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<Help>Maximal level should be greater than minimal. 0=Work as switch: use off and maximal level 10-99 Level limit (Default 99)</Help>
6969
</Value>
7070

71-
<Value type="short" genre="config" instance="1" index="18" label="Dim Level on 'Switch On'" size="1" min="0" max="99" value="0">
71+
<Value type="short" genre="config" instance="1" index="19" label="Dim Level on 'Switch On'" size="1" min="0" max="99" value="0">
7272
<Help>Defines how the dimmer hall react on a simple ON Command. 0-99 0=Use previous light level (Default), 1 . 99 Define light level in %</Help>
7373
</Value>
7474

History.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ Version 2.0.xxxx (January xxth 2015)
9393
- Implemented: Support for MySensors
9494
- Implemented: Raspberry Pi 2 Internal CPU Temperature
9595
- Fixed: I2C, possible crash when no device connected
96+
- Implemented: Option for Dummy device to create Usage (Electric) Sensor
97+
- Implemented: S0 Meter, settings for meter 3,4 and 5
9698

9799
Version 2.0.2025 (September 28th 2014)
98100
- Implemented: Fibaro Link data pusher

hardware/DomoticzHardware.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class CDomoticzHardwareBase
5252
friend class CBMP085;
5353
friend class CPiFace;
5454
friend class S0MeterSerial;
55-
friend class S0MeterTCP;
5655
friend class OTGWSerial;
5756
friend class OTGWTCP;
5857
friend class Teleinfo;

hardware/S0MeterBase.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class S0MeterBase : public CDomoticzHardwareBase
1111
double m_volume_total;
1212
};
1313
friend class S0MeterSerial;
14-
friend class S0MeterTCP;
1514
public:
1615
S0MeterBase(void);
1716
~S0MeterBase(void);

hardware/S0MeterSerial.cpp

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,38 @@
2525
};
2626
#endif
2727

28-
S0MeterSerial::S0MeterSerial(const int ID, const std::string& devname, const unsigned int baud_rate, const int M1Type, const int M1PPH, const int M2Type, const int M2PPH)
28+
S0MeterSerial::S0MeterSerial(const int ID, const std::string& devname, const unsigned int baud_rate, const std::string& Settings)
2929
{
3030
m_HwdID=ID;
3131
m_szSerialPort=devname;
3232
m_iBaudRate=baud_rate;
3333

34-
//Quick hack, meters 3 till 5 uses same parameter as 1 for now, till we can configure it
35-
m_meters[0].m_type=M1Type;
36-
m_meters[1].m_type=M2Type;
37-
m_meters[2].m_type=M1Type;
38-
m_meters[3].m_type=M1Type;
39-
m_meters[4].m_type=M1Type;
34+
m_meters[0].m_type=0;
35+
m_meters[1].m_type=0;
36+
m_meters[2].m_type=0;
37+
m_meters[3].m_type=0;
38+
m_meters[4].m_type=0;
4039
m_meters[0].m_pulse_per_unit=1000.0;
4140
m_meters[1].m_pulse_per_unit=1000.0;
4241
m_meters[2].m_pulse_per_unit=1000.0;
4342
m_meters[3].m_pulse_per_unit=1000.0;
4443
m_meters[4].m_pulse_per_unit=1000.0;
4544

46-
if (M1PPH!=0)
45+
std::vector<std::string> splitresults;
46+
StringSplit(Settings, ";", splitresults);
47+
if (splitresults.size() == 10)
4748
{
48-
m_meters[0].m_pulse_per_unit=float(M1PPH);
49-
m_meters[1].m_pulse_per_unit=float(M1PPH);
50-
m_meters[2].m_pulse_per_unit=float(M1PPH);
51-
m_meters[3].m_pulse_per_unit=float(M1PPH);
52-
m_meters[4].m_pulse_per_unit=float(M1PPH);
49+
m_meters[0].m_type = atoi(splitresults[0].c_str());
50+
m_meters[0].m_pulse_per_unit = atof(splitresults[1].c_str());
51+
m_meters[1].m_type = atoi(splitresults[2].c_str());
52+
m_meters[1].m_pulse_per_unit = atof(splitresults[3].c_str());
53+
m_meters[2].m_type = atoi(splitresults[4].c_str());
54+
m_meters[2].m_pulse_per_unit = atof(splitresults[5].c_str());
55+
m_meters[3].m_type = atoi(splitresults[6].c_str());
56+
m_meters[3].m_pulse_per_unit = atof(splitresults[7].c_str());
57+
m_meters[4].m_type = atoi(splitresults[8].c_str());
58+
m_meters[4].m_pulse_per_unit = atof(splitresults[9].c_str());
5359
}
54-
if (M2PPH!=0)
55-
m_meters[1].m_pulse_per_unit=float(M2PPH);
5660
}
5761

5862
S0MeterSerial::~S0MeterSerial()

hardware/S0MeterSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class S0MeterSerial: public AsyncSerial, public S0MeterBase
77
{
88
public:
9-
S0MeterSerial(const int ID, const std::string& devname, const unsigned int baud_rate, const int M1Type, const int M1PPH, const int M2Type, const int M2PPH);
9+
S0MeterSerial(const int ID, const std::string& devname, const unsigned int baud_rate, const std::string& Settings);
1010
~S0MeterSerial();
1111

1212
void WriteToHardware(const char *pdata, const unsigned char length);

hardware/S0MeterTCP.cpp

Lines changed: 0 additions & 222 deletions
This file was deleted.

0 commit comments

Comments
 (0)