jhschuster / homebridge-lacrosseweb

Homebridge plugin for Lacrosse Alerts Mobile devices
MIT License
0 stars 2 forks source link

Still Getting Issue #7

Open jbk1988 opened 3 years ago

jbk1988 commented 3 years ago

I checked my username and password, they are correct.

4/9/2021, 11:26:35 AM [LacrosseWeb] Didn't get a session key. Giving up. 4/9/2021, 11:26:35 AM [LacrosseWeb] { result: 'fail' }

jhschuster commented 3 years ago

Are you running the latest version (1.0.12)? If so, can you send me a snippet of your config.json with the username and password redacted?

jbk1988 commented 3 years ago

{ "platform": "LacrosseWeb", "plugin_map": { "plugin_name": "homebridge-lacrosseweb" }, "apiBaseURL": "https://lacrossealertsmobile.com/v1.2", "configCacheSeconds": 960, "noResponseMinutes": 30, "allowBadSSL": true, "username": "xxx", "password": "xxx" }

jbk1988 commented 3 years ago

And in the logs...

Back

Change Timezone

Do not update my WeatherStations with The Selected Timezone

Back

Change Reading


Back

Change Password


min 6 characters, max 15


La Crosse, US

Clouds

get at 2015.04.17 15:46

Wind
Cloudiness
Pressure
Humidity
Sunrise
Sunset
Geo coords[ -91.24, 43.8 ]
Click for weather

Terms of Use

Back

Terms of Use

Privacy Policy

Back

Privacy Policy

???

???

Yes No
Back

Password Recovery

Please enter your email or username


Back

Test Page

    </body>

4/9/2021, 4:27:09 PM [LacrosseWeb] Malformed config, skipping.

jhschuster commented 3 years ago

Since the log contained HTML, you need to enclose it in backquotes for GitHub to format it as code instead of as HTML. But, more interesting for me, is that your config.json has plugin_map? That isn't anything I use, so I imagine it's an artifact of the plugin manager you use? Are you not using homebridge-config-ui-x v4.41.0?

Try slimming your config.json down to:

{ "platform": "LacrosseWeb", "plugin_map": { "plugin_name": "homebridge-lacrosseweb" }, "username": "xxx", "password": "xxx" }

Although that shouldn't make any difference, because the other values are the defaults. Without posting all the HTML returned, what are the log messages you see?

Here's what I get after a restart:

[4/9/2021, 7:36:08 PM] --- [4/9/2021, 7:36:09 PM] Loaded plugin: homebridge-lacrosseweb@1.0.12 [4/9/2021, 7:36:09 PM] Registering platform 'homebridge-lacrosseweb.LacrosseWeb' [4/9/2021, 7:36:09 PM] --- ... [4/9/2021, 7:36:13 PM] [LacrosseWeb] Initializing LacrosseWeb platform... [4/9/2021, 7:36:13 PM] [LacrosseWeb] LacrosseWeb(log, config) called. [4/9/2021, 7:36:13 PM] [LacrosseWeb] LacrosseWeb.accessories(callback) called. [4/9/2021, 7:36:13 PM] [LacrosseWeb] LacrosseWeb.getConfig() called. [4/9/2021, 7:36:13 PM] [LacrosseWeb] LacrosseWeb.doLogin() called. [4/9/2021, 7:36:14 PM] [LacrosseWeb] GET /login OK [4/9/2021, 7:36:15 PM] [LacrosseWeb] LacrosseWeb.getStatus() called. [4/9/2021, 7:36:17 PM] [LacrosseWeb] GET / OK [4/9/2021, 7:36:17 PM] [LacrosseWeb] getConfig: [4/9/2021, 7:36:17 PM] [LacrosseWeb] [ ... JSON ... [4/9/2021, 7:36:17 PM] [LacrosseWeb] Added "Basement" - Device ID: xxx. [4/9/2021, 7:36:17 PM] [LacrosseWeb] Added "Garage" - Device ID: xxx. [4/9/2021, 7:36:17 PM] [LacrosseWeb] Setting up accessories/devices... [4/9/2021, 7:36:17 PM] Initializing platform accessory 'Basement'... [4/9/2021, 7:36:17 PM] Initializing platform accessory 'Garage'... [4/9/2021, 7:36:20 PM] [LacrosseWeb] Basement: ambientTemp: Using cached data; less than 960s old. [4/9/2021, 7:36:20 PM] [LacrosseWeb] Basement: lowBatt ambientTemp: Using cached data; less than 960s old. [4/9/2021, 7:36:20 PM] [LacrosseWeb] Basement: currentRH: Using cached data; less than 960s old. [4/9/2021, 7:36:20 PM] [LacrosseWeb] Basement: lowBatt currentRH: Using cached data; less than 960s old. [4/9/2021, 7:36:20 PM] [LacrosseWeb] Garage: ambientTemp: Using cached data; less than 960s old. [4/9/2021, 7:36:20 PM] [LacrosseWeb] Garage: lowBatt ambientTemp: Using cached data; less than 960s old. [4/9/2021, 7:36:20 PM] [LacrosseWeb] Garage: currentRH: Using cached data; less than 960s old. [4/9/2021, 7:36:20 PM] [LacrosseWeb] Garage: lowBatt currentRH: Using cached data; less than 960s old.

Where does yours start to differ?

jbk1988 commented 3 years ago

I’m on HOOBS, the latest version. It has previously worked fine, so I wonder if that has something to do with it?

jhschuster commented 3 years ago

I don't know. I don't use HOOBS. I still am curious as to what you're seeing in your logs when homebridge starts up.

jbk1988 commented 3 years ago

Before inserting my username / password:

4/12/2021, 3:26:24 PM Plugin "homebridge-lacrosseweb" installed. 4/12/2021, 3:26:25 PM Got SIGINT, shutting down Bridge... 4/12/2021, 3:26:25 PM [DeebotEcovacs] INFO - shutdown 4/12/2021, 3:26:25 PM [DeebotEcovacs] INFO - shutdown 4/12/2021, 3:26:31 PM Initializing HAP-NodeJS v0.9.3... 4/12/2021, 3:26:31 PM Loaded plugin 'homebridge-accessory-bandwidth-quality' 4/12/2021, 3:26:31 PM [4/12/2021, 4:26:31 PM] Registering accessory 'homebridge-accessory-bandwidth-quality.bandwidth-quality' 4/12/2021, 3:26:31 PM Loaded plugin 'homebridge-deebotecovacs' 4/12/2021, 3:26:31 PM [4/12/2021, 4:26:31 PM] Registering platform 'homebridge-deebotecovacs.DeebotEcovacs' 4/12/2021, 3:26:31 PM Loaded plugin 'homebridge-doorbird' 4/12/2021, 3:26:31 PM [4/12/2021, 4:26:31 PM] Registering platform 'homebridge-doorbird.Doorbird' 4/12/2021, 3:26:32 PM Loaded plugin 'homebridge-dyson-pure-cool' 4/12/2021, 3:26:32 PM [4/12/2021, 4:26:32 PM] Registering platform 'homebridge-dyson-pure-cool.DysonPureCoolPlatform' 4/12/2021, 3:26:32 PM Loaded plugin 'homebridge-lacrosseweb' 4/12/2021, 3:26:32 PM [4/12/2021, 4:26:32 PM] Registering platform 'homebridge-lacrosseweb.LacrosseWeb' 4/12/2021, 3:26:32 PM [4/12/2021, 4:26:32 PM] The plugin "homebridge-switchbot-openapi" requires Node.js version of >=14.16.0 which does not satisfy the current Node.js version of v12.16.3. You may need to upgrade your installation of Node.js - see https://git.io/JTKEF 4/12/2021, 3:26:32 PM Loaded plugin 'homebridge-switchbot-openapi' 4/12/2021, 3:26:32 PM Loading 5 platforms... 4/12/2021, 3:26:32 PM [4/12/2021, 4:26:32 PM] Registering platform 'homebridge-switchbot-openapi.SwitchBot' 4/12/2021, 3:26:32 PM [DysonPureCoolPlatform] Initializing DysonPureCoolPlatform platform... 4/12/2021, 3:26:32 PM [Courtyard Gate] Initializing Doorbird platform... 4/12/2021, 3:26:32 PM [SwitchBot] Initializing SwitchBot platform... 4/12/2021, 3:26:32 PM [SwitchBot] Using Default Refresh Rate. 4/12/2021, 3:26:32 PM [SwitchBot] Using Default Push Rate. 4/12/2021, 3:26:32 PM [DeebotEcovacs] Initializing DeebotEcovacs platform... 4/12/2021, 3:26:32 PM [DeebotEcovacs] INFO - API :NA/US 4/12/2021, 3:26:32 PM [LacrosseWeb] Initializing LacrosseWeb platform... 4/12/2021, 3:26:32 PM [SwitchBot] Loading accessory from cache: Living Room Left Curtain Curtain 4/12/2021, 3:26:32 PM [SwitchBot] Loading accessory from cache: Living Room Right Curtain Curtain 4/12/2021, 3:26:32 PM [DysonPureCoolPlatform] Device credentials not stored, asking Dyson API. If you want to prevent communication with the Dyson API, copy the credentials for each device from the coming log entries to the config.json. 4/12/2021, 3:26:32 PM [DysonPureCoolPlatform] Checking user account. 4/12/2021, 3:26:32 PM [DeebotEcovacs] DidFinishLaunching 4/12/2021, 3:26:32 PM [Courtyard Gate] Front Gate: Detected relay: 1 (primary). 4/12/2021, 3:26:32 PM [Courtyard Gate] Front Gate: Detected relay: 2. 4/12/2021, 3:26:32 PM [Courtyard Gate] Front Gate: Connected to the Doorbird events API. 4/12/2021, 3:26:33 PM [LacrosseWeb] Didn't get a session key. Giving up. 4/12/2021, 3:26:33 PM [LacrosseWeb] { result: 'fail' } 4/12/2021, 3:26:33 PM [LacrosseWeb] Malformed config, skipping. 4/12/2021, 3:26:33 PM [SwitchBot] Total SwitchBot Devices Found: 3 4/12/2021, 3:26:33 PM [SwitchBot] Total IR Devices Found: 0 4/12/2021, 3:26:33 PM [SwitchBot] Restoring existing accessory from cache: Living Room Left Curtain Curtain DeviceID: D7C42A3163C2 4/12/2021, 3:26:33 PM [SwitchBot] Restoring existing accessory from cache: Living Room Right Curtain Curtain DeviceID: FF06A0091244 4/12/2021, 3:26:33 PM [DysonPureCoolPlatform] Checked user account. 4/12/2021, 3:26:33 PM [DysonPureCoolPlatform] Signing in. 4/12/2021, 3:26:34 PM [DeebotEcovacs] INFO - stopping deebots discovery, number of deebots found : 1 4/12/2021, 3:26:34 PM [DeebotEcovacs] INFO - Discovered Deebot : 4/12/2021, 3:26:34 PM [DeebotEcovacs] INFO - Edge Cleaning for : false 4/12/2021, 3:26:34 PM [DeebotEcovacs] INFO - Spot Cleaning for : false 4/12/2021, 3:26:34 PM [DeebotEcovacs] INFO - SpotArea Cleaning for : true 4/12/2021, 3:26:34 PM [DeebotEcovacs] INFO - CustomArea Cleaning for : true 4/12/2021, 3:26:34 PM [DysonPureCoolPlatform] Error while signing in. Status Code: 401 4/12/2021, 3:26:34 PM [DysonPureCoolPlatform] API could not be reached. Retry is disabled.

After:

``` 4/12/2021, 3:28:10 PM [LacrosseWeb] getConfig: matching FAILED 4/12/2021, 3:28:10 PM [LacrosseWeb] <!DOCTYPE html>

Devices - La Crosse Alerts

Devices

Logout
Devices

Hot Tub Temperature

Logout
Last Seen:
Link Quality:
Battery:
Devices

Hot Tub Temperature

Logout
Last 24 Hours
Devices

Device Settings

Logout
  • Device Name: Hot Tub Temperature
  • Model: TX60
  • Serial: 0001D2278EC419D5
  • Associated Gateway ID: 00514893
  • Gateway Last Seen: Gateway Not Found
  • Enhanced Features / Alerts Expiration Date: Jun 23rd 2021

Change Sensor Interval

Current Interval: 15 mins

Change Sensor Name


Manage Not seen/Low Battery Alerts


Delete Sensor

Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert



These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert



These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


If Humidity (19 to 99%)...


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Alert Name: Hot Tub Temperature - Alert


These alerts will alert to:


Click here to view current text and email defaults.



Back

Edit Alert

Low Battery Alerts for this device will send to:


Not Seen Alerts for this device will send to:


Minimum time Not Seen before Alert is sent (Will always be at least double the Devices Interval)


Click here to view current text and email defaults.


Register

Home

Gateway Registration

-- Your Gateway should blink red in groups of 4. Click here if that is not the case.

-- Enter the 8-Digit Serial number on the back of the gateway below and press the "Submit" button. This may take up to 30 seconds to find device.


Gateway
8-Digit Serial Number on back of Gateway

Register

Home

Gateway Registration

-- Within the next 1-2 minutes, firmly push the button on the Gateway. Hold it a moment, then release.

-- Wait a moment for the light to stay solid red.

-- Next, press the "Submit" button.

If the light doesn't stay red, push gateway button one more time or click here .


Gateway Solid Red
Firmly Push Button
Solid Red Light

Register

Home

Success

Your gateway is registered!!!



What do you want to do next?

Register

Home

Sensor Registration

--The Gateway Light should be solid red.
Click here if not.

If the sensor is already displays a temperature
Click here for factory reset instructions

Step 1: Insert batteries then firmly press the sensor button and release. Wait for 3 seconds.

Step 2: Firmly push and release the Gateway Button.

-- Within about 10 seconds the sensor should have a temp on it. If not try again, if so, click the button below.


Register

Home

Success

Your Sensor was registered and named __name__!


Your device was registered! It may take a few minutes for data to start showing, Please identify if you are a barracuda customer and Optionally give a proper name for your new sensor.

Next:

Are you a "Barracuda"customer?

Name you sensor? <optional>

Register

Home

Weather Station Registration

--The Gateway Light should be solid red.
Click here if not.

Set Up Weather Station:

Before continuing, ensure your Professional Weather Station (PWS) is fully set up according to the instructions provided with the weather station (also available online: Setup Instructions (pdf)).

Important! If your Display shows a small "REG" above the time, click here.

Sync:

To get the PWS Display to talk with the gateway:

On the PWS Display, press and hold the "▼/Rain" button until you hear a beep.

Ensure the PWS Display is at least 5 feet away from the gateway and

Press (and release) the grey button on the gateway

The PWS Display will search for the gateway. On the lower left of the weather station display, just above the time and date, the "REG" indicator will begin to flash. When the device has completed registration: The device will beep ONLY ONCE! (Two rapid beeps? See below). The "REG" indicator will no longer flash (stays on solid) then finally the "INTERNET" indicator will appear to the right of the "REG" indicator.
Double beep from the device at the end?
No REG or INTERNET on display? (Click Here)


Register

Home

Weather Station Registration Information

IMPORTANT INFORMATION REGARDING WEATHER STATIONS

  1. Wait 5-10 minutes as a third beep may occur to send the display important settings such as your timezone. If the beep does not occur, Register by Pressing continue, but Check to make sure the Time changed to Your specified Timezone. If it did not, Continue anyway and Navigate to the Device Settings page and choose Sync Timezone to try again.
  2. Regardless, first data may take up to 2 hours on all weather stations.




Register

Home

Success

Your Station was registered and named __name__!


Setup is now complete! It may take a few minutes to a few hours for data to start registering, you can re-name your Station below in the meantime or exit setup.

Next:

Name your Station? <optional>

Login

User Login


New Users - Click here to get started

Forgot your password? Click here to recover it

WeatherDirect
Home

Sign Up New User

( User Name for Login )
( optional - receive alerts at )
( Required only if you provide a telephone )
( 6 to 15 chars )
( 6 to 15 chars )

By clicking Sign Up, you agree to our TERMS and that you have read our PRIVACY POLICY. You are also aware that you may receive SMS notifications as part of La Crosse Mobile Alerts and can opt-out at any time.


Back

Current User Info

Personal Info



Change Password?

Change Timezone?

Alerts / Display Info



Change Email

Change Phone

Change Units

Device Info


Current Gateways:

Back

Register a Phone


Back

Update an Email


Back

Update User Name


Back

Change Timezone

Do not update my WeatherStations with The Selected Timezone

Back

Change Reading


Back

Change Password


min 6 characters, max 15


La Crosse, US

Clouds

get at 2015.04.17 15:46

Wind
Cloudiness
Pressure
Humidity
Sunrise
Sunset
Geo coords[ -91.24, 43.8 ]
Click for weather

Terms of Use

Back

Terms of Use

Privacy Policy

Back

Privacy Policy

???

???

Yes No
Back

Password Recovery

Please enter your email or username


Back

Test Page

4/12/2021, 3:28:10 PM [LacrosseWeb] Malformed config, skipping. 4/12/2021, 3:28:11 PM [DeebotEcovacs] INFO - stopping deebots discovery, number of deebots found : 1 4/12/2021, 3:28:11 PM [DeebotEcovacs] INFO - Discovered Deebot : E0000729018602550751 4/12/2021, 3:28:11 PM [DeebotEcovacs] INFO - Edge Cleaning for E0000729018602550751 : false 4/12/2021, 3:28:11 PM [DeebotEcovacs] INFO - Spot Cleaning for E0000729018602550751 : false 4/12/2021, 3:28:11 PM [DeebotEcovacs] INFO - SpotArea Cleaning for E0000729018602550751 : true 4/12/2021, 3:28:11 PM [DeebotEcovacs] INFO - CustomArea Cleaning for E0000729018602550751 : true 4/12/2021, 3:28:11 PM [DysonPureCoolPlatform] Error while signing in. Status Code: 401 4/12/2021, 3:28:11 PM [DysonPureCoolPlatform] API could not be reached. Retry is disabled.```

jhschuster commented 3 years ago

Two questions:

  1. Can you log in to the LaCrosse website manually with your username and password? https://lacrossealertsmobile.com/v1.2/
  2. Can you run your server in debug mode (homebridge -D) so your log has more of LacrosseWeb's logging in it?

If you're able to capture the logging done in debug mode, I'm interested in seeing it. You don't need to include the HTML page(s) that it reports getting in error -- they just confuse GitHub's messaging interface since it actually renders the HTML instead of quoting it; and it's not of much interest to me. I mostly want to see exactly where it's not able to log in properly.

jbk1988 commented 3 years ago
  1. Yes, no problem
  2. When I run debug mode, I get this: Error: listen EADDRINUSE: address already in use :::80 at Server.setupListenHandle [as _listen2] (net.js:1313:16) at listenInCluster (net.js:1361:12) at Server.listen (net.js:1449:7) at Function.serverListen [as listen] (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/express-ws/lib/index.js:42:40) at API.start (/usr/local/lib/node_modules/@hoobs/hoobs/server/api.js:191:17) at module.exports (/usr/local/lib/node_modules/@hoobs/hoobs/server/cli.js:172:21) { code: 'EADDRINUSE', errno: 'EADDRINUSE', syscall: 'listen', address: '::', port: 80 } [HOOBS] Stopping server.
jhschuster commented 3 years ago

I can't speak to why HOOBS won't let you run Homebridge in debug mode. You're doing this via the Hombridge Config UI X interface, not via the command line, correct? Running homebridge from the command line will probably not do what you want it to do.

When the homebridge-lacrosseweb plugin is run in debug mode, it puts much more interesting stuff into the log that can help determine where the plugin is failing. Your copious message had these interesting bits:

4/12/2021, 3:26:32 PM [LacrosseWeb] Initializing LacrosseWeb platform... ... 4/12/2021, 3:26:33 PM [LacrosseWeb] Didn't get a session key. Giving up. 4/12/2021, 3:26:33 PM [LacrosseWeb] { result: 'fail' } 4/12/2021, 3:26:33 PM [LacrosseWeb] Malformed config, skipping. ... 4/12/2021, 3:28:10 PM [LacrosseWeb] getConfig: matching FAILED 4/12/2021, 3:28:10 PM [LacrosseWeb]

Running in debug mode will give a few more details about why it couldn't get a session key. All the code does is surf to:

https://lacrossealertsmobile.com/v1.2/resources/js/dd/account-enhanced.js?ver=11

scrape the returned HTML for 'var prodKey="..."' and 'var serviceURL="..."' because it needs those values, as well as a setCookie() string to get the cookie name and expiration.

It then logs you in by POSTing to the 'https:' + serviceURL + 'user-api.php?pkey=' + '&action=userlogin' URL. This URL returns JSON that includes the session key, which is what's needed for any further operations.

What's interesting is that big honking HTML fragment you posted is what I'd expect to see when you're logged in. It's doing this to find the devices:

    const matches = body.match(/^userProviderID\s=\s(\d+);userGatewaysList\s=\s'(\d+)';var\sisMetric\s=\s(\d);var\sdevicesInitData\s=\s(.*}});var\srefreshInt/m);

If that matches, it tries:

    const userProviderID = parseInt(matches[1], 10);
    const userGatewaysList = matches[2];
    const isMetric = parseInt(matches[3], 10);
    const devicesInitData = this.parseJSON(matches[4]);

Is there any way you can get me the raw HTML of the page?

iommi1 commented 2 years ago

I think he was having the same problem I was having he has two gateways so the list of gateways is returned here userGatewaysList = '00434661:00514893'; in the regex its looking for just numbers (no : ) userGatewaysList\s=\s'(\d+) I changed my copy to look like this and it works for me! userGatewaysList\s=\s'(\S+)

Thanks, for the plugin!