diff --git a/OmniLinkBridge/MQTT/Alarm.cs b/OmniLinkBridge/MQTT/Alarm.cs index 069290e..4a3679e 100644 --- a/OmniLinkBridge/MQTT/Alarm.cs +++ b/OmniLinkBridge/MQTT/Alarm.cs @@ -8,8 +8,6 @@ namespace OmniLinkBridge.MQTT { public class Alarm : Device { - public string basic_state_topic { get; set; } - public string command_topic { get; set; } //public string code { get; set; } = string.Empty; diff --git a/OmniLinkBridge/Modules/MQTTModule.cs b/OmniLinkBridge/Modules/MQTTModule.cs index 44028ca..324ef41 100644 --- a/OmniLinkBridge/Modules/MQTTModule.cs +++ b/OmniLinkBridge/Modules/MQTTModule.cs @@ -363,20 +363,23 @@ namespace OmniLinkBridge.Modules for (ushort i = 1; i < OmniLink.Controller.Units.Count; i++) { - string type = i < 385 ? "light" : "switch"; - clsUnit unit = OmniLink.Controller.Units[i]; if (unit.DefaultProperties == true || Global.mqtt_discovery_ignore_units.Contains(unit.Number)) { + string type = i < 385 ? "light" : "switch"; MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/{type}/{Global.mqtt_prefix}/unit{i.ToString()}/config", null, MqttQualityOfServiceLevel.AtMostOnce, true); continue; } PublishUnitState(unit); - MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/{type}/{Global.mqtt_prefix}/unit{i.ToString()}/config", - JsonConvert.SerializeObject(unit.ToConfig()), MqttQualityOfServiceLevel.AtMostOnce, true); + if(i < 385) + MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/light/{Global.mqtt_prefix}/unit{i.ToString()}/config", + JsonConvert.SerializeObject(unit.ToConfig()), MqttQualityOfServiceLevel.AtMostOnce, true); + else + MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/switch/{Global.mqtt_prefix}/unit{i.ToString()}/config", + JsonConvert.SerializeObject(unit.ToConfigSwitch()), MqttQualityOfServiceLevel.AtMostOnce, true); } } diff --git a/OmniLinkBridge/Properties/AssemblyInfo.cs b/OmniLinkBridge/Properties/AssemblyInfo.cs index 87493de..a2cc211 100644 --- a/OmniLinkBridge/Properties/AssemblyInfo.cs +++ b/OmniLinkBridge/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.2.0")] -[assembly: AssemblyFileVersion("1.1.2.0")] +[assembly: AssemblyVersion("1.1.3.0")] +[assembly: AssemblyFileVersion("1.1.3.0")] diff --git a/README.md b/README.md index 45290f5..3676a81 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Provides MQTT bridge, web service API, time sync, and logging for [HAI/Leviton OmniPro II controllers](https://www.leviton.com/en/products/brands/omni-security-automation). Provides integration with [Samsung SmarthThings via web service API](https://github.com/excaliburpartners/SmartThings-OmniPro) and [Home Assistant via MQTT](https://www.home-assistant.io/components/mqtt/). ## Download -You can use docker to build an image from git or download the [binary here](http://www.excalibur-partners.com/downloads/OmniLinkBridge_1_1_2.zip). +You can use docker to build an image from git or download the [binary here](http://www.excalibur-partners.com/downloads/OmniLinkBridge_1_1_3.zip). ## Requirements - [Docker](https://www.docker.com/) @@ -184,6 +184,13 @@ string ON ``` ## Change Log +Version 1.1.3 - 2019-02-10 +- Publish config when reconnecting to MQTT +- Update readme documentation +- Add override zone type for web service +- Add area json status and climate temp sensor +- Fix compatibility with Home Assistant 0.87 MQTT strict config + Version 1.1.2 - 2018-10-23 - Add min and max climate temperatures - Update docker run command to use local time zone