kiwi-cam / homebridge-broadlink-rm

[This fork supports TV accessories] Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
304 stars 96 forks source link

IR Fan Scenes do not run as expected - No pause between devices #693

Open JasonGoldenDDT opened 6 months ago

JasonGoldenDDT commented 6 months ago

Describe the bug I am using this plug in to control several fans through out my home with 3 RM mini 3 IR transmitters. This plugin works well for the most part, however it fails to property apply scenes.

I have a Dyson AM09 and a generic tower fan in my living room. I've created a scene that defines the speed of each fan and turns on their swing mode.

Unfortunately the Dyson AM09 does not power on and the floor fan doesn't active swing mode after successfully turning on and changing to the correct speed.

This is what it looks like when the scene is triggered.

[4/17/2024, 11:20:52 AM] [Broadlink RM] Tower Fan setSwitchState: 1 [4/17/2024, 11:20:52 AM] [Broadlink RM] Tower Fan setFanSpeed: 66 [4/17/2024, 11:20:52 AM] [Broadlink RM] Tower Fan setFanSpeed: (closest: 66) [4/17/2024, 11:20:52 AM] [Broadlink RM] Tower Fan setSwingMode: 1 [4/17/2024, 11:20:52 AM] [Broadlink RM] Tower Fan sendHex (10.0.145.64; e8:16:56:70:4c:46) 2600500000012f97131311141213121312381138121312141138123712381138111412131237123712131214123712371213121312141138123712371213121312381237123712131200051400012a4a12000d05000000000000 [4/17/2024, 11:20:52 AM] [Broadlink RM] Tower Fan sendHex (10.0.145.64; e8:16:56:70:4c:46) 260058000001249413121213121312141138123712131213123712371237123712131214113811381213121312131237121411141213123712381237123712141138123712371213120005140001294a12000c3f0001294a12000d050000000000000000000000000000 [4/17/2024, 11:20:52 AM] [Broadlink RM] Tower Fan sendHex (10.0.145.64; e8:16:56:70:4c:46) 2600500000012594121312141213121312371238121313121238113812371336121412131237123811141213123712381237121312141138133612371313111412131238113812131300051400012a4a13000d05000000000000

Generic Tower Fan Config "name": "Tower Fan", "type": "fan", "host": "xxx", "alwaysResetToDefaults": true, "defaultSpeedStep": 1, "persistState": true, "speedCycle": true, "resendHexAfterReload": false, "speedSteps": 3, "allowResend": false, "hideRotationDirection": true, "data": { "on": [ { "data": "2600500000012f97131311141213121312381138121312141138123712381138111412131237123712131214123712371213121312141138123712371213121312381237123712131200051400012a4a12000d05000000000000", "pause": 1 } ], "off": [ { "data": "260050000001259413121213121411141237123712131214113812371237123712141114123712371213121411381237121312131214123712371237121411141138123712371213120005160001284a12000d05000000000000", "pause": 1.5 } ], "swingToggle": [ { "data": "2600500000012594121312141213121312371238121313121238113812371336121412131237123811141213123712381237121312141138133612371313111412131238113812131300051400012a4a13000d05000000000000", "interval": 1.5 } ], "fanSpeed": "260058000001249413121213121312141138123712131213123712371237123712131214113811381213121312131237121411141213123712381237123712141138123712371213120005140001294a12000c3f0001294a12000d050000000000000000000000000000" } },

Dyson Fan Config Sample "name": "Desk Fan", "type": "fan", "host": "e8:16:56:70:4c:46", "alwaysResetToDefaults": false, "persistState": true, "resendHexAfterReload": false, "allowResend": false, "hideRotationDirection": false, "data": { "on": [ { "data": "26004800421919181719172f192d191717191719171a19181818191818181817192d192c19000caf46171a171918192d172e181819171917191819181917191818181917182d182d18000d050000000000000000000000000000", "pause": 1.5 } ], "off": [ { "data": "26004800441818191818182e182e1818181818181819181918181818181918181718181818000cd8481918181819182e182e1818181718181819181918191818181818181818181718000d050000000000000000000000000000", "pause": 1.5 } ], "swingToggle": [ { "data": "26002400441818191818182e182e181818181817181a1818182f172f18181818162f182d18000d050000", "pause": 1.5 } ], "clockwise": [ { "data": "26002400441819171918192d172e1917191719171918192d18191917192d18181917192c18000d050000", "pause": 1.5 } ], "counterClockwise": [ { "data": "26004800431a171a161a172f172f1719171817191730171a172f172f1719172f172e171917000cf5461a1719171a172f172f1719171817191730171a172f172f1719172f172e171917000d050000000000000000000000000000", "pause": 1.5 } ], "fanSpeed10": [ { "data": "26004800431919181917192d182e181819171916192e182f172f192d182e182d1818181819000cd7471919171819182e172e181818181818182f182e182e182e182e182e1818181718000d050000000000000000000000000000", "sendCount": 10, "interval": 0.5 } ], "fanSpeed20": [ { "data": "26004800431919181917192d182e181819171916192e182f172f192d182e182d1818181819000cd7471919171819182e172e181818181818182f182e182e182e182e182e1818181718000d050000000000000000000000000000", "sendCount": 10, "interval": 0.5, "pause": 0.5 },

Observations

The plugin does not offer a "defaultSwingMode" option. This means the fans swing mode remains on even if the "alwaysResetToDefaults" is set to "true." This should include the swingMode.

There may not be enough time between IR commands sent to two different devices. I understand some IR devices will "mute" their receiver when an incompatible IR signal is detected, like the IR code of a different brand of fan.

It is unclear if the "pause" is considered between different commands to the same device, the log never shows the hex code to change the swing status unless I manual trigger it in HomeKit.

To Reproduce

  1. Configure tow fans of different brands. Brand one returns all settings to default when powered off. Brand two defaults all settings except speed when powered off.
  2. Create a scene that powers the fans on, sets their speed, and enables their swing mode.
  3. Create a scene that powers off the fans.
  4. Toggle between scenes.

Expected behavior The fans should both power on, set their speed, and enable swing mode.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

An ideal resolution would accomplish the following:

  1. Add option to "defaultSwingMode"
  2. Add option to add "mix device wait period" - a duration the code will wait before sending a command to a different device from the same host.
JasonGoldenDDT commented 2 months ago

This means an issue, scenes do not accurately recall device settings like ocillation.

Additionally, if multiple IR devices are triggered by a scene there isn't a sufficient delay between different devices to avoid issues. For example, if I have a fan turn on and call for the AC to turn on... the AC will ignore Fan IR commands for a period of time, but the plug in will send the IR commands to quickly and the AC won't see them...

The harmony report I had awhile back had an "inter device" delay option you could set so it would wait before sending commands to a different device type or brand.

Can that be added to this plug in?

JasonGoldenDDT commented 2 months ago

This continues to be a challenge. Scene like this one, where I have two devices on the same RM IR transmitter of different brands don't work consistently.

When this scene fires the code for only one device is sent/picked up.

Please let me know what context I can provide to assist in resolving this. It limits the usefulness of the plugin. Ideally the plug-in includes a delay between devices commands from the same IR transmitter.

Screenshot 2024-09-04 at 8 30 40 AM