Alas no. I would love to know if anyone else has though!
Hi all, i’m trying to use scrape to extract data from a site.
I used SelectGadget to extract CSS tag but if I add to select i receive the error:
[homeassistant.components.scrape.sensor] Unable to extract data from HTML for MilkMan EasyCoop Time
Code is:
- platform: scrape
resource: https://easycoop.milkman.it/ETAservice/#/it/etaservice/RemovedID
name: MilkMan EasyCoop Time
select: '.hhIrGC'
I also check with chrome inspect but no luck.
What i want is to extract data in yellow color
Any Hint?
Thanks
Just a hint from my side about mobile alerts. they have changed something, once again.
my new scrape sensor code is:
- platform: scrape
name: Door1
resource: https://measurements.mobile-alerts.eu/Home/MeasurementDetails?deviceid=XXXX&vendorid=YYY&appbundle=eu.mobile_alerts.mobilealerts&area=month
select: "td:nth-of-type(2)"
headers:
User-Agent: Mozilla/5.0
- platform: scrape
name: Temperatur1
resource: https://measurements.mobile-alerts.eu/Home/MeasurementDetails?deviceid=XXX2&vendorid=YYY&appbundle=eu.mobile_alerts.mobilealerts
select: "td:nth-of-type(2)"
value_template: '{{ (value.split(" ")[0] | replace (" ", "") | replace (",", ".")) }}'
unit_of_measurement: '°C'
scan_interval: 600
headers:
User-Agent: Mozilla/5.0
You seen, new User-Agent is importent.
Has anyone made any progress on this at all or is there another way to do this please?
Realise this is a bit late, but I recently looked into this and although I couldn’t get this working using scrape, it is possible using a container this fine gentleman has produced which provides a locally hosted API endpoint you can query using the rest platform in your sensors config.
https://github.com/mylesagray/boilerjuice-tank-api
Just run the container with the appropriate credentials and tank id, then query the API endpoint to grab the data.
docker run -d -p 8080:8080 -e [email protected] -e BJ_PASSWORD=password -e TANK_ID=tank_id ghcr.io/mylesagray/boilerjuice-tank
Hope this helps!
Hey I got this container up and running and can visit the URL to see my tank info but I am struggling to make a sensor to display the info in HA. Any chance you would mind sharing your yaml?
Sorry about the delay replying, this worked for me:
sensor:
- platform: rest
name: oil_tank_level
resource: http://your_api_endpoint:your_api_port/
value_template: "{{ value_json.litres }}"
Hope this helps!
Thanks for this!
Just tried this container - any idea what the Tank_ID is? The log file moans it is missing. I can see the Tank_ID is mentioned in the code but I don’t know what to put in there.
EDIT: Its in the URL when you go to your Tank details
Hey. I’ve been running this container for months without issue (thanks, btw). In the last week ive been getting error and am unable to restart it. Here is the log from Portainer: Traceback (most recent call last): File "/app/app.py", line 4, in <module - Pastebin.com
Any ideas?
Mine hasn’t worked for a few weeks either. Shame as it was working well!
I spoke to the maintainer about this and he has fixed it today
It would be so nice if the scraper supports actual XPath for selecting the element. Rather than complex CSS selectors that need to be manually written.