some changes
This commit is contained in:
3
dist/M433SwitchItem.js
vendored
3
dist/M433SwitchItem.js
vendored
@ -7,6 +7,9 @@ class M433SwitchItem extends AItem_1.AItem {
|
|||||||
getStateTopic() {
|
getStateTopic() {
|
||||||
return this.stateTopic;
|
return this.stateTopic;
|
||||||
}
|
}
|
||||||
|
getInTopic() {
|
||||||
|
return this.stateTopic;
|
||||||
|
}
|
||||||
getStateFeedbackTopic() {
|
getStateFeedbackTopic() {
|
||||||
return this.stateFeedbackTopic;
|
return this.stateFeedbackTopic;
|
||||||
}
|
}
|
||||||
|
11
dist/MaxThermostat.js
vendored
11
dist/MaxThermostat.js
vendored
@ -27,8 +27,14 @@ class MaxThermostat extends AHomematicItem_1.AHomematicItem {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
processMessage(topic, payload) {
|
processMessage(topic, payload) {
|
||||||
if ((topic == this.temperatureTopic) || (topic == this.deviceFeedbackTopic)) {
|
let setTemperature = false;
|
||||||
|
if (topic == this.temperatureTopic) {
|
||||||
this.temperature = parseFloat(payload);
|
this.temperature = parseFloat(payload);
|
||||||
|
setTemperature = true;
|
||||||
|
}
|
||||||
|
else if (topic == this.deviceFeedbackTopic) {
|
||||||
|
// this.temperature = parseFloat(payload)
|
||||||
|
setTemperature = false;
|
||||||
}
|
}
|
||||||
else if (topic in this.windowContactMap) {
|
else if (topic in this.windowContactMap) {
|
||||||
this.windowContactMap[topic].state = payload;
|
this.windowContactMap[topic].state = payload;
|
||||||
@ -38,7 +44,9 @@ class MaxThermostat extends AHomematicItem_1.AHomematicItem {
|
|||||||
this.windowOpen = true;
|
this.windowOpen = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
setTemperature = true;
|
||||||
}
|
}
|
||||||
|
if (setTemperature) {
|
||||||
if (!this.windowOpen) {
|
if (!this.windowOpen) {
|
||||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`);
|
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`);
|
||||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${this.temperature}`);
|
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${this.temperature}`);
|
||||||
@ -48,6 +56,7 @@ class MaxThermostat extends AHomematicItem_1.AHomematicItem {
|
|||||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${WINDOW_OPEN_TEMPERATURE}`);
|
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${WINDOW_OPEN_TEMPERATURE}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.MaxThermostat = MaxThermostat;
|
exports.MaxThermostat = MaxThermostat;
|
||||||
//# sourceMappingURL=MaxThermostat.js.map
|
//# sourceMappingURL=MaxThermostat.js.map
|
7
dist/MaxWindowContact.js
vendored
7
dist/MaxWindowContact.js
vendored
@ -18,7 +18,12 @@ class MaxWindowContact extends AHomematicItem_1.AHomematicItem {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
processMessage(topic, payload) {
|
processMessage(topic, payload) {
|
||||||
this.state = payload;
|
if (payload == 'true') {
|
||||||
|
this.state = 'OPEN';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.state = 'CLOSED';
|
||||||
|
}
|
||||||
MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state);
|
MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
dist/main.js
vendored
12
dist/main.js
vendored
@ -23,6 +23,14 @@ let allLabeledItems = new Array();
|
|||||||
let aquariumLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'AquariumLight', 'Aquariumlicht', '14665044 24 1', '14665041 24 1');
|
let aquariumLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'AquariumLight', 'Aquariumlicht', '14665044 24 1', '14665041 24 1');
|
||||||
aquariumLight.start();
|
aquariumLight.start();
|
||||||
allLabeledItems.push(aquariumLight);
|
allLabeledItems.push(aquariumLight);
|
||||||
|
let aquariumLightCron = new Cron_1.Cron('aquariumLightCron', aquariumLight, [
|
||||||
|
{ cronTime: '00 00 07 * * 1-5', output: 'ON' },
|
||||||
|
{ cronTime: '00 00 09 * * 6-7', output: 'ON' },
|
||||||
|
{ cronTime: '00 00 13 * * *', output: 'OFF' },
|
||||||
|
{ cronTime: '00 00 14 * * *', output: 'ON' },
|
||||||
|
{ cronTime: '00 00 22 * * *', output: 'OFF' }
|
||||||
|
]);
|
||||||
|
aquariumLightCron.start();
|
||||||
// Anna Bett 14668116 24 1 14668113 24 1
|
// Anna Bett 14668116 24 1 14668113 24 1
|
||||||
let annaBedLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'BedLight', 'Bettlicht Anna', '14668116 24 1', '14668113 24 1');
|
let annaBedLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'BedLight', 'Bettlicht Anna', '14668116 24 1', '14668113 24 1');
|
||||||
annaBedLight.start();
|
annaBedLight.start();
|
||||||
@ -147,9 +155,9 @@ let thermostatBathroomGndCron = new Cron_1.Cron('thermostatBathroomGndCron', the
|
|||||||
{ cronTime: '00 00 23 * * *', output: '5.0' }
|
{ cronTime: '00 00 23 * * *', output: '5.0' }
|
||||||
]);
|
]);
|
||||||
thermostatBathroomGndCron.start();
|
thermostatBathroomGndCron.start();
|
||||||
let windowContactBathroom1st = new MaxWindowContact_1.MaxWindowContact('1st', 'Bathroom', 'WindowContact', 'Fenster Bad oben', 7);
|
let windowContactBathroom1st = new MaxWindowContact_1.MaxWindowContact('1st', 'Bathroom', 'WindowContact', 'Fenster Bad oben', 2);
|
||||||
windowContactBathroom1st.start();
|
windowContactBathroom1st.start();
|
||||||
let thermostatBathroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bathroom', 'Thermostat', 'Thermostat Bad oben', 4, [windowContactBathroom1st]);
|
let thermostatBathroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bathroom', 'Thermostat', 'Thermostat Bad oben', 3, [windowContactBathroom1st]);
|
||||||
thermostatBathroom1st.start();
|
thermostatBathroom1st.start();
|
||||||
let thermostatBathroom1stCron = new Cron_1.Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
|
let thermostatBathroom1stCron = new Cron_1.Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
|
||||||
{ cronTime: '00 00 06 * * 1-5', output: '21.0' },
|
{ cronTime: '00 00 06 * * 1-5', output: '21.0' },
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as logger from './log'
|
import * as logger from './log'
|
||||||
import { mqttHandler } from './MqttDispatcher'
|
import { mqttHandler } from './MqttDispatcher'
|
||||||
import { AItem, HasStateAndFeedbackTopic } from './AItem'
|
import { AItem, HasStateAndFeedbackTopic, HasInTopic } from './AItem'
|
||||||
import { SwitchExport, ExportType } from './Export'
|
import { SwitchExport, ExportType } from './Export'
|
||||||
|
|
||||||
|
|
||||||
@ -18,6 +18,10 @@ export class M433SwitchItem extends AItem implements HasStateAndFeedbackTopic {
|
|||||||
return this.stateTopic
|
return this.stateTopic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getInTopic() : string {
|
||||||
|
return this.stateTopic
|
||||||
|
}
|
||||||
|
|
||||||
getStateFeedbackTopic() : string {
|
getStateFeedbackTopic() : string {
|
||||||
return this.stateFeedbackTopic
|
return this.stateFeedbackTopic
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ export class MaxThermostat extends AHomematicItem implements HasInTopic {
|
|||||||
this.temperature = parseFloat(payload)
|
this.temperature = parseFloat(payload)
|
||||||
setTemperature = true
|
setTemperature = true
|
||||||
} else if (topic == this.deviceFeedbackTopic) {
|
} else if (topic == this.deviceFeedbackTopic) {
|
||||||
this.temperature = parseFloat(payload)
|
// this.temperature = parseFloat(payload)
|
||||||
setTemperature = false
|
setTemperature = false
|
||||||
} else if (topic in this.windowContactMap) {
|
} else if (topic in this.windowContactMap) {
|
||||||
this.windowContactMap[topic].state = payload
|
this.windowContactMap[topic].state = payload
|
||||||
|
@ -25,7 +25,11 @@ export class MaxWindowContact extends AHomematicItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processMessage(topic: string, payload: string) : void {
|
processMessage(topic: string, payload: string) : void {
|
||||||
this.state = payload
|
if (payload == 'true') {
|
||||||
|
this.state = 'OPEN'
|
||||||
|
} else {
|
||||||
|
this.state = 'CLOSED'
|
||||||
|
}
|
||||||
mqttHandler.send(this.stateFeedbackTopic, this.state)
|
mqttHandler.send(this.stateFeedbackTopic, this.state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
src/main.ts
14
src/main.ts
@ -30,6 +30,16 @@ let aquariumLight = new M433SwitchItem('1st', 'Anna', 'AquariumLight', 'Aquarium
|
|||||||
aquariumLight.start()
|
aquariumLight.start()
|
||||||
allLabeledItems.push(aquariumLight)
|
allLabeledItems.push(aquariumLight)
|
||||||
|
|
||||||
|
let aquariumLightCron = new Cron('aquariumLightCron', aquariumLight, [
|
||||||
|
{cronTime: '00 00 07 * * 1-5', output: 'ON'},
|
||||||
|
{cronTime: '00 00 09 * * 6-7', output: 'ON'},
|
||||||
|
{cronTime: '00 00 13 * * *', output: 'OFF'},
|
||||||
|
{cronTime: '00 00 14 * * *', output: 'ON'},
|
||||||
|
{cronTime: '00 00 22 * * *', output: 'OFF'}
|
||||||
|
])
|
||||||
|
aquariumLightCron.start()
|
||||||
|
|
||||||
|
|
||||||
// Anna Bett 14668116 24 1 14668113 24 1
|
// Anna Bett 14668116 24 1 14668113 24 1
|
||||||
let annaBedLight = new M433SwitchItem('1st', 'Anna', 'BedLight', 'Bettlicht Anna', '14668116 24 1', '14668113 24 1')
|
let annaBedLight = new M433SwitchItem('1st', 'Anna', 'BedLight', 'Bettlicht Anna', '14668116 24 1', '14668113 24 1')
|
||||||
annaBedLight.start()
|
annaBedLight.start()
|
||||||
@ -195,10 +205,10 @@ let thermostatBathroomGndCron = new Cron('thermostatBathroomGndCron', thermostat
|
|||||||
thermostatBathroomGndCron.start()
|
thermostatBathroomGndCron.start()
|
||||||
|
|
||||||
|
|
||||||
let windowContactBathroom1st = new MaxWindowContact('1st', 'Bathroom', 'WindowContact', 'Fenster Bad oben', 7)
|
let windowContactBathroom1st = new MaxWindowContact('1st', 'Bathroom', 'WindowContact', 'Fenster Bad oben', 2)
|
||||||
windowContactBathroom1st.start()
|
windowContactBathroom1st.start()
|
||||||
|
|
||||||
let thermostatBathroom1st = new MaxThermostat('1st', 'Bathroom', 'Thermostat', 'Thermostat Bad oben', 4, [windowContactBathroom1st])
|
let thermostatBathroom1st = new MaxThermostat('1st', 'Bathroom', 'Thermostat', 'Thermostat Bad oben', 3, [windowContactBathroom1st])
|
||||||
thermostatBathroom1st.start()
|
thermostatBathroom1st.start()
|
||||||
|
|
||||||
let thermostatBathroom1stCron = new Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
|
let thermostatBathroom1stCron = new Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
|
||||||
|
Reference in New Issue
Block a user