-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[icalendar] Wrong Command type will be used #9820
Comments
Because I prefer my solution idea 1 I gave it a try and changed the binding myself. Up to now it looks fine. You can see the changes here -> chris922@4d9dc1e I can't imagine side-effects due to changing from |
Hi there, this looks similar to #9771 but the other way around. As described in #9771 (comment) I am wondering why Lines 48 to 50 in b6eea71
|
Good point! It seems that just adding I quickly tested this in my branch via the unit-tests and when no unit is given a See commit chris922@8ea9102 |
I'm not fully sure why DecimalType is missing. AFAIR the code was partly copied (as the logic was a bit different) from openhab-core from where commands were also parsed using a non-public (in terms of stability because not defined by an API) method. But i think we can extend the logic for DecimalType here if needed. |
Ok cool, I just created the PR #9849 to add |
Fixes #9820 Related to #9771 Signed-off-by: Christian Bandowski <[email protected]>
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/oh3-icalendar-migration/116731/2 |
…#9849) Fixes openhab#9820 Related to openhab#9771 Signed-off-by: Christian Bandowski <[email protected]> Signed-off-by: John Marshall <[email protected]>
…#9849) Fixes openhab#9820 Related to openhab#9771 Signed-off-by: Christian Bandowski <[email protected]>
…#9849) Fixes openhab#9820 Related to openhab#9771 Signed-off-by: Christian Bandowski <[email protected]>
Expected Behavior
I want to setup a rule via ical that changes the mode of my Z-Wave device (Spirit Thermostatic Valve).
For this I have to send the mode 1 (= comfort mode) or 11 (= eco mode) to the device.
I would expect that setting up a calendar entry with these values 1 or 11 will change the mode of the device. But it doesn't.
Current Behavior
I setup a rule in my calendar, but the device doesn't change the mode.
I changed the log-level to TRACE and was able to see that the command will be send to the device as a
QuantityType
even though I just defined the item as aNumber
(without an extra unit of measurement).Meaning that I can see the rule is triggered and also uses the right value. In the openHAB app I also see the mode changes, but on the device itself nothing was done.
icalendar binding log:
event log:
z-wave log:
Calendar event description:
As you can see always the
QuantityType
will be used, but I would expect aDecimalType
.When I trigger a change via app I can see a
DecimalType
will be send to the device. So this is the only difference I was able to find that could lead to the issue that the device itself doesn't change.I am unsure if the z-wave binding should be capable of resolving a
QuantityType
to aDecimalType
if required or not.The strange thing is that I tried to reproduce this issue using JSR223 (Python) integration and trigger
sendCommand
with aQuantityType
... when I am doing this I could seeQuantityType
will be used forsendCommand
, but in the z-wave logs I see aDecimalType
will be used. So maybe there is already some kind of auto-conversion that will not be used within the icalendar binding.Possible Solution
Solution 1:
Enhance the
CommandTag
. In case the resolvedQuantityType
has a unit ofONE
convert it to aDecimalType
.Solution 2:
Before sending the event to the item in
ICalendarHandler
check if theNumber
item has a unit-of-measurement. If not convert theQuantityType
to aDecimalType
.Solution 3:
Do the conversion somewhere else, maybe outside of this binding at all?
Solution 4:
...?
Steps to Reproduce (for Bugs)
Number
itemCommand
type that will be send to this itemContext
Changing my z-wave thermostatic valve mode via calendar entries.
Your Environment
The text was updated successfully, but these errors were encountered: