haywirecoder / homebridge-flobymoen

Homebridge Module for Flo by Moen Smart Water System
MIT License
15 stars 2 forks source link

Trying to use the additional switch - getting a 403 error #19

Closed rtkane1015 closed 1 month ago

rtkane1015 commented 1 month ago

I'm attempting to use the additional switch in an HK automation to turn off the Flo valve when a water sensor triggers. When de-activating the switch, I get a line saying "Error: Request failed with status code 403". I sometimes also get a "Flo System Mode: Another Plug-in process is already updating the Flo system" followed by the 403 message (though I have not been able to reproduce this for this support request submission).

Logs:

[9/12/2024, 3:52:56 PM] [Flo by Moen] Error: Request failed with status code 403

Plugin Config:

{
    "name": "Flo by Moen",
    "auth": {
        "username": "XXXXX",
        "password": "XXXXX"
    },
    "disableCache": false,
    "showTemperatureAndHumidity": false,
    "enableValveControl": true,
    "showHealthTestSwitch": false,
    "showAuxSwitch": true,
    "treatWarningAsCritical": true,
    "clearOnNoLeak": false,
    "deviceRefresh": 100,
    "offlineTimeLimit": 4,
    "sleepRevertMinutes": 120,
    "retryErrorDisplay": 3,
    "showFloTemperature": false,
    "showGPMPSIasLight": false,
    "_bridge": {
        "username": "XX:XX:XX:XX:XX:XX"
    },
    "platform": "Flo-by-Moen"
}

Screenshots:

Environment:

rtkane1015 commented 1 month ago

Thank you in advance for your help.

haywirecoder commented 1 month ago

Hi,

Could you let me know if you can control the valve using the valve control in Apple Home?

In addition:

  1. Confirm you can control the valve using the Flo web portal (https://user.meetflo.com/)
  2. Turn on debug and post the results when you attempt to control Flo's smart water device.
rtkane1015 commented 1 month ago

Hi... yes, I can control it no problem via the valve control and the Flo web portal (and just to confirm we're talking about the same thing, i'm including a screenshot of the valve I'm using to control it in HomeKit--the one on the right):

Screenshot 2024-09-13 at 10 41 58 PM

And the debug mode isn't really giving any additional info (included the couple of items around it so you could see it's in debug). There's no other messaging coming up related to Flo:

[9/13/2024, 10:39:30 PM] [Rachio 3] Getting Valve
[9/13/2024, 10:39:31 PM] [Rachio 3] 1683 API calls remaining
[9/13/2024, 10:39:32 PM] [Flo by Moen] Error: Request failed with status code 403
[9/13/2024, 10:39:32 PM] [TP-Link .API] client.sendDiscovery(255.255.255.255, [], 3)
[9/13/2024, 10:39:32 PM] [TP-Link .API] client.startDiscovery(): socket:message From: 192.168.7.139 9999 Message: {"system":{"g

Thank you for your help.

haywirecoder commented 1 month ago

Hi,

I believe I found the issue. I have uploaded the fix in flomain.js and optionSwitch.js, but haven't had the chance to confirm that it hasn't broken something else... but you are welcome to try new files. The final correction will be included in the next release.

rtkane1015 commented 1 month ago

Thanks for the fix. I'm not 100% sure how to swap in individual files, so I'll wait for the next release. It didn't seem to work for me, just moving them into the directory and replacing what was there (it was throwing a bunch of errors, so I'm assuming I did something wrong). I really appreciate your help with this!

haywirecoder commented 1 month ago

A new version has been released with the fixes noted.

rtkane1015 commented 1 month ago

Great! This worked--thanks again for fixing this!