I’ve got an idea : I wanna read on my frontend the time before my next tramway.
It exists a website and with a http request we have an access to the information. But how can I return this information on a format number ?
I explain : with form parameter I can choose the tramway’s station and the tramway’s lign, but I’ve got this :
You could use the scrape component. It takes a bit of work to find the right css tag to use in the select. But it has worked well for me. The link in the documentation to Beautifulsoups CSS selectors documentation is very helpful.
I need to extract data from the web page requiring login (email and password)
Http with “request” is: http://xxxxxxxxx.yy/en/login/login?continue=%2Fen%2Fpool%2Fgetmainvalues%3Fid%3D6666%26hasPH%3Dtrue%26hasRX%3Dfalse%26hasCL%3Dfalse%26hasCD%3Dfalse%26config%3D0%26hasHidro%3Dtrue%26hasLight%3Dtrue%26hasRelays%3Dtrue%26numRelays%3D1%252C2%252C3%26hasFiltration%3Dtrue%26hasBackwash%3Dfalse%26hasIO%3Dfalse%26hasUV%3Dfalse%26needsTimeBesgoRemaining%3Dfalse
Firstly I need to pass login. I have not succeeded yet
I tried: user/password, username/password, user_emai/password neither of them works.
This is the login page: Login
2018-07-22 13:32:36 ERROR (MainThread) [homeassistant.components.sensor] scrape: Error on device update!
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 319, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/scrape.py", line 120, in update
value = raw_data.select(self._select)[0].text
IndexError: list index out of range
You’ll need to provide the username and password as parameters in the URL that the login form submits to. This is assuming the site will accept it as a GET request. If the endpoint only accepts POST requests, I’m afraid you will not be able to use the scrape component for this.
I haven’t run into this situation myself yet, so I’m not sure what the easiest way to scrape a page with a login screen is.
Hm, I tried to open the web with ceredentials embedded in url, but it does not go through. Login page popped up instead.
It looks like it is “dead road”
Hi, none of Homeassistant sensors (scrape, etc.) is supported by vistapool web and vistapool itself is not talkative at all.
There is an option - use of MODBUS. But I am not skilled enough to do it (you need converter and MODBUS knowledge)
So far I use second thermometer and PH probe to display these basic values and some additional relays to control lights, filtration and countercurrent.
Thanks for your answer. I also contacted VistaPool with no response at all. What pool thermometer and pH probe are you using to incorporate the value to Home Assistant?
Thermometer DS18B20 (for example here )
pH probe (example )
Both are connected to NodeMCU (or Wemos D1 mini), with Tasmota firmware, providing MQTT
Rest is on the Homeassistant