Class BrickletRemoteSwitch


  • public class BrickletRemoteSwitch
    extends Device
    Controls remote mains switches
    • Constructor Detail

      • BrickletRemoteSwitch

        public BrickletRemoteSwitch​(java.lang.String uid,
                                    IPConnection ipcon)
        Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
    • Method Detail

      • getSwitchingState

        public short getSwitchingState()
                                throws TinkerforgeException
        Returns the current switching state. If the current state is busy, the Bricklet is currently sending a code to switch a socket. It will not accept any requests to switch sockets until the state changes to ready. How long the switching takes is dependent on the number of repeats, see setRepeats(short).
        Throws:
        TinkerforgeException
      • setRepeats

        public void setRepeats​(short repeats)
                        throws TinkerforgeException
        Sets the number of times the code is sent when one of the switch socket functions is called. The repeats basically correspond to the amount of time that a button of the remote is pressed. Some dimmers are controlled by the length of a button pressed, this can be simulated by increasing the repeats.
        Throws:
        TinkerforgeException
      • switchSocketA

        public void switchSocketA​(short houseCode,
                                  short receiverCode,
                                  short switchTo)
                           throws TinkerforgeException
        To switch a type A socket you have to give the house code, receiver code and the state (on or off) you want to switch to. A detailed description on how you can figure out the house and receiver code can be found :ref:`here <remote_switch_bricklet_type_a_house_and_receiver_code>`. .. versionadded:: 2.0.1$nbsp;(Plugin)
        Throws:
        TinkerforgeException
      • switchSocketB

        public void switchSocketB​(long address,
                                  short unit,
                                  short switchTo)
                           throws TinkerforgeException
        To switch a type B socket you have to give the address, unit and the state (on or off) you want to switch to. To switch all devices with the same address use 255 for the unit. A detailed description on how you can teach a socket the address and unit can be found :ref:`here <remote_switch_bricklet_type_b_address_and_unit>`. .. versionadded:: 2.0.1$nbsp;(Plugin)
        Throws:
        TinkerforgeException
      • dimSocketB

        public void dimSocketB​(long address,
                               short unit,
                               short dimValue)
                        throws TinkerforgeException
        To control a type B dimmer you have to give the address, unit and the dim value you want to set the dimmer to. A detailed description on how you can teach a dimmer the address and unit can be found :ref:`here <remote_switch_bricklet_type_b_address_and_unit>`. .. versionadded:: 2.0.1$nbsp;(Plugin)
        Throws:
        TinkerforgeException
      • switchSocketC

        public void switchSocketC​(char systemCode,
                                  short deviceCode,
                                  short switchTo)
                           throws TinkerforgeException
        To switch a type C socket you have to give the system code, device code and the state (on or off) you want to switch to. A detailed description on how you can figure out the system and device code can be found :ref:`here <remote_switch_bricklet_type_c_system_and_device_code>`. .. versionadded:: 2.0.1$nbsp;(Plugin)
        Throws:
        TinkerforgeException
      • getIdentity

        public Device.Identity getIdentity()
                                    throws TinkerforgeException
        Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|
        Specified by:
        getIdentity in class Device
        Throws:
        TinkerforgeException