Multi Scrape Sensor troubles

Hi, I’m trying to scrape my Generac PwrCell inverter with the custom multiscrape component, and I can correctly scrape the solar panel production (Energy Today), but can’t for the life of my get the Battery Charge %. I’m not very proficient in CSS and don’t know what I’m doing wrong. Sorry if I posted in the wrong place, wasn’t sure where this question should be asked.

Here’s my current code:

multiscrape:
  - resource: https://pwrcell.generac.com/users/XXXXX/dashboard
    username: "user"
    password: "pass"
    sensor:
      - select: "#content > div > div > div > div.row-fluid.dash-statistics > div:nth-child(1) > div:nth-child(2) > h4"
        value_template: '{{ value.rstrip(" kWh") | float }}'
        unit_of_measurement: "kWh"
        unique_id: generac_inverter_energy_today
        name: Generac Energy Today
  - resource: https://pwrcell.generac.com/users/XXXXX/dashboard
    username: "user"
    password: "pass"
    sensor:
      - select: "#content > div > div > div > div.row-fluid.dash-statistics > div:nth-child(3) > div:nth-child(1) > h4"
        unique_id: generac_inverter_home_backup_charge
        value_template: '{{ value.rstrip("%") | float }}'
        name: Generac Backup Charge %
        unit_of_measurement: "%"
        on_error:
          log: debug
          value: last

Here’s a screenshot of the pages CSS.

They highlighted part is the part that includes the Battery %. If I right click and copy > copy selector, I only get #battery-charge, and putting the id directly doesn’t seem to work. I’ve tried to put it directly in the CSS path in my yaml, and then add the id at the end but that doesn’t work either. Anyone have any tips or something I’m overlooking? I’ve tried multiple variations and even tried to get the value from another place on that dashboard, but I still am stuck. Any help would be greatly appreciated!

Sorry, just bumping this to see if anyone has any idea what could be wrong?

Maybe that data is loaded dynamically with javascript in the background? In that case, multiscrape cannot read it. Check the traffic in the network tab to see if it contains the battery level. If you find it, try to scrape that one.

It’s very hard give support on sites behind a login without the username/pw.

Ah, I see you posted this in multiple threads :frowning:

Sorry didn’t see this until now, the inverter actually died on me! So I’m in the process of getting it replaced under warranty, but will try what you recommended on the network tab! Thanks!

Just curious, how old was the inverter before it died ? Did you get all the data into HA? I want to do the same thing.

Try this for the value template. It looks like the % wasn’t ignored. However, Generac’s page refreshes with ‘no battery’ then displays the battery percentage. HA dashboard will continue to show ‘no battery’ due to this. It may be better to obtain % charged from the Overview tab instead of the Dashboard. I am still working on this scrape method, without success.

value_template: ‘{{ value.split("%")[0] }}’