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

[gree] binding does not allow target temperatures below 16°C #14207

Closed
thallaa opened this issue Jan 12, 2023 · 7 comments · Fixed by #14217
Closed

[gree] binding does not allow target temperatures below 16°C #14207

thallaa opened this issue Jan 12, 2023 · 7 comments · Fixed by #14217
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@thallaa
Copy link

thallaa commented Jan 12, 2023

I have a Nordic model Gree AC/heatpump that I'm using to heat my garage. It has a temperature range of 46°F to 86°F or 8°C to 30°C. As far as I can tell, the minimum has been hard coded to 16°C in GreeBindingConstants.java:

public static final int TEMP_MIN_C = 16;
public static final int TEMP_MIN_F = 61;

I am normally keeping the garage temperature at around 14°C but the binding does not allow this. Also, when trying to set the temperature below 16°C, the error reported in openhab.log is not very clear:

2023-01-12 13:00:01.541 [INFO ] [ng.gree.internal.handler.GreeHandler] - e890de98ab: Unable to load message for key message.command.invarg

Maybe the debug log would have pointed this out but I did not try that before I found the issue.

I did not find this reported before (this is not the same as the 8°C mode if I understand that one correctly).

@lsiepel
Copy link
Contributor

lsiepel commented Jan 12, 2023

Do you have some official documentation stating the min/ max values?

maybe it would be better to remove the range check in the binding and leave it to the user to set this at item level. But this may lead to situations that a temperature is set outside of the device capabilities. It would be interesting to see how the device responds to that.

@thallaa
Copy link
Author

thallaa commented Jan 12, 2023

I have checked the temperature range from the remote controller unit and from the mobile application. The best document I was able to find online was this brochure:
https://www.greenspirit.ee/download4u/gree/gree_eng/GREE-RAC-catalogue-2019-www.pdf
Page 17 mentions the range 8°C to 30°C.
The exact model I have is Gree Amber Nordic 35.

If this change get released, I am volunteering to try out how the device reacts.

@lsiepel
Copy link
Contributor

lsiepel commented Jan 12, 2023

3.4.1 version with the min temp value reduced from 16 to 5 celsius.
https://1drv.ms/u/s!AnMcxmvEeupwjqUKiNB08dZcB8xvlQ?e=kIimEH

Not a final fix, just to see what is happening if you try to set it below the treshold of 8. Could you enable debug logging and let me know what happens?

@lolodomo lolodomo added the bug An unexpected problem or unintended behavior of an add-on label Jan 13, 2023
@thallaa
Copy link
Author

thallaa commented Jan 13, 2023

I installed the snapshot and tested what happens if I set it below 8°C and it works just fine - the temperature stops at 8°C and simply seems to ignore values below that. The display on the unit itself shows 8° as does the iPhone app.

I do get some log entries but they do not seem to be related to this as I get the same entries for any temperature:

2023-01-13 18:20:32.039 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Issue command 6 °C to channe temperature
2023-01-13 18:20:32.039 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Handle command 6 °C for channel temperature, command class class org.openhab.core.library.types.QuantityType
2023-01-13 18:20:32.039 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 6.0°C to temp=6, halfStep=0, unit=C)
2023-01-13 18:20:32.047 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Response from device:
{"t":"res","mac":"502cxxxxxxxx","p":[0,6,0],"opt":["TemUn","SetTem","TemRec"],"r":200}
2023-01-13 18:20:32.047 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Exception
java.lang.IllegalArgumentException: SetTem,TemUn or TemRec is invalid, not performing conversion
        at org.openhab.binding.gree.internal.handler.GreeAirDevice.updateTempFtoC(GreeAirDevice.java:488) ~[?:?]
        at org.openhab.binding.gree.internal.handler.GreeAirDevice.getDeviceStatus(GreeAirDevice.java:142) ~[?:?]
        at org.openhab.binding.gree.internal.handler.GreeHandler.lambda$1(GreeHandler.java:369) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
2023-01-13 18:20:32.051 [INFO ] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Unable to perform auto-update: Exception while updating status,
JSON=org.openhab.binding.gree.internal.gson.GreeStatusResponsePackDTO@3afc7e63 (SetTem,TemUn or TemRec is invalid, not performing conversion)
2023-01-13 18:20:39.047 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Command 6 °C failed for channel temperature, retry
2023-01-13 18:20:39.048 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 6.0°C to temp=6, halfStep=0, unit=C)

But this same happens for any target temperature:

2023-01-13 18:43:24.170 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 16.0°C to temp=16, halfStep=0, unit=C)
2023-01-13 18:43:24.177 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Response from device: {"t":"res","mac":"502cxxxxxxxx","p":[0,16,0],"opt":["TemUn","SetTem","TemRec"],"r":200}
2023-01-13 18:43:24.178 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Exception
java.lang.IllegalArgumentException: SetTem,TemUn or TemRec is invalid, not performing conversion

I'm not sure if this is related at all but I see this happening quite often:

2023-01-13 18:26:07.486 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Unable to perform auto-update: I/O exception while updating status (Receive timed out)
2023-01-13 18:26:12.487 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Re-initialize device

After re-initialize it seems to work fine again until at some point this same repeats. This might be related to my slightly poor wifi connectivity in garage and as it seems to work fine anyway this is not really an issue for me. Do you think it would make sense to try increasing the network timeout?

I forgot to mention I am running OH 3.3.0-1 on Ubuntu 18.04.6, in case that makes a difference.

And thanks a lot for getting your hands on this, highly appreciated!

@lsiepel
Copy link
Contributor

lsiepel commented Jan 13, 2023

It seems there is a difference, or some log entries are missing.
2023-01-13 18:20:39.047 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Command 6 °C failed for channel temperature, retry

I don't see that for a valid value: 16 °C. So it would help to have a full set of debug entries that surround the command for a valid ande an invalid value.

If we have that we can be sure that it is either an existing bug, or it is a existing feauture that allready handles invalid values. Either way, it should not be needed to re-init the device due to lack of connection, i think it should auto-handle such cases, but i don;t know the binding that good and see that as an out of scope issue.

@thallaa
Copy link
Author

thallaa commented Jan 14, 2023

Ah, you're right, I did not read the log very carefully.

Here's the full log of a failed update of 7°C:

2023-01-14 10:33:04.874 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Issue command 7 °C to channe temperature
2023-01-14 10:33:04.874 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Handle command 7 °C for channel temperature, command class class org.openhab.core.library.types.QuantityType
2023-01-14 10:33:04.874 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 7.0°C to temp=7, halfStep=0, unit=C)
2023-01-14 10:33:04.874 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Command 7 °C failed for channel temperature, retry
2023-01-14 10:33:04.874 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 7.0°C to temp=7, halfStep=0, unit=C)
2023-01-14 10:33:04.874 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Command 7 °C failed for channel temperature, retry
2023-01-14 10:33:04.875 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 7.0°C to temp=7, halfStep=0, unit=C)
2023-01-14 10:33:04.875 [INFO ] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: message.Unable to execute command 7 for channel temperature: Device is not bound!
2023-01-14 10:33:10.405 [INFO ] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Thing initialization failed: Unable to bind to device
2023-01-14 10:33:15.406 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Re-initialize device
2023-01-14 10:33:15.406 [DEBUG] [.internal.discovery.GreeDeviceFinder] - Sending scan packet to 192.168.x.x
2023-01-14 10:33:15.411 [DEBUG] [.internal.discovery.GreeDeviceFinder] - Response received from address 192.168.0.219: {"t":"dev","cid":"","bc":"gree","brand":"gree","catalog":"gree","mac":"502cxxxxxxxx","mid":"10001","model":"gree","name":"","lock":0,"series":"gree","vender":"1","ver":"V3.0.0"}
2023-01-14 10:33:15.412 [DEBUG] [.internal.discovery.GreeDeviceFinder] - Discovered device at 192.168.x.x:7000
2023-01-14 10:33:29.426 [INFO ] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Thing initialization failed: Unable to bind to device
2023-01-14 10:33:34.426 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Re-initialize device
2023-01-14 10:33:34.427 [DEBUG] [.internal.discovery.GreeDeviceFinder] - Sending scan packet to 192.168.x.x  
2023-01-14 10:33:34.434 [DEBUG] [.internal.discovery.GreeDeviceFinder] - Response received from address 192.168.x.x: {"t":"dev","cid":"","bc":"gree","brand":"gree","catalog":"gree","mac":"502cxxxxxxxx","mid":"10001","model":"gree","name":"","lock":0,"series":"gree","vender
":"1","ver":"V3.0.0"}
2023-01-14 10:33:34.435 [DEBUG] [.internal.discovery.GreeDeviceFinder] - Discovered device at 192.168.x.x:7000
2023-01-14 10:33:46.459 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Response from device: {"t":"dat","uid":0,"mac":"502cxxxxxxxx","cid":"502cxxxxxxxx","dat":[1,4,8,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,53],"cols":["Pow","Mod","SetTem","WdSpd","Air","Blo","Health","SwhSlp","Lig","SwingLfRig","SwUpDn","Quiet","Tur","TemUn","StHt","HeatCoolType","TemRec","SvSt","NoiseSet","TemSen"],"r":200}
2023-01-14 10:33:46.460 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Executing automatic update of values
2023-01-14 10:33:46.460 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Updating channel power : ON
2023-01-14 10:33:46.461 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Updading mode channel with 4/heat
2023-01-14 10:33:46.461 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Updating channel mode : heat
2023-01-14 10:33:46.462 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Updating channel temperature : 8 °C
...

And here's s valid update with 9°C:

2023-01-14 10:18:56.334 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Issue command 9 °C to channe temperature
2023-01-14 10:18:56.334 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Handle command 9 °C for channel temperature, command class class org.openhab.core.library.types.QuantityType
2023-01-14 10:18:56.334 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 9.0°C to temp=9, halfStep=0, unit=C)
2023-01-14 10:19:00.873 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Response from device:
{"t":"dat","uid":0,"mac":"502cxxxxxxxx","cid":"502cxxxxxxxx","dat":[1,4,9,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,53],"cols":["Pow","Mod","SetTem","WdSpd","Air","Blo","Health","SwhSlp","Lig","SwingLfRig","SwUpDn","Quiet","Tur","TemUn","StHt","HeatCoolType","TemRec","SvSt","NoiseSet","TemSen"],"r":200}
2023-01-14 10:19:00.874 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Executing automatic update of values
2023-01-14 10:19:00.875 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Updating channel temperature : 9 °C
2023-01-14 10:19:05.920 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Response from device:
{"t":"dat","uid":0,"mac":"502cxxxxxxxx","cid":"502cxxxxxxxx","dat":[1,4,9,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,53],"cols":["Pow","Mod","SetTem","WdSpd","Air","Blo","Health","SwhSlp","Lig","SwingLfRig","SwUpDn","Quiet","Tur","TemUn","StHt","HeatCoolType","TemRec","SvSt","NoiseSet","TemSen"],"r":200}

Now that I'm trying this repeatedly, I am starting to suspect the above error related to 7°C update might be more likely related to networking issues since I also got this for an update of 7°C:

2023-01-14 10:53:11.002 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Issue command 7 °C to channe temperature
2023-01-14 10:53:11.002 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Handle command 7 °C for channel temperature, command class class org.openhab.core.library.types.QuantityType
2023-01-14 10:53:11.003 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Converted temp from 7.0°C to temp=7, halfStep=0, unit=C)
2023-01-14 10:53:15.977 [DEBUG] [.gree.internal.handler.GreeAirDevice] - Response from device: 
{"t":"dat","uid":0,"mac":"502cxxxxxxxx","cid":"502cxxxxxxxx","dat":[1,4,8,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,52],"cols":["Pow","Mod","SetTem","WdSpd","Air","Blo","Health","SwhSlp","Lig","SwingLfRig","SwUpDn","Quiet","Tur","TemUn","StHt","HeatCoolType","TemRec","SvSt","NoiseSet","TemSen"],"r":200}
2023-01-14 10:53:15.977 [DEBUG] [ng.gree.internal.handler.GreeHandler] - 502cxxxxxxxx: Executing automatic update of values

Which seems like the device just silently ignores the invalid value?

The re-init does happen automatically and I did not even know about it before enabling the debug logging so I guess it works fine.

If I look at all of this from logs alone, everything seems to run smoothly. My slightly unstable wifi is probably causing these random hickups but the binding seems to handle everything fine. The only thing that comes to my mind is that perhaps there could be a retry mechanism for sending the update again after re-init in case the connection dies in the middle of an update? But that's also a separate issue.

@lsiepel
Copy link
Contributor

lsiepel commented Jan 14, 2023

Thanks for testing. The re-init logic is not related and not something i can improve easily without having actual devices, so i have to leave that for someone else. Atleast the temp range issue has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants