I have a new old stock CO2 / Temp / Humidity sensor from a company that went out of business. The sensor has a ethernet port where it hosts a web server and displays the sensor values on a very basic html page.
Here is the full html for the temperature value @ http://192.168.1.101/setget?%sen-1
<b>handler.setget(<tt>%sen-1</tt>)</b><br><tt>21.560</tt>
I’m trying to use sensor scrape like this:
-sensor:
platform: scrape
resource: http://192.168.1.101/setget?%sen-1
name: Temperature
select: ‘tt:nth-of-type(1)’
unit_of_measurement: ‘C’
scan_interval: 60
this returns
%25sen-1
I’ve been using the w3school “tryit editor” to test my CSS selections and it seems like the only one I can get to work is:
tt:nth-child(3)
unfortunately nth-child isn’t supported by HA/soup…
I also got this to work with the “tryit editor” but it doesn’t work in HA, I think because my actual code lacks body tags?
body>tt:nth-of-type(1)
here is my “debug” code I’m using to test
<html> <head> <style> body>tt:nth-of-type(1) { background: red; } </style> </head> <b>handler.setget(<tt>%sen-1</tt>)</b> <br> <tt>21.560</tt> </html>