Skip to content

Commit a23d51f

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents cb3c90a + 68d75a1 commit a23d51f

File tree

8 files changed

+192
-100
lines changed

8 files changed

+192
-100
lines changed

History.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ Version 3.xxxx (August xx 2016)
2020
- Implemented: RFLink: Displaying firmware version in the hardware setup
2121
- Implemented: RFXCom, Blinds T12 (Confexx)
2222
- Implemented: S0 Meter TCP
23+
- Changed: Local I2C sensors grouping (ldrolez)
2324
- Changed: ETH-8020, ignoring return message as it always returns (no more Success message)
2425
- Changed: EventSystem, weather/rain value is now the rain-rate
2526
- Changed: OpenZWave, Better support for Thermostat Modes
2627
- Changed: Stable ID generation for Philips Hue scenes (you need to delete all scenes and restart the hue hardware or domoticz)
2728
- Changed: TE923, Rain counter devided by 2
29+
- Changed: Waterflow sensor, now uses Node+Child as ID (for example 0x0801)
2830
- Changed: Wind Direction graph (now does not display directions when speed was equal to zero)
2931
- Fixed: Better handling of white listed commands/urls
3032
- Fixed: Database backup is now only possible for admin users

hardware/DomoticzHardware.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ void CDomoticzHardwareBase::SendHumiditySensor(const int NodeID, const int Batte
177177
void CDomoticzHardwareBase::SendBaroSensor(const int NodeID, const int ChildID, const int BatteryLevel, const float pressure, const int forecast, const std::string &defaultname)
178178
{
179179
_tGeneralDevice gdevice;
180+
gdevice.subtype = sTypeBaro;
180181
gdevice.intval1 = (NodeID << 8) | ChildID;
181182
gdevice.intval2 = forecast;
182-
gdevice.subtype = sTypeBaro;
183183
gdevice.floatval1 = pressure;
184184
sDecodeRXMessage(this, (const unsigned char *)&gdevice, defaultname.c_str(), BatteryLevel);
185185
}
@@ -285,8 +285,8 @@ void CDomoticzHardwareBase::SendSetPointSensor(const int NodeID, const int Child
285285
void CDomoticzHardwareBase::SendDistanceSensor(const int NodeID, const int ChildID, const int BatteryLevel, const float distance, const std::string &defaultname)
286286
{
287287
_tGeneralDevice gdevice;
288-
gdevice.intval1 = (NodeID << 8) | ChildID;
289288
gdevice.subtype = sTypeDistance;
289+
gdevice.intval1 = (NodeID << 8) | ChildID;
290290
gdevice.floatval1 = distance;
291291
sDecodeRXMessage(this, (const unsigned char *)&gdevice, defaultname.c_str(), BatteryLevel);
292292
}
@@ -407,10 +407,9 @@ void CDomoticzHardwareBase::SendKwhMeterOldWay(const int NodeID, const int Child
407407

408408
void CDomoticzHardwareBase::SendKwhMeter(const int NodeID, const int ChildID, const int BatteryLevel, const double musage, const double mtotal, const std::string &defaultname)
409409
{
410-
int dID = (NodeID << 8) | ChildID;
411410
_tGeneralDevice gdevice;
412-
gdevice.intval1 = dID;
413411
gdevice.subtype = sTypeKwh;
412+
gdevice.intval1 = (NodeID << 8) | ChildID;
414413
gdevice.floatval1 = (float)musage;
415414
gdevice.floatval2 = (float)(mtotal*1000.0);
416415
sDecodeRXMessage(this, (const unsigned char *)&gdevice, defaultname.c_str(), BatteryLevel);
@@ -614,12 +613,11 @@ void CDomoticzHardwareBase::SendRGBWSwitch(const int NodeID, const int ChildID,
614613

615614
void CDomoticzHardwareBase::SendVoltageSensor(const int NodeID, const int ChildID, const int BatteryLevel, const float Volt, const std::string &defaultname)
616615
{
617-
int dID = (NodeID << 8) | ChildID;
618616
_tGeneralDevice gDevice;
619617
gDevice.subtype = sTypeVoltage;
620618
gDevice.id = ChildID;
619+
gDevice.intval1 = (NodeID << 8) | ChildID;
621620
gDevice.floatval1 = Volt;
622-
gDevice.intval1 = dID;
623621
sDecodeRXMessage(this, (const unsigned char *)&gDevice, defaultname.c_str(), BatteryLevel);
624622
}
625623

@@ -658,8 +656,8 @@ void CDomoticzHardwareBase::SendPercentageSensor(const int NodeID, const int Chi
658656
_tGeneralDevice gDevice;
659657
gDevice.subtype = sTypePercentage;
660658
gDevice.id = ChildID;
661-
gDevice.floatval1 = Percentage;
662659
gDevice.intval1 = NodeID;
660+
gDevice.floatval1 = Percentage;
663661
sDecodeRXMessage(this, (const unsigned char *)&gDevice, defaultname.c_str(), BatteryLevel);
664662
}
665663

@@ -678,8 +676,8 @@ void CDomoticzHardwareBase::SendWaterflowSensor(const int NodeID, const int Chil
678676
_tGeneralDevice gDevice;
679677
gDevice.subtype = sTypeWaterflow;
680678
gDevice.id = ChildID;
679+
gDevice.intval1 = (NodeID << 8) | ChildID;
681680
gDevice.floatval1 = LPM;
682-
gDevice.intval1 = NodeID;
683681
sDecodeRXMessage(this, (const unsigned char *)&gDevice, defaultname.c_str(), BatteryLevel);
684682
}
685683

@@ -695,8 +693,8 @@ void CDomoticzHardwareBase::SendCustomSensor(const int NodeID, const int ChildID
695693
_tGeneralDevice gDevice;
696694
gDevice.subtype = sTypeCustom;
697695
gDevice.id = ChildID;
696+
gDevice.intval1 = (NodeID << 8) | ChildID;
698697
gDevice.floatval1 = Dust;
699-
gDevice.intval1 = (NodeID<<8)|ChildID;
700698

701699
if (bDoesExists)
702700
sDecodeRXMessage(this, (const unsigned char *)&gDevice, defaultname.c_str(), BatteryLevel);
@@ -775,17 +773,17 @@ void CDomoticzHardwareBase::SendWind(const int NodeID, const int BatteryLevel, c
775773
void CDomoticzHardwareBase::SendPressureSensor(const int NodeID, const int ChildID, const int BatteryLevel, const float pressure, const std::string &defaultname)
776774
{
777775
_tGeneralDevice gdevice;
778-
gdevice.intval1 = (NodeID << 8) | ChildID;
779776
gdevice.subtype = sTypePressure;
777+
gdevice.intval1 = (NodeID << 8) | ChildID;
780778
gdevice.floatval1 = pressure;
781779
sDecodeRXMessage(this, (const unsigned char *)&gdevice, defaultname.c_str(), BatteryLevel);
782780
}
783781

784782
void CDomoticzHardwareBase::SendSolarRadiationSensor(const unsigned char NodeID, const int BatteryLevel, const float radiation, const std::string &defaultname)
785783
{
786784
_tGeneralDevice gdevice;
787-
gdevice.id = NodeID;
788785
gdevice.subtype = sTypeSolarRadiation;
786+
gdevice.id = NodeID;
789787
gdevice.floatval1 = radiation;
790788
sDecodeRXMessage(this, (const unsigned char *)&gdevice, defaultname.c_str(), BatteryLevel);
791789
}

hardware/RFXComSerial.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -811,26 +811,7 @@ bool RFXComSerial::onInternalMessage(const unsigned char *pBuffer, const size_t
811811
}
812812
if (m_rxbufferpos > m_rxbuffer[0])
813813
{
814-
/*
815-
if (!m_bReceiverStarted)
816-
{
817-
if (m_rxbuffer[1] == pTypeInterfaceMessage)
818-
{
819-
const tRBUF *pResponse = (tRBUF *)&m_rxbuffer;
820-
if (pResponse->IRESPONSE.subtype == cmdStartRec)
821-
{
822-
m_bReceiverStarted = strstr((char*)&pResponse->IRESPONSE.msg1, "Copyright RFXCOM") != NULL;
823-
}
824-
else
825-
{
826-
_log.Log(LOG_STATUS, "RFXCOM: Please upgrade your RFXTrx Firmware!...");
827-
m_bReceiverStarted = true;
828-
}
829-
}
830-
}
831-
else
832-
*/
833-
sDecodeRXMessage(this, (const unsigned char *)&m_rxbuffer, NULL, -1);
814+
sDecodeRXMessage(this, (const unsigned char *)&m_rxbuffer, NULL, -1);
834815
m_rxbufferpos = 0; //set to zero to receive next message
835816
}
836817
ii++;

hardware/RFXComTCP.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,26 +121,7 @@ bool RFXComTCP::onInternalMessage(const unsigned char *pBuffer, const size_t Len
121121
}
122122
if (m_rxbufferpos > m_rxbuffer[0])
123123
{
124-
/*
125-
if (!m_bReceiverStarted)
126-
{
127-
if (m_rxbuffer[1] == pTypeInterfaceMessage)
128-
{
129-
const tRBUF *pResponse = (tRBUF *)&m_rxbuffer;
130-
if (pResponse->IRESPONSE.subtype == cmdStartRec)
131-
{
132-
m_bReceiverStarted = strstr((char*)&pResponse->IRESPONSE.msg1, "Copyright RFXCOM") != NULL;
133-
}
134-
else
135-
{
136-
_log.Log(LOG_STATUS, "RFXCOM: Please upgrade your RFXTrx Firmware!...");
137-
m_bReceiverStarted = true;
138-
}
139-
}
140-
}
141-
else
142-
*/
143-
sDecodeRXMessage(this, (const unsigned char *)&m_rxbuffer, NULL, -1);
124+
sDecodeRXMessage(this, (const unsigned char *)&m_rxbuffer, NULL, -1);
144125
m_rxbufferpos = 0; //set to zero to receive next message
145126
}
146127
ii++;

main/RFXNames.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ const char *Hardware_Type_Desc(int hType)
161161
{ HTYPE_DavisVantage, "Davis Vantage Weather Station USB" },
162162
{ HTYPE_VOLCRAFTCO20, "Volcraft CO-20 USB air quality sensor" },
163163
{ HTYPE_1WIRE, "1-Wire (System)" },
164-
{ HTYPE_RaspberryBMP085, "I2C sensor BMP085/180 Temp+Baro" },
164+
{ HTYPE_RaspberryBMP085, "Local I2C sensor BMP085/180 Temp+Baro" },
165165
{ HTYPE_Wunderground, "Weather Underground" },
166166
{ HTYPE_ForecastIO, "Forecast IO (Weather Lookup)" },
167167
{ HTYPE_Dummy, "Dummy (Does nothing, use for virtual switches only)" },
@@ -219,7 +219,7 @@ const char *Hardware_Type_Desc(int hType)
219219
{ HTYPE_DomoticzInternal, "Domoticz Internal interface" },
220220
{ HTYPE_NefitEastLAN, "Nefit Easy HTTP server over LAN interface" },
221221
{ HTYPE_OpenWebNet, "MyHome OpenWebNet" },
222-
{ HTYPE_RaspberryHTU21D, "I2C sensor HTU21D(F)/SI702x Humidity+Temp" },
222+
{ HTYPE_RaspberryHTU21D, "Local I2C sensor HTU21D(F)/SI702x Humidity+Temp" },
223223
{ HTYPE_AtagOne, "Atag One Thermostat" },
224224
{ HTYPE_Sterbox, "Sterbox v2-3 PLC with LAN interface" },
225225
{ HTYPE_HTTPPOLLER, "HTTP/HTTPS poller" },
@@ -232,7 +232,7 @@ const char *Hardware_Type_Desc(int hType)
232232
{ HTYPE_Ec3kMeterTCP, "Energy Count 3000/ NETBSEM4/ La Crosse RT-10 LAN" },
233233
{ HTYPE_OpenWeatherMap, "Open Weather Map" },
234234
{ HTYPE_GoodweAPI, "Goodwe solar inverter via Web API" },
235-
{ HTYPE_RaspberryTSL2561, "I2C sensor TSL2561 Illuminance" },
235+
{ HTYPE_RaspberryTSL2561, "Local I2C sensor TSL2561 Illuminance" },
236236
{ 0, NULL, NULL }
237237
};
238238
return findTableIDSingle1 (Table, hType);

main/RFXtrx.h

Lines changed: 93 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ portions of this file.
2727
*/
2828

2929
/*
30+
SDK version 9.09
31+
SEAV remote added
32+
33+
SDK version 9.08
34+
CARTELECTRONIC TIC and Encoder added
35+
Lighting5 - Livolo dim/scene added
36+
3037
SDK version 9.07
3138
Lighting5 IT added
3239
BlindsT12 Confexx added
@@ -515,15 +522,16 @@ SDK version 4.9
515522
#define light5_sModeMin 0xA
516523
#define light5_sLivoloAllOff 0x00
517524
#define light5_sLivoloGang1Toggle 0x01
518-
#define light5_sLivoloGang2Toggle 0x02 //dim+ for dimmer
519-
#define light5_sLivoloGang3Toggle 0x03 //dim- for dimmer
520-
#define light5_sLivoloGang4Toggle 0x04
521-
#define light5_sLivoloGang5Toggle 0x05
522-
#define light5_sLivoloGang6Toggle 0x06
523-
#define light5_sLivoloGang7Toggle 0x07
524-
#define light5_sLivoloGang8Toggle 0x08
525-
#define light5_sLivoloGang9Toggle 0x09
526-
#define light5_sLivoloGang10Toggle 0x0A
525+
#define light5_sLivoloGang2Toggle 0x02
526+
#define light5_sLivoloDimR1plus 0x02
527+
#define light5_sLivoloGang3Toggle 0x03
528+
#define light5_sLivoloDimR1min 0x03
529+
#define light5_sLivoloScene1R1 0x04
530+
#define light5_sLivoloScene2R1 0x05
531+
#define light5_sLivoloDimR2plus 0x06
532+
#define light5_sLivoloDimR2min 0x07
533+
#define light5_sLivoloScene1R2 0x08
534+
#define light5_sLivoloScene2R2 0x09
527535
#define light5_sRGBoff 0x00
528536
#define light5_sRGBon 0x01
529537
#define light5_sRGBbright 0x02
@@ -567,6 +575,7 @@ SDK version 4.9
567575
#define sTypeSiemensSF01 0x0
568576
#define sTypeItho 0x1
569577
#define sTypeLucciAir 0x2
578+
#define sTypeSeavTXS4 0x3
570579
#define fan_sTimer 0x1
571580
#define fan_sMin 0x2
572581
#define fan_sLearn 0x3
@@ -585,6 +594,10 @@ SDK version 4.9
585594
#define fan_LucciLow 0x3
586595
#define fan_LucciOff 0x4
587596
#define fan_LucciLight 0x5
597+
#define fan_T1 0x1
598+
#define fan_T2 0x2
599+
#define fan_T3 0x3
600+
#define fan_T4 0x4
588601

589602
//types for Curtain
590603
#define pTypeCurtain 0x18
@@ -621,14 +634,14 @@ SDK version 4.9
621634
#define blinds_sLeft 0x8
622635
#define blinds_sRight 0x9
623636
#define blinds_s9ChangeDirection 0x6
624-
#define blinds_s9ImA = 0x7
625-
#define blinds_s9ImCenter = 0x8
626-
#define blinds_s9ImB = 0x9
627-
#define blinds_s9EraseCurrentCh = 0xA
628-
#define blinds_s9EraseAllCh = 0xB
629-
#define blinds_s10LearnMaster = 0x4
630-
#define blinds_s10EraseCurrentCh = 0x5
631-
#define blinds_s10ChangeDirection = 0x6
637+
#define blinds_s9ImA 0x7
638+
#define blinds_s9ImCenter 0x8
639+
#define blinds_s9ImB 0x9
640+
#define blinds_s9EraseCurrentCh 0xA
641+
#define blinds_s9EraseAllCh 0xB
642+
#define blinds_s10LearnMaster 0x4
643+
#define blinds_s10EraseCurrentCh 0x5
644+
#define blinds_s10ChangeDirection 0x6
632645

633646
//types for RFY
634647
#define pTypeRFY 0x1A
@@ -901,6 +914,11 @@ SDK version 4.9
901914
//types for water
902915
#define pTypeWATER 0x5F
903916

917+
//types for CARTELECTRONIC
918+
#define pTypeCARTELECTRONIC 0x60
919+
#define sTypeTIC 0x1
920+
#define sTypeCEencoder 0x2
921+
904922
//RFXSensor
905923
#define pTypeRFXSensor 0x70
906924
#define sTypeRFXSensorTemp 0x0
@@ -1904,6 +1922,64 @@ typedef union tRBUF {
19041922
#endif
19051923
} WEIGHT;
19061924

1925+
struct {
1926+
BYTE packetlength;
1927+
BYTE packettype;
1928+
BYTE subtype;
1929+
BYTE seqnbr;
1930+
BYTE id1;
1931+
BYTE id2;
1932+
BYTE id3;
1933+
BYTE id4;
1934+
BYTE id5;
1935+
BYTE contract_type;
1936+
BYTE counter1_0;
1937+
BYTE counter1_1;
1938+
BYTE counter1_2;
1939+
BYTE counter1_3;
1940+
BYTE counter2_0;
1941+
BYTE counter2_1;
1942+
BYTE counter2_2;
1943+
BYTE counter2_3;
1944+
BYTE power_H;
1945+
BYTE power_L;
1946+
BYTE state;
1947+
#ifdef IS_BIG_ENDIAN
1948+
BYTE rssi : 4;
1949+
BYTE battery_level : 4;
1950+
#else
1951+
BYTE battery_level : 4;
1952+
BYTE rssi : 4;
1953+
#endif
1954+
} TIC;
1955+
1956+
struct {
1957+
BYTE packetlength;
1958+
BYTE packettype;
1959+
BYTE subtype;
1960+
BYTE seqnbr;
1961+
BYTE id1;
1962+
BYTE id2;
1963+
BYTE id3;
1964+
BYTE id4;
1965+
BYTE counter1_0;
1966+
BYTE counter1_1;
1967+
BYTE counter1_2;
1968+
BYTE counter1_3;
1969+
BYTE counter2_0;
1970+
BYTE counter2_1;
1971+
BYTE counter2_2;
1972+
BYTE counter2_3;
1973+
BYTE state;
1974+
#ifdef IS_BIG_ENDIAN
1975+
BYTE rssi : 4;
1976+
BYTE battery_level : 4;
1977+
#else
1978+
BYTE battery_level : 4;
1979+
BYTE rssi : 4;
1980+
#endif
1981+
} CEENCODER;
1982+
19071983
struct {
19081984
BYTE packetlength;
19091985
BYTE packettype;

0 commit comments

Comments
 (0)