question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removal of Index from the config broke my sensors

See original GitHub issue

Version of the custom_component

6.2.0

Configuration

multiscrape:
  - resource: https://meteoregionelazio.it/rete/stazione.php?id=RM-139
    scan_interval: 600
    sensor:
      - unique_id: infernetto_hum
        name: Umidità Infernetto
        select: ".dato_grande"
        index: 1
        value_template: '{{ (value.split("%")[0]) }}'
        device_class: "humidity"
        state_class: "measurement"
        unit_of_measurement: "%"

Describe the bug

Removal of Index from the config broke all my sensors. It was a useful feature… now how can I get the same result?

Also, the readme.md still lists Index as a parameter.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
SirUlicommented, Apr 21, 2022

Taking the example from above:

select: ".dato_grande"
index: 1

Then reading the link of Daniel leads to:

select: "tr > td[width="243.3"]:nth-of-type(4) > .dato_grande"

The issue on that webpage is that there is no specific indicator for the field that @namadori wanted to have. So this wasn’t the best example 😉

Generally the solution is :nth-of-type(<number>) where number is the previous index number + 1 (since it doesn’t start with zero). Theoretically the solution would have been

select: ".dato_grande:nth-of-type(2)"

But in the case of the website that doesn’t work 😉

You can easily find the solutions by using the developer tools (e.g. in Chrome via F12 and then change to the “Elements” tab and hit CTRL+F to open the bar where you can enter the Xpath selectors.

1reaction
danieldotnlcommented, Apr 25, 2022

This works: .textFCK > p:nth-of-type(1) (even without the nth-of-type)

Check this for more info on CSS selectors: https://www.w3schools.com/cssref/css_selectors.asp

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are some sensors on my Index controllers not working? - Reddit
Just for the looks mostly. Removing it will usually only improve things, like reduce heat.
Read more >
2022.11: A heck of a release! - Home Assistant
I started to get “ERROR (MainThread) [homeassistant.setup] Error during setup of component ssdp” after updating my HA Docker. Because SSDP isn't ...
Read more >
Index Base Station & Lighthouse Tracking - Steam Support
General troubleshooting. Before reading further, be sure to: · Trouble with tracking? · Remove Film Sticker · Check Base Station positioning · Remove...
Read more >
Troubleshoot Rift S - Meta
Carefully remove the facial interface from your headset. This will allow you to access the ... I'm getting an error during my Oculus...
Read more >
Uninstall Pop-up Ads program from your computer
How to remove Adware and pop-up ads (Removal Guide) ... You can reset Internet Explorer settings to return them to the state they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found