コード例 #1
0
 private void Omnilink_OnThermostatStatus(object sender, ThermostatStatusEventArgs e)
 {
     if (!e.EventTimer)
     {
         WebNotification.Send("thermostat", JsonConvert.SerializeObject(e.Thermostat.ToContract()));
     }
 }
コード例 #2
0
        private void Omnilink_OnThermostatStatus(object sender, ThermostatStatusEventArgs e)
        {
            int.TryParse(e.Thermostat.TempText(), out int temp);
            int.TryParse(e.Thermostat.HeatSetpointText(), out int heat);
            int.TryParse(e.Thermostat.CoolSetpointText(), out int cool);
            int.TryParse(e.Thermostat.HumidityText(), out int humidity);
            int.TryParse(e.Thermostat.HumidifySetpointText(), out int humidify);
            int.TryParse(e.Thermostat.DehumidifySetpointText(), out int dehumidify);

            // Log all events including thermostat polling
            DBQueue(@"
                INSERT INTO log_thermostats (timestamp, id, name, 
                    status, temp, heat, cool, 
                    humidity, humidify, dehumidify,
                    mode, fan, hold)
                VALUES ('" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "','" + e.ID + "','" + e.Thermostat.Name + "','" +
                    e.Thermostat.HorC_StatusText() + "','" + temp.ToString() + "','" + heat + "','" + cool + "','" +
                    humidity + "','" + humidify + "','" + dehumidify + "','" +
                    e.Thermostat.ModeText() + "','" + e.Thermostat.FanModeText() + "','" + e.Thermostat.HoldStatusText() + "')");

            // Ignore events fired by thermostat polling
            if (!e.EventTimer && Global.verbose_thermostat)
            {
                log.Debug("ThermostatStatus " + e.ID + " " + e.Thermostat.Name +
                          ", Status: " + e.Thermostat.TempText() + " " + e.Thermostat.HorC_StatusText() +
                          ", Heat: " + e.Thermostat.HeatSetpointText() +
                          ", Cool: " + e.Thermostat.CoolSetpointText() +
                          ", Mode: " + e.Thermostat.ModeText() +
                          ", Fan: " + e.Thermostat.FanModeText() +
                          ", Hold: " + e.Thermostat.HoldStatusText());
            }
        }
コード例 #3
0
 private void Omnilink_OnThermostatStatus(object sender, ThermostatStatusEventArgs e)
 {
     if (!e.EventTimer)
     {
         PublishThermostatState(e.Thermostat);
     }
 }
コード例 #4
0
 private void Omnilink_OnThermostatStatus(object sender, ThermostatStatusEventArgs e)
 {
     // Ignore events fired by thermostat polling and when temperature is invalid
     // An invalid temperature can occur when a Zigbee thermostat is unreachable
     if (!e.EventTimer && e.Thermostat.Temp > 0)
     {
         WebNotification.Send("thermostat", JsonConvert.SerializeObject(e.Thermostat.ToContract()));
     }
 }
コード例 #5
0
ファイル: MQTTModule.cs プロジェクト: rcjacoby/OmniLinkBridge
        private void Omnilink_OnThermostatStatus(object sender, ThermostatStatusEventArgs e)
        {
            if (!MqttClient.IsConnected)
            {
                return;
            }

            // Ignore events fired by thermostat polling
            if (!e.EventTimer)
            {
                PublishThermostatState(e.Thermostat);
            }
        }