@@ -8,6 +8,7 @@ const extend = require('../lib/extend');
8
8
const e = exposes . presets ;
9
9
const ea = exposes . access ;
10
10
11
+ const manuSinope = { manufacturerCode : 0x119C } ;
11
12
const fzLocal = {
12
13
sinope_thermostat : {
13
14
cluster : 'hvacThermostat' ,
@@ -123,35 +124,35 @@ const tzLocal = {
123
124
convertSet : async ( entity , key , value , meta ) => {
124
125
const sinopeOccupancy = { 0 : 'unoccupied' , 1 : 'occupied' } ;
125
126
const SinopeOccupancy = utils . getKey ( sinopeOccupancy , value , value , Number ) ;
126
- await entity . write ( 'hvacThermostat' , { SinopeOccupancy} , { manufacturerCode : 0x119C } ) ;
127
+ await entity . write ( 'hvacThermostat' , { SinopeOccupancy} , manuSinope ) ;
127
128
return { state : { 'thermostat_occupancy' : value } } ;
128
129
} ,
129
130
convertGet : async ( entity , key , meta ) => {
130
- await entity . read ( 'hvacThermostat' , [ 'SinopeOccupancy' ] , { manufacturerCode : 0x119C } ) ;
131
+ await entity . read ( 'hvacThermostat' , [ 'SinopeOccupancy' ] , manuSinope ) ;
131
132
} ,
132
133
} ,
133
134
sinope_thermostat_backlight_autodim_param : {
134
135
key : [ 'backlight_auto_dim' ] ,
135
136
convertSet : async ( entity , key , value , meta ) => {
136
137
const sinopeBacklightParam = { 0 : 'on_demand' , 1 : 'sensing' } ;
137
138
const SinopeBacklight = utils . getKey ( sinopeBacklightParam , value , value , Number ) ;
138
- await entity . write ( 'hvacThermostat' , { SinopeBacklight} , { manufacturerCode : 0x119C } ) ;
139
+ await entity . write ( 'hvacThermostat' , { SinopeBacklight} , manuSinope ) ;
139
140
return { state : { 'backlight_auto_dim' : value } } ;
140
141
} ,
141
142
convertGet : async ( entity , key , meta ) => {
142
- await entity . read ( 'hvacThermostat' , [ 'SinopeBacklight' ] , { manufacturerCode : 0x119C } ) ;
143
+ await entity . read ( 'hvacThermostat' , [ 'SinopeBacklight' ] , manuSinope ) ;
143
144
} ,
144
145
} ,
145
146
sinope_thermostat_main_cycle_output : {
146
147
// TH1400ZB specific
147
148
key : [ 'main_cycle_output' ] ,
148
149
convertSet : async ( entity , key , value , meta ) => {
149
150
const lookup = { '15_sec' : 15 , '5_min' : 300 , '10_min' : 600 , '15_min' : 900 , '20_min' : 1200 , '30_min' : 1800 } ;
150
- await entity . write ( 'hvacThermostat' , { SinopeMainCycleOutput : lookup [ value ] } , { manufacturerCode : 0x119C } ) ;
151
+ await entity . write ( 'hvacThermostat' , { SinopeMainCycleOutput : lookup [ value ] } , manuSinope ) ;
151
152
return { state : { 'main_cycle_output' : value } } ;
152
153
} ,
153
154
convertGet : async ( entity , key , meta ) => {
154
- await entity . read ( 'hvacThermostat' , [ 'SinopeMainCycleOutput' ] , { manufacturerCode : 0x119C } ) ;
155
+ await entity . read ( 'hvacThermostat' , [ 'SinopeMainCycleOutput' ] , manuSinope ) ;
155
156
} ,
156
157
} ,
157
158
sinope_thermostat_aux_cycle_output : {
@@ -170,22 +171,22 @@ const tzLocal = {
170
171
key : [ 'enable_outdoor_temperature' ] ,
171
172
convertSet : async ( entity , key , value , meta ) => {
172
173
if ( value . toLowerCase ( ) == 'on' ) {
173
- await entity . write ( 'manuSpecificSinope' , { outdoorTempToDisplayTimeout : 10800 } ) ;
174
+ await entity . write ( 'manuSpecificSinope' , { outdoorTempToDisplayTimeout : 10800 } , manuSinope ) ;
174
175
} else if ( value . toLowerCase ( ) == 'off' ) {
175
176
// set timer to 12 sec in order to disable outdoor temperature
176
- await entity . write ( 'manuSpecificSinope' , { outdoorTempToDisplayTimeout : 12 } ) ;
177
+ await entity . write ( 'manuSpecificSinope' , { outdoorTempToDisplayTimeout : 12 } , manuSinope ) ;
177
178
}
178
179
return { readAfterWriteTime : 250 , state : { enable_outdoor_temperature : value } } ;
179
180
} ,
180
181
convertGet : async ( entity , key , meta ) => {
181
- await entity . read ( 'manuSpecificSinope' , [ 'outdoorTempToDisplayTimeout' ] ) ;
182
+ await entity . read ( 'manuSpecificSinope' , [ 'outdoorTempToDisplayTimeout' ] , manuSinope ) ;
182
183
} ,
183
184
} ,
184
185
sinope_thermostat_outdoor_temperature : {
185
186
key : [ 'thermostat_outdoor_temperature' ] ,
186
187
convertSet : async ( entity , key , value , meta ) => {
187
188
if ( value > - 100 && value < 100 ) {
188
- await entity . write ( 'manuSpecificSinope' , { outdoorTempToDisplay : value * 100 } ) ;
189
+ await entity . write ( 'manuSpecificSinope' , { outdoorTempToDisplay : value * 100 } , manuSinope ) ;
189
190
}
190
191
} ,
191
192
} ,
@@ -197,9 +198,9 @@ const tzLocal = {
197
198
const thermostatTimeSec = thermostatDate . getTime ( ) / 1000 ;
198
199
const thermostatTimezoneOffsetSec = thermostatDate . getTimezoneOffset ( ) * 60 ;
199
200
const currentTimeToDisplay = Math . round ( thermostatTimeSec - thermostatTimezoneOffsetSec - 946684800 ) ;
200
- await entity . write ( 'manuSpecificSinope' , { currentTimeToDisplay} ) ;
201
+ await entity . write ( 'manuSpecificSinope' , { currentTimeToDisplay} , manuSinope ) ;
201
202
} else if ( value !== '' ) {
202
- await entity . write ( 'manuSpecificSinope' , { currentTimeToDisplay : value } ) ;
203
+ await entity . write ( 'manuSpecificSinope' , { currentTimeToDisplay : value } , manuSinope ) ;
203
204
}
204
205
} ,
205
206
} ,
@@ -287,12 +288,12 @@ const tzLocal = {
287
288
const lookup = { '24h' : 0 , '12h' : 1 } ;
288
289
value = value . toLowerCase ( ) ;
289
290
if ( lookup . hasOwnProperty ( value ) ) {
290
- await entity . write ( 'manuSpecificSinope' , { timeFormatToDisplay : lookup [ value ] } ) ;
291
+ await entity . write ( 'manuSpecificSinope' , { timeFormatToDisplay : lookup [ value ] } , manuSinope ) ;
291
292
return { readAfterWriteTime : 250 , state : { time_format : value } } ;
292
293
}
293
294
} ,
294
295
convertGet : async ( entity , key , meta ) => {
295
- await entity . read ( 'manuSpecificSinope' , [ 'timeFormatToDisplay' ] ) ;
296
+ await entity . read ( 'manuSpecificSinope' , [ 'timeFormatToDisplay' ] , manuSinope ) ;
296
297
} ,
297
298
} ,
298
299
sinope_connected_load : {
@@ -428,6 +429,10 @@ module.exports = [
428
429
await reporting . thermostatTemperature ( endpoint ) ;
429
430
await reporting . thermostatPIHeatingDemand ( endpoint ) ;
430
431
await reporting . thermostatOccupiedHeatingSetpoint ( endpoint ) ;
432
+
433
+ await reporting . temperature ( endpoint , { min : 1 , max : 0xFFFF } ) ; // Disable default reporting
434
+ await endpoint . configureReporting ( 'msTemperatureMeasurement' , [ {
435
+ attribute : 'tolerance' , minimumReportInterval : 1 , maximumReportInterval : 0xFFFF , reportableChange : 1 } ] ) ;
431
436
try {
432
437
await reporting . thermostatSystemMode ( endpoint ) ;
433
438
} catch ( error ) { /* Not all support this */ }
@@ -446,8 +451,6 @@ module.exports = [
446
451
}
447
452
await reporting . rmsCurrent ( endpoint , { min : 10 , max : 306 , change : 100 } ) ; // divider 1000: 0.1Arms
448
453
await reporting . rmsVoltage ( endpoint , { min : 10 , max : 307 , change : 5 } ) ; // divider 10: 0.5Vrms
449
-
450
- await reporting . temperature ( endpoint , { min : 1 , max : 0xFFFF } ) ; // Disable default reporting
451
454
} ,
452
455
} ,
453
456
{
@@ -492,6 +495,10 @@ module.exports = [
492
495
await reporting . thermostatTemperature ( endpoint ) ;
493
496
await reporting . thermostatPIHeatingDemand ( endpoint ) ;
494
497
await reporting . thermostatOccupiedHeatingSetpoint ( endpoint ) ;
498
+
499
+ await reporting . temperature ( endpoint , { min : 1 , max : 0xFFFF } ) ; // Disable default reporting
500
+ await endpoint . configureReporting ( 'msTemperatureMeasurement' , [ {
501
+ attribute : 'tolerance' , minimumReportInterval : 1 , maximumReportInterval : 0xFFFF , reportableChange : 1 } ] ) ;
495
502
try {
496
503
await reporting . thermostatSystemMode ( endpoint ) ;
497
504
} catch ( error ) { /* Not all support this */ }
@@ -510,8 +517,6 @@ module.exports = [
510
517
}
511
518
await reporting . rmsCurrent ( endpoint , { min : 10 , max : 306 , change : 100 } ) ; // divider 1000: 0.1Arms
512
519
await reporting . rmsVoltage ( endpoint , { min : 10 , max : 307 , change : 5 } ) ; // divider 10: 0.5Vrms
513
-
514
- await reporting . temperature ( endpoint , { min : 1 , max : 0xFFFF } ) ; // Disable default reporting
515
520
} ,
516
521
} ,
517
522
{
@@ -557,22 +562,24 @@ module.exports = [
557
562
const thermostatTimeSec = thermostatDate . getTime ( ) / 1000 ;
558
563
const thermostatTimezoneOffsetSec = thermostatDate . getTimezoneOffset ( ) * 60 ;
559
564
const currentTimeToDisplay = Math . round ( thermostatTimeSec - thermostatTimezoneOffsetSec - 946684800 ) ;
560
- await endpoint . write ( 'manuSpecificSinope' , { currentTimeToDisplay} , { manufacturerCode : 0x119C } ) ;
561
- await endpoint . write ( 'manuSpecificSinope' , { 'secondScreenBehavior' : 0 } , { manufacturerCode : 0x119C } ) ; // Mode auto
565
+ await endpoint . write ( 'manuSpecificSinope' , { currentTimeToDisplay} , manuSinope ) ;
566
+ await endpoint . write ( 'manuSpecificSinope' , { 'secondScreenBehavior' : 0 } , manuSinope ) ; // Mode auto
562
567
563
568
await reporting . thermostatTemperature ( endpoint ) ;
564
569
await reporting . thermostatPIHeatingDemand ( endpoint ) ;
565
570
await reporting . thermostatOccupiedHeatingSetpoint ( endpoint ) ;
566
571
await reporting . thermostatSystemMode ( endpoint ) ;
567
572
573
+ await reporting . temperature ( endpoint , { min : 1 , max : 0xFFFF } ) ; // Disable default reporting
574
+ await endpoint . configureReporting ( 'msTemperatureMeasurement' , [ {
575
+ attribute : 'tolerance' , minimumReportInterval : 1 , maximumReportInterval : 0xFFFF , reportableChange : 1 } ] ) ;
576
+
568
577
await reporting . readMeteringMultiplierDivisor ( endpoint ) ;
569
578
await reporting . currentSummDelivered ( endpoint , { min : 10 , max : 303 , change : [ 1 , 1 ] } ) ;
570
579
await reporting . readEletricalMeasurementMultiplierDivisors ( endpoint ) ;
571
580
await reporting . activePower ( endpoint , { min : 10 , max : 305 , change : 1 } ) ; // divider 1: 1W
572
581
await reporting . rmsCurrent ( endpoint , { min : 10 , max : 306 , change : 100 } ) ; // divider 1000: 0.1Arms
573
582
await reporting . rmsVoltage ( endpoint , { min : 10 , max : 307 , change : 5 } ) ; // divider 10: 0.5Vrms
574
-
575
- await reporting . temperature ( endpoint , { min : 1 , max : 0xFFFF } ) ; // Disable default reporting
576
583
try {
577
584
await reporting . thermostatUnoccupiedHeatingSetpoint ( endpoint ) ;
578
585
} catch ( error ) { /* Do nothing */ } // Not enought space but shall pass
0 commit comments