Skip to main content Link Search Menu Expand Document (external link)

trigger

trigger provides the ability to create a trigger type not already covered by the other methods.

OptionsDescription
type_uidA string representing the trigger type uid
configurationnamed keywords for the trigger’s configurations

Example

PID Controller Trigger

Create a trigger for the PID Controller Automation add-on.

rule 'PID Control' do
  trigger 'pidcontroller.trigger',
    input: InputItem.name,
    setpoint: SetPointItem.name,
    kp: 10,
    ki: 10,
    kd: 10,
    kdTimeConstant: 1,
    loopTime: 1000

  run do |event|
    logger.info("PID controller command: #{event.command}")
    ControlItem << event.command
  end
end

DateTime Trigger

This trigger type is available in openHAB 3.3.0.M4+

rule 'DateTime Trigger' do
  description 'Triggers at a time specified in MyDateTimeItem'
  trigger 'timer.DateTimeTrigger', itemName: MyDateTimeItem.name
  run do 
    logger.info("DateTimeTrigger has been triggered")
  end
end