export thermostat to openhab

This commit is contained in:
Wolfgang Hottgenroth
2018-02-27 15:45:19 +01:00
parent bd0996b03b
commit d27349833a
2 changed files with 9 additions and 2 deletions

View File

@ -28,7 +28,7 @@ export function SwitchExport(itemId: string, label: string, stateTopic: string,
}
export function ThermostatExport(itemId: string, label: string, temperatureTopic: string, temperatureFeedbackTopic: string) : ExportType {
return {'homekit': ThermostatHomekitExport(itemId, label, temperatureTopic, temperatureFeedbackTopic), 'openhab': ''}
return {'homekit': ThermostatHomekitExport(itemId, label, temperatureTopic, temperatureFeedbackTopic), 'openhab': ThermostatOpenHAPExport(itemId, label, temperatureTopic, temperatureFeedbackTopic)}
}
export function ContactExport(itemId: string, label: string, status: string) : ExportType {
@ -120,6 +120,10 @@ function SwitchOpenHABExport(id: string, label: string, setOn: string, statusOn:
return `Switch ${id} {mqtt=">[localbroker:${setOn}:command:*:default],<[localbroker:${statusOn}:state:default]"}`
}
function ThermostatOpenHAPExport(id: string, label: string, setTemperature: string, statusTemperature: string) : string {
return `Number ${id} {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}`
}
function HueColorLightHomekitExport(id: string, label: string,
stateTopic: string, stateFeedbackTopic: string,
brightnessTopic: string, brightnessFeedbackTopic: string,