Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding SAT402ZB Thermostat #1506

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion drivers/SmartThings/zigbee-thermostat/fingerprints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ zigbeeManufacturer:
manufacturer: Stelpro
model: MaestroStat
deviceProfileName: thermostat-stelpro-profile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @gcavalcantistelpro Thank you for your submission. I would encourage that we focus this change only on adding one new device, the SAT402ZB device. Can you please update the PR to no longer make changes to the "Selpro/MaestroStat"device?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @lelandblue , I've just added a commit for the SAT402ZB thermostat, i left the maestro untouched and added new files for this specific thermostat

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @lelandblue , i could validate locally that the device is working after my last commit, please let me know if any further modifications are required on the PR side. Thanks

- id: "Stelpro/SAT402ZB"
deviceLabel: Allia Thermostat
manufacturer: Stello
model: HT402
deviceProfileName: thermostat-stelpro-profile-no-rh
- id: "Stelpro/SORB"
deviceLabel: Stelpro Thermostat
manufacturer: Stelpro
Expand Down Expand Up @@ -144,4 +149,4 @@ zigbeeGeneric:
server:
- 0x0201
- 0x0402
deviceProfileName: base-thermostat-fanless
deviceProfileName: base-thermostat-fanless
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: thermostat-stelpro-profile-no-rh
components:
- id: main
capabilities:
- id: temperatureMeasurement
version: 1
config:
values:
- key: "temperature.value"
range: [ -20, 100 ]
- id: thermostatHeatingSetpoint
version: 1
config:
values:
- key: "heatingSetpoint.value"
range: [ 5, 30 ]
- id: thermostatOperatingState
version: 1
config:
values:
- key: "thermostatOperatingState.value"
enabledValues:
- heating
- idle
- id: temperatureAlarm
version: 1
config:
values:
- key: "temperatureAlarm.value"
enabledValues:
- cleared
- freeze
- heat
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: Thermostat
preferences:
- name: "lock"
title: "Lock"
description: "Do you want to lock your thermostat's physical keypad?"
required: true
preferenceType: enumeration
definition:
options:
0: "No"
1: "Yes"
default: 0
3 changes: 2 additions & 1 deletion drivers/SmartThings/zigbee-thermostat/src/stelpro/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ local HEAT_ALRAM_TEMPERATURE = 50

local STELPRO_THERMOSTAT_FINGERPRINTS = {
{ mfr = "Stelpro", model = "MaestroStat" },
{ mfr = "Stello", model = "HT402" },
gcavalcantistelpro marked this conversation as resolved.
Show resolved Hide resolved
{ mfr = "Stelpro", model = "SORB" },
{ mfr = "Stelpro", model = "SonomaStyle" }
}
Expand Down Expand Up @@ -132,4 +133,4 @@ local stelpro_thermostat = {
can_handle = is_stelpro_thermostat
}

return stelpro_thermostat
return stelpro_thermostat
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
-- Copyright 2022 SmartThings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date

--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

local capabilities = require "st.capabilities"
local clusters = require "st.zigbee.zcl.clusters"
local device_management = require "st.zigbee.device_management"

local RelativeHumidity = clusters.RelativeHumidity
local Thermostat = clusters.Thermostat
local ThermostatUserInterfaceConfiguration = clusters.ThermostatUserInterfaceConfiguration

local STELPRO_THERMOSTAT_FINGERPRINTS = {
{ mfr = "Stelpro", model = "MaestroStat" },
{ mfr = "Stello", model = "HT402" },
}

local is_stelpro_thermostat = function(opts, driver, device)
for _, fingerprint in ipairs(STELPRO_THERMOSTAT_FINGERPRINTS) do
if device:get_manufacturer() == fingerprint.mfr and device:get_model() == fingerprint.model then
return true
end
end
return false
end

local do_refresh = function(self, device)
local attributes = {
Thermostat.attributes.LocalTemperature,
Thermostat.attributes.PIHeatingDemand,
Thermostat.attributes.OccupiedHeatingSetpoint,
ThermostatUserInterfaceConfiguration.attributes.TemperatureDisplayMode,
ThermostatUserInterfaceConfiguration.attributes.KeypadLockout,
RelativeHumidity.attributes.MeasuredValue
}
for _, attribute in pairs(attributes) do
device:send(attribute:read(device))
end
end

local device_added = function(self, device)
device:emit_event(capabilities.temperatureAlarm.temperatureAlarm.cleared())
do_refresh(self, device)
end

local function do_configure(self, device)
device:send(device_management.build_bind_request(device, Thermostat.ID, self.environment_info.hub_zigbee_eui))
device:send(Thermostat.attributes.LocalTemperature:configure_reporting(device, 10, 60, 50))
device:send(Thermostat.attributes.OccupiedHeatingSetpoint:configure_reporting(device, 1, 600, 50))
device:send(Thermostat.attributes.PIHeatingDemand:configure_reporting(device, 1, 3600, 1))

device:send(ThermostatUserInterfaceConfiguration.attributes.TemperatureDisplayMode:configure_reporting(device, 1, 0, 1))
device:send(ThermostatUserInterfaceConfiguration.attributes.KeypadLockout:configure_reporting(device, 1, 0, 1))
device:send(RelativeHumidity.attributes.MeasuredValue:configure_reporting(device, 10, 300, 1))
end

local stelpro_maestro_othermostat = {
NAME = "Stelpro Maestro Thermostat Handler",
capability_handlers = {
[capabilities.refresh.ID] = {
[capabilities.refresh.commands.refresh.NAME] = do_refresh,
}
},
lifecycle_handlers = {
added = device_added,
doConfigure = do_configure
},
can_handle = is_stelpro_thermostat
}

return stelpro_maestro_othermostat
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local Thermostat = clusters.Thermostat
local ThermostatUserInterfaceConfiguration = clusters.ThermostatUserInterfaceConfiguration

local STELPRO_THERMOSTAT_FINGERPRINTS = {
{ mfr = "Stelpro", model = "MaestroStat" },
{ mfr = "Stello", model = "HT402" },
gcavalcantistelpro marked this conversation as resolved.
Show resolved Hide resolved
}

local is_stelpro_thermostat = function(opts, driver, device)
Expand Down
Loading