HomeSeer / Plugin-SDK

Plugin development kit for the 4th major edition of the HomeSeer platform.
https://www.nuget.org/packages/HomeSeer-PluginSDK/
GNU Affero General Public License v3.0
20 stars 4 forks source link

"Up" and "Down" buttons in thermostat grid view #268

Closed alexbk66 closed 2 years ago

alexbk66 commented 2 years ago

I hit a bit of a problem with the "Up" and "Down" buttons in thermostat grid view - when you click the buttons SetIOMulti() sends the current temperature device value +/- 1. Which poses 2 issues:

  1. It assumes that increment/decrement is always "1" - which is not always the case, some thermostats can have 0.5, some 0.1
  2. It also assumes that the temperature device can't have any other states apart from the temperature itself. But I use also states disabled=-1000 and unknown=-1001 - in this case SetIOMulti() bluntly sends -999, etc.

In my view it should be possible to assign fixed control values to these buttons explicitly. PS. For backward compatibility if the explicit control values are not set in the plugin - then the behaviour may still be current. image

rjhelmke commented 2 years ago

In regards the increment, right now when you specify a range we calculate a list of values for the droplist in the UI. This always creates a list with absolute values. So going a long with your request we should probably have a property where you can set the increment for ranges. This will allow HS to create the proper droplist.

Dunnenj commented 2 years ago

In regards the increment, right now when you specify a range we calculate a list of values for the droplist in the UI. This always creates a list with absolute values. So going a long with your request we should probably have a property where you can set the increment for ranges. This will allow HS to create the proper droplist.

In case you add this property, please do not only add to the SDK but make it also available in the UI. See my request: https://forums.homeseer.com/forum/homeseer-products-services/system-software-controllers/hs4-hs4pro-software/1527994-hs4-release-announcements-4-2-8-0-is-available?p=1529422#post1529422

spudwebb commented 2 years ago

@alexbk66, since HS 4.2.14.0, the Up and Down buttons in thermostat grid view are linked to the new EcontrolUse.IncrementValue and EcontrolUse.DecrementValue. So, if one of the controls attached to the setpoint feature has a control use set to EcontrolUse.IncrementValue, then this control will be called which allows you to increment by 0.1, 0.5 or whatever value you want. If no control with EControlUse.IncrementValue is found then the old behavior remains, i.e increment current value by 1.

I believe that fixes this issue, so I'm closing it. Let me know if you have any problem with this new feature.

alexbk66 commented 2 years ago

then this control will be called which allows you to increment by 0.1, 0.5 or whatever value you want

Thanks @spudwebb , but how do I specify the increment value?

spudwebb commented 2 years ago

You need to create 2 StatusControls attached to the setpoint feature, and which have the ControlUse property set to EcontrolUse.IncrementValue and EcontrolUse.DecrementValue. Let's say for example those StatusControls are buttons called "+" and "-" with target values being -1001 and -1002. Those controls will be "linked" to the Up and Down arrows in thermostat grid view. So when user clicks the up arrow, your plugin will be called in SetIOMulti with the control value set to -1001, it is then your job to increment the setpoint value by the correct value.