How to get a message when hive goes offline

I have the hive hub intigrated with home assistant. Theirs a badge at the top of my overview page that shows the status of of the hive hub. I would like to be notified with a message to my phone if it goes offline.
I have tried to set this up in the automations section.
i have changed the following
trigger type: State
Entity: sensor.hive_hub_status
From:
To: offline
For:

Actions
Action type: call service
Service: notify.mobile_app_dave_s_samsung_s9
service data: message: Hive Hub is offline

however their is obviously something wrong with this as it wont save. I get the following error at the top of the automations page.
Message malformed: extra keys not allowed @ data[‘action’][0][‘message’]
I’m happy to change the method of recieving the message to anything else

Try putting double-quotes around your message
message: "Hive Hub is offline"
If that doesn’t work, click on “Edit YAML” on the action and paste it here in a code block, we might be able to help better then :slight_smile:

The quotes seem to do the trick. The automation was allowed to be saved. I disconnected the hive hub and after a moment home assistant showed that it was offline but I didn’t receive a message.
I went to the automation and clicked execute and the message appeared.
Thinking that I might not have given the automation enough time to run I got the hive hub back online and then disconnected it again. Home assistant shows its offline again but its been over 15 mins now and the message hasn’t appeared.
below is the script from automations.yaml

  • id: ‘1593639014695’
    alias: message if hive hub goes offline
    description: ‘’
    trigger:
    • entity_id: sensor.hive_hub_status
      platform: state
      to: offline
      condition: []
      action:
    • data:
      message: Hive Hub is offline
      service: notify.mobile_app_dave_s_samsung_s9

Disconnect the hub and take a look at “Developer Tools-States”, select the hub. What’s the state?
Also, please paste the .yaml in a codeblock (press the </> icon), so the formatting doesn’t get lost

the hub is disconnected. in the Developer Tools-state, sensor.hive_hub_status shows as Offline.
I have copied the code below straight from my automations.yaml

- id: '1593639014695'
  alias: message if hive hub goes offline
  description: ''
  trigger:
  - entity_id: sensor.hive_hub_status
    platform: state
    to: Offline
  condition: []
  action:
  - data:
      message: Hive Hub is offline
    service: notify.mobile_app_dave_s_samsung_s9

I think the problem was i had typed offline instead of Offline for the sensors state. I have just had a successful message from the app so it looks to be working now. Thank you very much for your help.