Problem triggering an event from a temperature reading

I am trying to trigger few events from a temperature sensor reading. My goal is to issue GCode commands when a thermistor reaches a certain temperature.

I can see the temperature changing with the M105 command but I am having problems with triggering the event.
I have attached the config code I am using:

temperature_control.roomTemp.enable true
temperature_control.roomTemp.thermistor_pin 0.23
temperature_control.roomTemp.heater_pin nc
temperature_control.roomTemp.thermistor EPCOS100K
temperature_control.roomTemp.designator T
temperature_control.roomTemp.readings_per_second 10

switch.toohot.enable true
switch.toohot.input_on_command G28X0Y0
switch.toohot.input_off_command G0X100Y100

temperatureswitch.roomTemp.enable true
temperatureswitch.roomTemp.switch toohot
temperatureswitch.roomTemp.designator T
temperatureswitch.roomTemp.threshold_temp 22.0
temperatureswitch.roomTemp.heatup_poll 2
temperatureswitch.roomTemp.cooldown_poll 5


I can see the temperature going past 22 degrees, but no switch is triggered.
Any ideas or suggestions on why this is not working?

Thank you,
Domenic

Imported from wikidot

Ok, many thanks to Wolfmanjm for helping point out where I was going wrong.

I was incorrectly using the .input_on_command when it should have been .output_on_command

The correct code for the switch should be:

switch.toohot.enable true
switch.toohot.output_on_command G28X0Y0

I can confirm that Smoothiware will trigger a gcode command in this situation.

Domenic