I am trying to create a device using standard capabilities. I am using the Thermostat Heating Setpoint capability. Upon initialization, I use this command to set initial values:
It sets the unit and the initial value OK but I don’t seem to be able to change the title (label) or the minimum/maximum values. What am I doing wrong? thanks.
Min and Max need to be separate attributes if you want to change them, and depending on how you plan on using them, it may be better to set them in Preferences.
Can you provide more detail on what you’re trying to do?
Thanks, Preferences is where I was trying to get the values but then wasn’t sure how to get the preference value into the actual attribute. Appreciate the link.
No problem! Look at other code from developers for examples. That will help you a lot to learn this stuff. Here’s an example of one of mine using preferences maybe in a way you want to:
I guess what I really need to change the ‘constraints’ value min/max? Just trying to figure this all out before I have to move to the new app. thanks again.
Trying. I have been searching for various examples to learn from but not many yet. In your example, you use ‘encap’ function to set the attributes after setting update. Is documentation for that function in the new API?
I’ve not gotten that far yet, but now that custom capabilities are back with CLI (see a separate post on that), I plan on working on a few of my DTH’s this weekend.
Your idea is a good one, but it would be helpful if ST provided a little more documentation for use too so we’re not guess on all this stuff.
Not that I know of. Technically 'encap" isn’t really needed, but since the DTH I used as my source was used for both newer Zwave devices supporting S2 security. Look at the section titled “secEncap” to see what I mean. In ST’s much older version f that DTH, encap didn’t exist at that time.
Look at the preference for watts limit as a good example of using a preference value starting at line 120:
Yes, this uses the value. Unfortunately, ST has set limits internally so the adjustment won’t go above/below the internal min/max and I can’t figure out how to change those limits. Right now, I am limited to values 36-95 F which is fine for a thermostat but my ultimate purpose is more general.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script_dth_metadata_111dfee4_ffe5_454b_94a6_e04c67db9815: 72: Invalid variable name. Must start with a letter but was: “minimum”
. At [72:18] @ line 72, column 18.
sendEvent(name: “minimum”, value: settings.minimump as int, displayed: true)
^
1 error
I know I should probably start a new topic but I have another question. I tried using ovenSetpoint instead of thermostat and it mostly works and would work better than the thermostat for my needs but every time I try to adjust the value, I get this error:
but that didn’t seem to work. You think the. intermediate variable will make a difference? Also, it is confusing because ‘value’ has a minimum and maximum but ‘constraints’ have min and max. Which do I need to change? I have tried both to no avail. Even in the preferences where I have an input for minimum and maximum, I am not allowed to go beyond 999 (anything with more than 3 digits, the save button is grayed out). Where is that constraint? this is all very confusing.