Rest Notifier Error (accessing MF833V LTE stick)

I’m trying to get a MF833v LTE stick working. It is accessible via a web interface. I am basing the notifier on the post from here: ZTE 3G/4G dongle SMS notification

This is to send a SMS notification on an event. When I attempt to fire the action (using developer services) I am constantly getting a python error in

2020-11-22 01:05:37 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2976251880] 'str' object has no attribute 'hass'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/", line 135, in handle_call_service
  File "/usr/src/homeassistant/homeassistant/", line 1451, in async_call
  File "/usr/src/homeassistant/homeassistant/", line 1486, in _execute_service
  File "/usr/src/homeassistant/homeassistant/components/notify/", line 147, in _async_notify_message_service
    await self.async_send_message(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/notify/", line 126, in async_send_message
    await self.hass.async_add_executor_job(partial(self.send_message, message, **kwargs))  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/rest/", line 168, in send_message
  File "/usr/src/homeassistant/homeassistant/components/rest/", line 162, in _data_template_creator
    return {
  File "/usr/src/homeassistant/homeassistant/components/rest/", line 163, in <dictcomp>
    key: _data_template_creator(item) for key, item in value.items()
  File "/usr/src/homeassistant/homeassistant/components/rest/", line 165, in _data_template_creator
    value.hass = self._hass
AttributeError: 'str' object has no attribute 'hass'

I can’t for the life of me figure out what’s going on. Any help is appreciated.

Hi @grego

I replied with my solution in the original post. Now I am waiting for someone more competent to provide a better solution.