Basic Rule Not Executing

I having difficulty getting what I think should be a very simple rule to execute. Here are the relevant items from my items file default.items:

Switch photon1_sentinal {mqtt="<[rpiMQTTbroker:/home/photon1/sentinal:state:default]"}

Switch mySwitch {mqtt=">[rpiMQTTbroker:/home/photon1/input:command:ON:D0_ON],>[rpiMQTTbroker:/home/photon1/input:command:OFF:D0_OFF]"}

And here is my entire default.rules file:

rule “photon1_watchdog”
when
	item photon1_sentinal received update
then
	logInfo("default.rules", "In rule photon1_watchdog")
	sendCommand(mySwitch, ON)
end

Sending MQTT commands changes the state of the “photon1_sentinal” item, but the rule never seems to execute: I don’t see the ON command being sent in the terminal, and I don’t see anything being written to the openhab.log file in the log folder.

Does anyone see any obvious problems with my code?

I think I solved this issue: the problem was two fold:

  1. I needed to import org.openhab.core.library.types.* and format my message as so:

    var String message = "Running Photon1 Sentinal"
    logInfo(“File”, message)

  2. Once I got this right, I saw that the switches weren’t always initialized before I ran the program. Modifying the rule like this fixed that:

if (item.state != Uninitialized) sendCommand(item, item.state)