Automation - State not recognised

Hi
Attempting to create a automation that detects if my 3D printer has gone offline.
The 3d printer is connected to a Raspberry Pi which uses the moonraker plugin in HA.

The only entity that shows this error is
sensor.mainsailos_printer_message

When trying to create a automation however, when adding a condition for this entities state i only get unavailable and unknown.

The state is

Lost communication with MCU ‘mcu’ Once the underlying issue is corrected, use the “FIRMWARE_RESTART” command to reset the firmware, reload the config, and restart the host software. Printer is shutdown

Blockquote

Other entities for other devices give a list of states but unable to get this to show the states.

How would i go about doing this?

Many thanks

Moonraker Printer Message

Use an entity state trigger / condition rather than a device trigger / condition.

Hi.
Yes, i have been using the entity but only getting this

Copy the state into that box.

Make sure it’s exactly as HA sees it — don’t include the smart quotes from the forum post.

Alternatively, trigger off any state change (leave To and From blank) and add a template condition:

condition:
  - "{{ 'Lost communication' in trigger.to_state.state }}"