lprhodes / homebridge-broadlink-rm

Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
571 stars 284 forks source link

Unable to switch off AC by scene #357

Open sweetw0r opened 6 years ago

sweetw0r commented 6 years ago

It’s working fine via a switch but if that same switch is part of any scene it doesn’t switch. Two HEXs being sent. First "off", second "heat"

Apr 12 19:21:36 raspberrypi homebridge[299]: [2018-4-12 19:21:36] [Broadlink RM] AC sendHex (⑄⑄.⑄.⑄.⑄⑄⑄; ⑄⑄:⑄⑄:⑄⑄:⑄⑄:⑄⑄:⑄⑄) 26006c01a6460d3a0d170c170...160e160d160e390e000d05000000000000000000000000
Apr 12 19:21:36 raspberrypi homebridge[299]: [2018-4-12 19:21:36] [Broadlink RM] AC sendTemperature (set mode to heat
Apr 12 19:21:36 raspberrypi homebridge[299]: [2018-4-12 19:21:36] [Broadlink RM] AC getCurrentHeatingCoolingState: 1
Apr 12 19:21:36 raspberrypi homebridge[299]: [2018-4-12 19:21:36] [Broadlink RM] AC getTargetHeatingCoolingState: 1
Apr 12 19:21:36 raspberrypi homebridge[299]: [2018-4-12 19:21:36] [Broadlink RM] AC sendTemperature (32
Apr 12 19:21:36 raspberrypi homebridge[299]: [2018-4-12 19:21:36] [Broadlink RM] AC sendHex (⑄⑄.⑄.⑄.⑄⑄⑄; ⑄⑄:⑄⑄:⑄⑄:⑄⑄:⑄⑄:⑄⑄) 26006c01a5470c3b0c171015091...70c180b180c3b0c000d05000000000000000000000000

My config:

{
    "platform":"BroadlinkRM",
    "name":"Broadlink RM",
    "hideScanFrequencyButton":true,
    "hideLearnButton":false,
    "hideWelcomeMessage":false,
    "accessories":[
        {
            "name":"AC",
            "type":"air-conditioner",
            "temperatureDisplayUnits":"F",
            "maxTemperature":32,
            "defaultHeatTemperature":32,
            "minTemperature":10,
            "replaceAutoMode":"heat",
            "turnOnWhenOff":true,
            "data":{
                "off":"26006c01a6460d3a0d170c170...",
                "temperature32":{
                    "pseudo-mode":"heat",
                    "data":"26006c01a5470c3b0c171015091..."
                },
                "temperature16":{
                    "pseudo-mode":"cool",
                    "data":"26006c01a646..."
                },
                "on":"26006c01a5470c3b0c171015091..."
            }
        }
    ]
}
sweetw0r commented 6 years ago

I think I might messed up the accessory config...

cubilon commented 6 years ago

"turnOnWhenOff":true, goes on the main part of the accessory definition. "homebridgeDirectory" is no longer needed.

sweetw0r commented 6 years ago

Updated the config and issue description. Although it didn't solve it. Off by a scene send 'off' and right after it 'heat' HEX

cubilon commented 6 years ago

I think it's something related with

"defaultHeatTemperature":32 "replaceAutoMode":"heat"

try removing them, just for a test.

sweetw0r commented 6 years ago

Removing those gave an AssertionError when turning on:

Apr 13 20:17:00 raspberrypi homebridge[350]: [2018-4-13 20:17:00] [Broadlink RM] AC getTargetHeatingCoolingState: 1
Apr 13 20:17:00 raspberrypi homebridge[350]: (node:350) UnhandledPromiseRejectionWarning: AssertionError: #033[31m[CONFIG ERROR] #033[0m You need to provide a hex code for the following temperature:
Apr 13 20:17:00 raspberrypi homebridge[350]:         #033[33m{ "temperature30": { "data": "HEXCODE", "pseudo-mode" : "heat/cool" } }#033[0m
Apr 13 20:17:00 raspberrypi homebridge[350]:         or provide the default temperature:
Apr 13 20:17:00 raspberrypi homebridge[350]:         #033[33m { "temperature30": { "data": "HEXCODE", "pseudo-mode" : "heat/cool" } }#033[0m
Apr 13 20:17:00 raspberrypi homebridge[350]:     at AirConAccessory.getTemperatureHexData (/usr/lib/node_modules/homebridge-broadlink-rm/accessories/aircon.js:300:7)
Apr 13 20:17:00 raspberrypi homebridge[350]:     at AirConAccessory.sendTemperature (/usr/lib/node_modules/homebridge-broadlink-rm/accessories/aircon.js:237:48)
Apr 13 20:17:00 raspberrypi homebridge[350]:     at <anonymous>:null:null
Apr 13 20:17:00 raspberrypi homebridge[350]: (node:350) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Apr 13 20:17:00 raspberrypi homebridge[350]: (node:350) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Turning off doesn't have errors but the bug is still there.

sweetw0r commented 6 years ago

I moved slider in the scene setting but left AC in mode "off" and got that same AssertionError:

Apr 13 20:22:16 raspberrypi homebridge[350]: [2018-4-13 20:22:16] [Broadlink RM] AC sendHex (10.0.0.232; 34:ea:34:51:2d:98) 26006c01a6460d3a0d170c170...160e160d160e390e000d05000000000000000000000000
Apr 13 20:22:16 raspberrypi homebridge[350]: [2018-4-13 20:22:16] [Broadlink RM] AC setCurrentHeatingCoolingState: 0
Apr 13 20:22:16 raspberrypi homebridge[350]: (node:350) UnhandledPromiseRejectionWarning: AssertionError: #033[31m[CONFIG ERROR] #033[0m You need to provide a hex code for the following temperature:
Apr 13 20:22:16 raspberrypi homebridge[350]:         #033[33m{ "temperature23": { "data": "HEXCODE", "pseudo-mode" : "heat/cool" } }#033[0m
Apr 13 20:22:16 raspberrypi homebridge[350]:         or provide the default temperature:
Apr 13 20:22:16 raspberrypi homebridge[350]:         #033[33m { "temperature30": { "data": "HEXCODE", "pseudo-mode" : "heat/cool" } }#033[0m
Apr 13 20:22:16 raspberrypi homebridge[350]:     at AirConAccessory.getTemperatureHexData (/usr/lib/node_modules/homebridge-broadlink-rm/accessories/aircon.js:300:7)
Apr 13 20:22:16 raspberrypi homebridge[350]:     at AirConAccessory.sendTemperature (/usr/lib/node_modules/homebridge-broadlink-rm/accessories/aircon.js:237:48)
Apr 13 20:22:16 raspberrypi homebridge[350]:     at <anonymous>:null:null

And I have realized it sends off HEX first and then it tries to set a temperature of off AC to whatever is on that slider for some unknown reason. How to disable that? Am I the only one who is experiencing this with a scene?

sweetw0r commented 6 years ago

I ran into this because I had "off" mode and 90℉ slider level in the scene setting which is correlated to "temperature32" in my config and "defaultHeatTemperature":32 A workaround for this would be to lower slider to 89℉ in the scene setting and not having a "temperature31" HEX configured and get rid off "defaultHeatTemperature":32 That way it will keep throwing an AssertionError but the AC will stay off!

cubilon commented 6 years ago

I really am out of options. just @lprhodes can help, I think.

kiwi-cam commented 6 years ago

I realise this is old, but I've just had the same issue. Fortunately, I was able to reverse recent changes and work out when it happened. My recent change was removing this line from my AC's config: "ignoreTemperatureWhenOff": true

I've just put this line back in my config.json, and it appears to be working now.

dudusandi commented 6 years ago

I have the same problem

kuba1975 commented 6 years ago

I had the same issue - apparently this cannot be done on Home app. However you can setup the scene with OFF command by using 3rd party apps - such as EVE. It's free, it does not want you to set up another account - it just uses your current HomeKit environment. Hope it helps!

kalleboo commented 5 years ago

@kiwi-cam Thanks, that option fixed the issue for me!

dvcrn commented 5 years ago

I have the same issue. @kiwi-cam's solution worked for me as well

calvinyeap commented 4 years ago

I realise this is old, but I've just had the same issue. Fortunately, I was able to reverse recent changes and work out when it happened. My recent change was removing this line from my AC's config: "ignoreTemperatureWhenOff": true

I've just put this line back in my config.json, and it appears to be working now.

This works perfectly for me!! Thank you so much, been wanting to do this for the longest time!!