Hi,
with Scarlet and libvisiontransfer how can I read the temperatures available in the web interface?
Get temperature
-
- Posts: 20
- Joined: Fri Feb 04, 2022 3:32 pm
-
- Posts: 123
- Joined: Mon Mar 25, 2019 1:12 pm
Re: Get temperature
Unfortunately the device temperature is currently not accessible through libvisiontransfer but only through the web interface. Would it be an option for you to automatically query the web interface? This could be done e.g. through curl. We can add this feature to our TODO list.
-
- Posts: 20
- Joined: Fri Feb 04, 2022 3:32 pm
Re: Get temperature
Curl could be an option if no other can do the trick
But I suggest you to add the feature in next updates
which url can be used?
But I suggest you to add the feature in next updates
which url can be used?
-
- Posts: 123
- Joined: Mon Mar 25, 2019 1:12 pm
Re: Get temperature
Code: Select all
http://192.168.10.10/status
You can try the following script:
Code: Select all
curl http://192.168.10.10/status/ 2>&1 | \
grep -A1 temperature | grep span | \
sed -e 's/^ *<td>[^>]*>\([^\ ]*\)\ .*/\1/'
-
- Posts: 20
- Joined: Fri Feb 04, 2022 3:32 pm
Re: Get temperature
Is the www API documented somewhere?
-
- Posts: 123
- Joined: Mon Mar 25, 2019 1:12 pm
Re: Get temperature
This is not an offical API but just the regular web interface. The script that I posted does the following:
1. It downloads the status page of the web interface (the first page you see when opening the web interface in your browser)
2. Using grep, it searches for the word "temperature" in the HTML code and outputs this line and the following. The resulting HTML code will look something like this:
3. It extracts the value (50.0) from the HTML code by calling sed
1. It downloads the status page of the web interface (the first page you see when opening the web interface in your browser)
2. Using grep, it searches for the word "temperature" in the HTML code and outputs this line and the following. The resulting HTML code will look something like this:
Code: Select all
<td>SoC temperature: </td>
<td><span class="value_good">50.0 °C</span></td>