Thanks for your support.
I got my device recognized, but not reading any values. AI suggested using init.lua from default smartthings thermostat, heat only, no fan.
How can I find this init.lua?
Or please advise on how to change my init.lua.
I’m using F°, heat only, no fan:
–!lua
local capabilities = require “st.capabilities”
local zigbee = require “zigbee”
local defaults = require “st.zigbee.defaults”
local clusters = require “st.zigbee.clusters”
local Thermostat = clusters.Thermostat
local nurik_thermostat = {
zigbee_handlers = {
– Handler for incoming attribute reports from the Thermostat cluster
[Thermostat.ID] = {
[Thermostat.attributes.OccupiedHeatingSetpoint.ID] = function(driver, device, value, zb_rx)
print(string.format(“Received OccupiedHeatingSetpoint report for %s: %s”, device.label, value.value))
device:set_for_capability(capabilities.thermostatHeatingSetpoint, “heatingSetpoint”, value.value / 100)
end,
[Thermostat.attributes.OccupiedCoolingSetpoint.ID] = function(driver, device, value, zb_rx)
print(string.format(“Received OccupiedCoolingSetpoint report for %s: %s”, device.label, value.value))
device:set_for_capability(capabilities.thermostatCoolingSetpoint, “coolingSetpoint”, value.value / 100)
end,
– Add handlers for UnoccupiedHeatingSetpoint and UnoccupiedCoolingSetpoint if needed
– [Thermostat.attributes.UnoccupiedHeatingSetpoint.ID] = function(driver, device, value, zb_rx)
– print(string.format(“Received UnoccupiedHeatingSetpoint report for %s: %s”, device.label, value.value))
– device:set_for_capability(capabilities.thermostatHeatingSetpoint, “heatingSetpoint”, value.value / 100)
– end,
– [Thermostat.attributes.UnoccupiedCoolingSetpoint.ID] = function(driver, device, value, zb_rx)
– print(string.format(“Received UnoccupiedCoolingSetpoint report for %s: %s”, device.label, value.value))
– device:set_for_capability(capabilities.thermostatCoolingSetpoint, “coolingSetpoint”, value.value / 100)
– end,
},
},
lifecycle_handlers = {
init = function(self, data)
print(“Nurik Custom Thermostat Driver initialized!”)
end,
added = function(self, device)
print("Device added: " .. device.label)
– Configure reporting for OccupiedHeatingSetpoint
device:configure_reporting(Thermostat.ID, Thermostat.attributes.OccupiedHeatingSetpoint.ID,
Thermostat.attributes.OccupiedHeatingSetpoint.data_type, 1, 300, 100)
– Configure reporting for OccupiedCoolingSetpoint
device:configure_reporting(Thermostat.ID, Thermostat.attributes.OccupiedCoolingSetpoint.ID,
Thermostat.attributes.OccupiedCoolingSetpoint.data_type, 1, 300, 100)
print("Configured reporting for setpoints on device: " .. device.label)
end,
do_configure = function(self, device)
print("Configuring device: " .. device.label)
defaults.configure_reporting(device)
end,
}
}
return nurik_thermostat
THANK YOU,
Greg