You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an enhancement of #696 it shall be made possible that a local change from a device may be prioritized above the desired change of a property.
Problem statement
A desiredProperties property change could be outdated compared to the reported property which was e.g. directly changed at a device.
In such cases it does not make sense to apply the desiredProperties property.
Example
That is useful in e.g. the following scenario. Take the room thermostat again as an example:
the property target-temperature is at 20
the room thermostat looses its internet connectivity (e.g. due to an ISP outage)
user feels chilly, so the desiredProperties property configuration/target-temperature is set via mobile app to 22
as the device doesn't get this change right away as it is not online, nothing happens
after some time the user notices that it's not getting warmer so use stands up and changes the configuration/target-temperature manually at the room thermostat device to 23
room thermostat re-establishes connectivity and starts to apply missed desiredProperties state changes
desired state (desiredProperties/configuration/target-temperature=22) differs from actual/reported state (properties/configuration/target-temperature=23)
the device would apply the desiredProperties configuration/target-temperature of 22 as a result and overwrite the locally set 23
the user wonders why the configuration/target-temperature is now at 22
What would have been desirable in this scenario:
if the actual property configuration/target-temperature was modified more recently, the desiredProperties configuration/target-temperature is no longer valid and deleted
this is a configurable behavior
Improvement
After introducing #680 where _metadata is added to each property in a thing, it can be found out which revision each property has and e.g. why (e.g. due to "desired-sync" or "manual-overwrite") it was changed.
So both the device but also Ditto itself could find out if the property or the desiredProperties property target-temperature was updated more recently.
Example Ditto Protocol command (where one of the 2 "ditto-metadata:changeReason" values is chosen):
A device would have the means to determine by itself whether desiredProperties or actual reported properties are the more recent configuration state and whether the reported properties were e.g. modified based on a manual overwrite.
Ditto could also apply a deletion strategy based on the _revision and the changeReason:
reported-more-recent-manual-overwrite: would delete the desiredProperties property if there is a more recently changed reported property with a manual-overwrite changeReason.
I would give the full control to the devices, based on the last-updated timestamp an/or revision information for each "desired" property.
Based on this, the device can decide if a pending desired change is outdated (but was delivered late), compared to some newer local device-side reconfigurations.
I agree with @geglock to leave this to the device itself. In my opinion we will add unneeded complexity by also adding settings to the "desired" functionality.
As an enhancement of #696 it shall be made possible that a local change from a device may be prioritized above the
desired
change of a property.Problem statement
A
desiredProperties
property change could be outdated compared to thereported
property which was e.g. directly changed at a device.In such cases it does not make sense to apply the
desiredProperties
property.Example
That is useful in e.g. the following scenario. Take the room thermostat again as an example:
target-temperature
is at 20desiredProperties
propertyconfiguration/target-temperature
is set via mobile app to 22configuration/target-temperature
manually at the room thermostat device to 23desiredProperties
state changesdesiredProperties/configuration/target-temperature=22
) differs from actual/reported state (properties/configuration/target-temperature=23
)configuration/target-temperature
of 22 as a result and overwrite the locally set23
configuration/target-temperature
is now at 22What would have been desirable in this scenario:
configuration/target-temperature
was modified more recently, the desiredPropertiesconfiguration/target-temperature
is no longer valid and deletedImprovement
After introducing #680 where
_metadata
is added to each property in a thing, it can be found out whichrevision
each property has and e.g. why (e.g. due to"desired-sync"
or"manual-overwrite"
) it was changed.So both the device but also Ditto itself could find out if the property or the desiredProperties property
target-temperature
was updated more recently.Example Ditto Protocol command (where one of the 2
"ditto-metadata:changeReason"
values is chosen):Ditto know
"changeReson"
values:desired-sync
manual-overwrite
A device would have the means to determine by itself whether
desiredProperties
or actual reportedproperties
are the more recent configuration state and whether the reportedproperties
were e.g. modified based on a manual overwrite.Ditto could also apply a deletion strategy based on the
_revision
and thechangeReason
:reported-more-recent-manual-overwrite
: would delete thedesiredProperties
property if there is a more recently changed reportedproperty
with amanual-overwrite
changeReason.The text was updated successfully, but these errors were encountered: