Fetch web text and send in notify message

I have try to fetch text from one website. Is plan text.
The web site text is no Html or CSS. Only text 8 lines with plan text.
And then I want to send this lines in notify with a script.

I have try to to this is 2 step. Use eg. scraper and the use notify send in the script.
scraper sensor is empty.
But Not sure how to solve this.

Somebody know how to save text in home assistant and send later or not need to save if is possible to fetch and send text in notify scritp.

Can you guarantee that the total message is less than 256 characters? That would make the job a lot easier.

Potential solution below: add as many sensors as needed for the length of the message. Each sensor’s state must be no more than 255 characters.

  - resource: YOUR_URL
    scan_interval: 3600
      - name: Notify message part 1
        value_template: "{{ value[0:255] }}"
      - name: Notify message part 2
        value_template: "{{ value[255:510] }}"
      - name: Notify message part 3
        value_template: "{{ value[510:765] }}"

Notifications documented here:

…and you would set the message to:

"{{ states('sensor.notify_message_part_1') ~ states('sensor.notify_message_part_2') ~ states('sensor.notify_message_part_3') }}"

Thanks… Will try.
Text in now 212 char. but is dynamic so next time is maby more…

It worked brilliantly…

1 Like