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

Set Values are not getting refreshed after commit 0c82d4b0831b197c88c56e75270c423c9eee24cb #2637

Open
aerofeev2k opened this issue May 28, 2022 · 1 comment

Comments

@aerofeev2k
Copy link

aerofeev2k commented May 28, 2022

Hi, @markruys

What is the purpose of this change in Value.cpp?

if (!IsWriteOnly())
{
-       // queue a "RequestValue" message to update the value
-       if (m_refreshAfterSet) {
-               cc->RequestValue( 0, m_id.GetIndex(), m_id.GetInstance(), Driver::MsgQueue_Send );
+       if (m_refreshAfterSet)
+       {
+           if (!node->GetCommandClass(Internal::CC::Supervision::StaticGetCommandClassId()))
+           {
+               // queue a "RequestValue" message to update the value
+               cc->RequestValue( 0, m_id.GetIndex(), m_id.GetInstance(), Driver::MsgQueue_Send );
+           }
        }
}

It broke setting LEDs in Homeseer HS-WD200+. Now whenever a LED is turned ON or OFF, the command is delivered to the Homeseer, but the value in the OZW memory is not updated. And since Domoticz checks current value before setting a new one, this causes problems for sequences like this:

  1. Turn LED1 to Red (works if current value is Off)
  2. Turn LED1 to Off (doesn't do anything because the value is still Off in OZW memory).

I checked what GetCommandClass() returns in my case, and it's not NULL, so RequestValue() is not getting called.

I wonder if this entire "skip refresh" logic should be accounted for here:

bool ValueInt::Set(int32 const _value)
{
// create a temporary copy of this value to be submitted to the Set() call and set its value to the function param
ValueInt* tempValue = new ValueInt(*this);
tempValue->m_value = _value;
// Set the value in the device.
bool ret = ((Value*) tempValue)->Set();
// clean up the temporary value
delete tempValue;
return ret;
}

where the code is just creating a temporary value and is sending it to the device, apparently expecting that a refresh will happen in the end.

@markruys
Copy link
Contributor

markruys commented Jun 6, 2022

If I recall correctly, the logic is when a device supports the Supervision CC, you should not request the set value immediately. This is problematic because many devices need some time to process the setter and an immediate get would result in the old value. So for these devices Domoticz would not update the GUI. This is where the Supervision CC comes in handy: it will notify the application when a change occurs. But again, it's a long time ago and I'm not deep into ZWave internals.

So my guess is to check whether the Supervision CC report is handled correctly for your device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants