Class: OpenHAB::Core::Items::RollershutterItem

Inherits:
GenericItem
  • Object
show all
Includes:
NumericItem
Defined in:
lib/openhab/core/items/rollershutter_item.rb

Overview

A RollershutterItem allows the control of roller shutters, i.e. moving them up, down, stopping or setting it to close to a certain percentage.

Examples:

Roll up all Rollershutters in a group

Shutters.up

Log a warning for all rollershutters that are not up

Shutters.reject(&:up?).each do |item|
  logger.warn("#{item.name} is not rolled up!")
end

Set rollershutter to a specified position

Example_Rollershutter << 40

Constant Summary

Constants included from Semantics

Semantics::Equipment, Semantics::Location, Semantics::Point, Semantics::Property, Semantics::Tag

Constants included from Persistence

Persistence::HistoricState

Instance Attribute Summary collapse

Attributes inherited from GenericItem

#category, #label, #name, #raw_state, #tags

Attributes included from Item

#accepted_command_types, #accepted_data_types, #all_groups, #channel, #channel_uid, #channel_uids, #channels, #command_description, #formatted_state, #groups, #last_state, #last_state_change, #last_state_update, #links, #metadata, #name, #provider, #state_description, #thing, #things

Attributes included from Semantics

#equipment, #equipment_type, #location, #location_type, #point_type, #property_type, #semantic_type

Instance Method Summary collapse

Methods inherited from GenericItem

#modify, #null?, #state?, #time_series=, #undef?, #was?, #was_null?, #was_undef?

Methods included from Item

#call_item?, #color_item?, #command, #contact_item?, #date_time_item?, #dimmer_item?, #group_item?, #image_item?, #inspect, #link, #location_item?, #member_of?, #number_item?, #player_item?, #refresh, #rollershutter_item?, #string_item?, #switch_item?, #tagged?, #to_s, #unlink, #update

Methods included from Semantics

add, #equipment?, #location?, lookup, #point?, #points, remove, #semantic?, tags

Methods included from DSL::Items::Ensure::Ensurable

#ensure

Methods included from Persistence

#all_states_between, #all_states_since, #all_states_until, #average_between, #average_since, #average_until, #changed_between?, #changed_since?, #changed_until?, #count_between, #count_since, #count_state_changes_between, #count_state_changes_since, #count_state_changes_until, #count_until, #delta_between, #delta_since, #delta_until, #deviation_between, #deviation_since, #deviation_until, #evolution_rate, #evolution_rate_between, #evolution_rate_since, #evolution_rate_until, #historic_state, #last_change, #last_update, #maximum_between, #maximum_since, #maximum_until, #median_between, #median_since, #median_until, #minimum_between, #minimum_since, #minimum_until, #next_change, #next_state, #next_update, #persist, #persisted_state, #previous_state, #remove_all_states_between, #remove_all_states_since, #remove_all_states_until, #riemann_sum_between, #riemann_sum_since, #riemann_sum_until, #sum_between, #sum_since, #sum_until, #updated_between?, #updated_since?, #updated_until?, #variance_between, #variance_since, #variance_until

Methods included from DSL::Items::TimedCommand

#command

Instance Attribute Details

#statePercentType, ... (readonly)

Returns:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/openhab/core/items/rollershutter_item.rb', line 33

class RollershutterItem < GenericItem
  include NumericItem

  # @!method up?
  #   Check if the item state == {UP}
  #   @return [true,false]

  # @!method down?
  #   Check if the item state == {DOWN}
  #   @return [true,false]

  # @!method was_up?
  #   Check if {#was} is {UP}
  #   @return [true, false]

  # @!method was_down?
  #   Check if {#was} is {DOWN}
  #   @return [true, false]

  # @!method up
  #   Send the {UP} command to the item
  #   @return [RollershutterItem] `self`

  # @!method up!
  #   Send the {UP} command to the item, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [RollershutterItem] `self`

  # @!method down
  #   Send the {DOWN} command to the item
  #   @return [RollershutterItem] `self`

  # @!method down!
  #   Send the {DOWN} command to the item, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [RollershutterItem] `self`

  # @!method stop
  #   Send the {STOP} command to the item
  #   @return [RollershutterItem] `self`

  # @!method move
  #   Send the {MOVE} command to the item
  #   @return [RollershutterItem] `self`

  # raw numbers translate directly to PercentType, not a DecimalType
  # @!visibility private
  def format_type(command)
    return Types::PercentType.new(command) if command.is_a?(Numeric)

    super
  end
end

#wasPercentType, ... (readonly)

Returns:

Since:

  • openHAB 5.0



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/openhab/core/items/rollershutter_item.rb', line 33

class RollershutterItem < GenericItem
  include NumericItem

  # @!method up?
  #   Check if the item state == {UP}
  #   @return [true,false]

  # @!method down?
  #   Check if the item state == {DOWN}
  #   @return [true,false]

  # @!method was_up?
  #   Check if {#was} is {UP}
  #   @return [true, false]

  # @!method was_down?
  #   Check if {#was} is {DOWN}
  #   @return [true, false]

  # @!method up
  #   Send the {UP} command to the item
  #   @return [RollershutterItem] `self`

  # @!method up!
  #   Send the {UP} command to the item, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [RollershutterItem] `self`

  # @!method down
  #   Send the {DOWN} command to the item
  #   @return [RollershutterItem] `self`

  # @!method down!
  #   Send the {DOWN} command to the item, even when {OpenHAB::DSL.ensure_states! ensure_states!} is in effect.
  #   @return [RollershutterItem] `self`

  # @!method stop
  #   Send the {STOP} command to the item
  #   @return [RollershutterItem] `self`

  # @!method move
  #   Send the {MOVE} command to the item
  #   @return [RollershutterItem] `self`

  # raw numbers translate directly to PercentType, not a DecimalType
  # @!visibility private
  def format_type(command)
    return Types::PercentType.new(command) if command.is_a?(Numeric)

    super
  end
end

Instance Method Details

#downRollershutterItem

Send the DOWN command to the item

Returns:



# File 'lib/openhab/core/items/rollershutter_item.rb', line 60

#down!RollershutterItem

Send the DOWN command to the item, even when ensure_states! is in effect.

Returns:



# File 'lib/openhab/core/items/rollershutter_item.rb', line 64

#down?true, false

Check if the item state == DOWN

Returns:

  • (true, false)


# File 'lib/openhab/core/items/rollershutter_item.rb', line 40

#moveRollershutterItem

Send the MOVE command to the item

Returns:



# File 'lib/openhab/core/items/rollershutter_item.rb', line 72

#stopRollershutterItem

Send the STOP command to the item

Returns:



# File 'lib/openhab/core/items/rollershutter_item.rb', line 68

#upRollershutterItem

Send the UP command to the item

Returns:



# File 'lib/openhab/core/items/rollershutter_item.rb', line 52

#up!RollershutterItem

Send the UP command to the item, even when ensure_states! is in effect.

Returns:



# File 'lib/openhab/core/items/rollershutter_item.rb', line 56

#up?true, false

Check if the item state == UP

Returns:

  • (true, false)


# File 'lib/openhab/core/items/rollershutter_item.rb', line 36

#was_down?true, false

Check if #was is DOWN

Returns:

  • (true, false)


# File 'lib/openhab/core/items/rollershutter_item.rb', line 48

#was_up?true, false

Check if #was is UP

Returns:

  • (true, false)


# File 'lib/openhab/core/items/rollershutter_item.rb', line 44