diff --git a/OmniLinkBridge/MQTT/BinarySensor.cs b/OmniLinkBridge/MQTT/BinarySensor.cs index dc8521a..8dc1370 100644 --- a/OmniLinkBridge/MQTT/BinarySensor.cs +++ b/OmniLinkBridge/MQTT/BinarySensor.cs @@ -27,5 +27,11 @@ namespace OmniLinkBridge.MQTT [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string value_template { get; set; } + + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public string payload_off { get; set; } + + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public string payload_on { get; set; } } } diff --git a/OmniLinkBridge/Modules/MQTTModule.cs b/OmniLinkBridge/Modules/MQTTModule.cs index 43b405f..104fc9a 100644 --- a/OmniLinkBridge/Modules/MQTTModule.cs +++ b/OmniLinkBridge/Modules/MQTTModule.cs @@ -187,7 +187,7 @@ namespace OmniLinkBridge.Modules PublishAsync(SystemTroubleTopic("phone"), OmniLink.TroublePhone ? "trouble" : "secure"); PublishAsync(SystemTroubleTopic("ac"), OmniLink.TroubleAC ? "trouble" : "secure"); PublishAsync(SystemTroubleTopic("battery"), OmniLink.TroubleBattery ? "trouble" : "secure"); - PublishAsync(SystemTroubleTopic("dcn"), OmniLink.TroubleDCM ? "trouble" : "secure"); + PublishAsync(SystemTroubleTopic("dcm"), OmniLink.TroubleDCM ? "trouble" : "secure"); } public string SystemTroubleTopic(string type) @@ -202,7 +202,9 @@ namespace OmniLinkBridge.Modules unique_id = $"{Global.mqtt_prefix}system{type}", name = $"{Global.mqtt_discovery_name_prefix}System {name}", state_topic = SystemTroubleTopic(type), - device_class = BinarySensor.DeviceClass.problem + device_class = BinarySensor.DeviceClass.problem, + payload_off = "secure", + payload_on = "trouble" }; }