Hello!
In May of last year I spent some time making a custom component for a cheap but extremely effective device for getting the temperature of my hot tub. For around $30, this accomplished exactly what I wanted and I was very excited to get the data into Home Assistant. La Crosse Technology 926-25106-WGB Wireless Monitor System Set w/Wet Probe
My source can be found on my GitHub here: https://github.com/Legomaniac/hass_lacrosse_alerts_mobile/blob/master/lacrosse_alerts_mobile.py
It was quite bodged and hacked together, but it worked! I knew some of the techniques I used weren’t right, so I disabled it in my configurations.yaml and told myself I would get back to it.
Well, life happened and Home Assistant got neglected. However, I’ve recently been spending some time getting Home Assistant updated to the latest version, Fedora fully up to date, etc. and I’m really interested in getting this to work again.
I uncommented the following section of my config, and unfortunately it doesn’t seem to work anymore.
sensor:
- platform: lacrosse_alerts_mobile
user: !secret lacrosse_username
pass: !secret lacrosse_password
The only error I seem to get is the following:
2019-02-09 19:09:53 WARNING (MainThread) [homeassistant.loader] You are using a custom component for sensor.lacrosse_alerts_mobile which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
I just ran the following and verified that the code that interacts with lacrossealertsmobile.com still works, so whatever is wrong with my code is the portion that interacts with Home Assistant, not the portion that queries the website.
(homeassistant) [homeassistant@diginuc sensor]$ pwd
/home/homeassistant/.homeassistant/custom_components/sensor
(homeassistant) [homeassistant@diginuc sensor]$ python
Python 3.7.2 (default, Jan 16 2019, 19:49:22)
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from lacrosse_alerts_mobile import LaCrosse
>>> import re
>>> import json
>>> mySensor = LaCrosse("***my_user***", "***mypass***")
>>> sessionKey = mySensor.getSessionKey()
>>> webPage = mySensor.getWebPage(sessionKey)
>>> match = re.findall('^userGatewaysList.* ({.*})', webPage.text, flags=re.MULTILINE)
>>> onlyData = json.loads(match[0])
>>> onlyData['device0']['obs'][0]['humidity']
'64'
>>> onlyData['device0']['obs'][0]['probe_temp']
'101.8'
>>> onlyData['device0']['obs'][0]['ambient_temp']
'-2.5'
>>> exit()
My end goal is to create a component that is worthy of being included on the Home Assistant website, however for the time being it would be nice just to get the custom component working again. I’m hoping there is someone with experience creating Home Assistant components that can set me off in the right direction.
Hoping to hear from you all soon,
James