jhschuster / homebridge-lacrosseweb

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

Integration? #1

Closed jbk1988 closed 4 years ago

jbk1988 commented 4 years ago

Hi Jay,

Thanks for doing this. I'm new to Homebridge and I've installed it, but I'm unsure how to code it in the config. Do you have guidance on this?

Thanks!

teleportaloo commented 4 years ago

I have the same problem. It needs some documentation. Reverse engineering the code I think the config for the platform looks like this:

{ "platform": "LacrosseWeb", "name": "LacrosseWeb", "username": "your user name", "password": "your password", "configCacheSeconds": 180 },

However, it still errors out on me. The script appears to be scraping some data from the response from the web site - but I don't know JS enough to understand what is wrong. e.g. the response I get is like this, but the script cannot parse it:

var userProviderID = null;timezone = 8; userGatewaysList = '00378246';var isMetric = 0;var devicesInitData = {"device0":{"success":true,"device_type":"TX60","obs":[{"device_id":"redacted","device_type":"TX60","u_timestamp":"1573343367","ambient_temp":"49.2","probe_temp":"50","humidity":"57","linkquality":"100","lowbattery":"0","success":"9","s_interval":"99","timestamp":"11\/9\/2019 3:49 PM","utctime":1573343367}],"alerts":null,"ispws":0,"unit":{"temp":"°F","temp2":"°F","rh":"%"},"device_id":"redacted","expired":"1","interval":"15","reg_date":"2017-09-04 20:35:18","create_date":1504557318,"device_name":"redacted","assocGateway":"00378246","problem":false}};var refreshInt = 600000;var jstest = false;

jbk1988 commented 4 years ago

Same here. Jay, do you have any insights?

jbk1988 commented 4 years ago

I've got mine working, but want to display the probe, not the unit temperature.

teleportaloo commented 4 years ago

How did you get it to work?

LordJohnWhorfin commented 4 years ago

I've got mine working, but want to display the probe, not the unit temperature.

I created an issue for this and attached a diff. I tried to create a branch for a PR but couldn't, so maybe someone can take a look at the diff and make it all better?

jhschuster commented 4 years ago

I believe this is working now, with the patches @LordJohnWhorfin gave in issue #2.