Skip to content

v9.2.0 πŸ” Smarter form_submit and no more frozen HA

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 30 Oct 08:47
5c36996

πŸ‘‹ A quick note

I run The Smart Home Newsletter β€” a weekly curated digest for smart home enthusiasts.

Each issue highlights the most relevant and interesting smart home articles, news, and projects from the past week.

Since you're here, you're clearly into home automation β€” so you might genuinely enjoy the newsletter.

πŸ‘‰ Subscribe at smarthomenewsletter.com


πŸ” What's new in v9.2.0

This release makes form_submit much more capable: input values can now be templates, and HTTP options that used to be silently ignored now work. It also stops large pages from freezing Home Assistant and fixes state restore for date/timestamp and binary sensors.

A few of these changes can affect existing configs. Please read the ⚠️ section before upgrading.

πŸš€ New: templated form_submit inputs

Some login forms hash the password in JavaScript before submitting, using a nonce from a hidden field on the same form (AT&T BGW320 gateways and several other ISP routers do this). input values are now rendered as templates at submit time, and the fields scraped from the form are available as form:

multiscrape:
  - resource: http://192.168.1.254/cgi-bin/nattable.ha
    form_submit:
      resource: http://192.168.1.254/cgi-bin/login.ha
      select: "form"
      input:
        password: "**********"
        hashpassword: "{{ md5('<access code>' ~ form.nonce) }}"
      resubmit_on_error: true

form holds all scraped fields before input_filter is applied, so you can use a field to compute another one even if you filter it out of the payload. (#629, closes #627)

πŸ”§ form_submit now honours its HTTP options

form_submit accepted every HTTP option but only used some of them. Now:

option before now
payload ignored sent as the raw request body, replacing the url-encoded input fields. Renders with form too
method ignored used when set, otherwise the <form method> attribute, otherwise POST
timeout ignored applied to both the form page fetch and the submit
resource_template ignored rendered
verify_ssl ignored rejected (it can't differ from the main request, since the client is shared)

See the Form-submit section in the README for the full list of options. (#635, closes #630)

⚑ Large pages no longer freeze Home Assistant

CSS selection used to run on the event loop. On big pages one selector could take tens of seconds, and Home Assistant froze for that long on every poll. All selection now runs in a single background job per update, so a slow selector only delays its own sensors. Pretty-printing for log_response and the get_content service also moved off the loop. (#636, closes #633)

πŸ› Bug fixes

  • Date/timestamp sensors failed to load on startup with 'str' object has no attribute 'tzinfo'. The restored state was a string and Home Assistant rejected it. Restored values are now parsed correctly. (#628, closes #623)
  • Binary sensors came up unknown after a restart until the first scrape. They now restore their previous on/off state, as sensors already did. (#628)

⚠️ Breaking changes

  • form_submit: verify_ssl: is no longer allowed. Remove it, or Home Assistant will refuse to load the config.
  • form_submit: method:, timeout: and payload: now take effect. If you set them before, they were ignored. Check they still do what you want.
  • form_submit input values are rendered as templates. A value containing a literal {{, {% or {# will now behave differently.
  • select templates are rendered once at the start of each update. A select template that reads a sensor from the same scraper now always sees that sensor's previous value. Before, this depended on the order entities updated in.
  • Binary sensors restore their previous state on startup instead of starting as unknown.

Thanks to @pallemannen for reporting #627 and #633!

πŸ“š Documentation

  • Remove paid support option from README (#621)

⬆️ Dependencies & Tooling

  • Update pytest-homeassistant-custom-component to v0.13.375 (#626)
  • Update ruff to v0.17.3 (#631, #624)
  • Update Python to 3.15 (#632)
  • Update actions/setup-python to v7.1.0 (#634)
  • Update devcontainer github-cli feature to v1.1.3 (#625, #604)

Full Changelog: v9.1.0...v9.2.0