Newbie, creating installing drivers for SmartThings

I’ve made a ZigBee thermostat (based on nRF52840 dongle), Problem is default driver works, but requires manual refresh to update readings from my device. The device has paired itself as “ZigBee Thing”, than I changed driver to default “thermostat setpoint” (default for thermostat). Now it displays current temperature, mode and setpoint. Updating setpoint from connected phone via app. works (changes on the device), however, updated setpoint temperature from the device doesn’t show on the phone or in the hub until manual refresh forces it to display.

Cursor AI suggested making my own driver, which I’m failing to install on my hub.

Please advise,

Greg

Hi! A few important points to clarify based on what you’re seeing:

  1. If the device was added as a generic Zigbee Thing, it was not configured to report attributes, which explains why values only update when a refresh is triggered.
  2. Switching the device to a new driver does not guarantee that the device will go through the configuration lifecycle again. Changing drivers alone won’t automatically reconfigure attribute reporting.
  3. When you use Refresh, SmartThings sends ReadAttribute commands, which causes the physical device to return its current value, but this is different from proper attribute reporting being set up.
  4. If you’ve already created your own driver, could you please let us know at which step you’re running into issues when trying to install or apply it?
  5. If you haven’t created one yet, there are already several community drivers that may help with this use case.

You may want to check out Mariano’s community driver here, which has helped in similar scenarios: (EDGE Driver-Mc): Zigbee Temp Sensor and Child Thermostat Mc, Zigbee Temp Sensor with Thermostat Mc

Thank you very much!
However, I couldn’t find any links to get the thermostat driver, you’re suggesting.
If possible, could you please reply with a link (git-hub OK).
Thanks again!!!

Here’s the link: SmartThings. Add a little smartness to your things.

Thank you,
I’m getting much closer, but not there yet.
If possible, I’d like to keep this conversation opened.
Thanks again,
Greg

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