How to control Fibaro FGS-222 from openHAB

Hello,

My first post here, hope you can help me out and make me a little wiser and happier. :smiley:

I bought a aeotec Z-stick gen5 and a Fibaro FGS-222 dual relay switch.

My intention was to use the fibaro to connect two outdoor motion detectors, and get the state of the motion detection into openHAB. Then I want to connect two lights to the fibaro (1 normal outdoor lamp, and 1 lamppost).
I want to switch both lights on during set hours when movement is detected, and also switch the lamppost on during set hours.

Hope you understand what I am trying to build, this is my first openHAB project! I searched to find the answer on my following questions, but couldn’t find any.

Can you tell me if what i want is possible? Can I read the inputs of the fibaro, and control the outputs, using openHAB?

If this is possible, can you help me how to read the inputs, and set the outputs?
I think I should configure the correct zwave commands/parameters in the openhab default.items file? I couldn’t find any example of these commands/parameters.

I will continue my search, and in the meantime I hope someone will help me here!

Thanks!

I am now able to control the state of the relay, and read the state of the relay, by openhab! Using the following item configuration:

Switch FibaroSwitch1 “Buitenlamp Zijdeur” {zwave=“2”}

I have the following XML:

<node>
  <deviceClass>
    <basicDeviceClass>ROUTING_SLAVE</basicDeviceClass>
    <genericDeviceClass>BINARY_SWITCH</genericDeviceClass>
    <specificDeviceClass>POWER_SWITCH_BINARY</specificDeviceClass>
  </deviceClass>
  <homeId>0xe98a7412</homeId>
  <nodeId>2</nodeId>
  <version>4</version>
  <name>Bewegingsensor + lamp zijdeur</name>
  <location>Knieschot boven meterkast</location>
  <manufacturer>0x10f</manufacturer>
  <deviceId>0x1002</deviceId>
  <deviceType>0x202</deviceType>
  <listening>true</listening>
  <frequentlyListening>false</frequentlyListening>
  <routing>true</routing>
  <healState>DONE @ 2016-05-13T18:26:34+0000</healState>
  <security>false</security>
  <beaming>true</beaming>
  <maxBaudRate>40000</maxBaudRate>
  <nodeInformationFrame/>
  <supportedCommandClasses>
    <entry>
      <commandClass>CONFIGURATION</commandClass>
      <configurationCommandClass>
        <version>1</version>
        <instances>1</instances>
        <configParameters>
          <entry>
            <int>32</int>
            <configurationParameter>
              <index>32</index>
              <size>1</size>
              <value>3</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>1</int>
            <configurationParameter>
              <index>1</index>
              <size>1</size>
              <value>-1</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>33</int>
            <configurationParameter>
              <index>33</index>
              <size>1</size>
              <value>1</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>3</int>
            <configurationParameter>
              <index>3</index>
              <size>1</size>
              <value>1</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>4</int>
            <configurationParameter>
              <index>4</index>
              <size>2</size>
              <value>12000</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>5</int>
            <configurationParameter>
              <index>5</index>
              <size>2</size>
              <value>0</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>6</int>
            <configurationParameter>
              <index>6</index>
              <size>1</size>
              <value>0</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>7</int>
            <configurationParameter>
              <index>7</index>
              <size>1</size>
              <value>0</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>39</int>
            <configurationParameter>
              <index>39</index>
              <size>2</size>
              <value>600</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>40</int>
            <configurationParameter>
              <index>40</index>
              <size>1</size>
              <value>3</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>41</int>
            <configurationParameter>
              <index>41</index>
              <size>1</size>
              <value>2</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>42</int>
            <configurationParameter>
              <index>42</index>
              <size>1</size>
              <value>3</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>43</int>
            <configurationParameter>
              <index>43</index>
              <size>1</size>
              <value>1</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>13</int>
            <configurationParameter>
              <index>13</index>
              <size>1</size>
              <value>0</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>14</int>
            <configurationParameter>
              <index>14</index>
              <size>1</size>
              <value>1</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>15</int>
            <configurationParameter>
              <index>15</index>
              <size>1</size>
              <value>0</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>16</int>
            <configurationParameter>
              <index>16</index>
              <size>1</size>
              <value>1</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>30</int>
            <configurationParameter>
              <index>30</index>
              <size>1</size>
              <value>3</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
          <entry>
            <int>31</int>
            <configurationParameter>
              <index>31</index>
              <size>1</size>
              <value>2</value>
              <readOnly>false</readOnly>
              <writeOnly>false</writeOnly>
            </configurationParameter>
          </entry>
        </configParameters>
      </configurationCommandClass>
    </entry>
    <entry>
      <commandClass>ASSOCIATION</commandClass>
      <associationCommandClass>
        <version>1</version>
        <instances>1</instances>
        <configAssociations>
          <entry>
            <int>0</int>
            <associationGroup>
              <Index>0</Index>
              <Nodes>
                <int>0</int>
              </Nodes>
            </associationGroup>
          </entry>
          <entry>
            <int>1</int>
            <associationGroup>
              <Index>1</Index>
              <Nodes/>
            </associationGroup>
          </entry>
          <entry>
            <int>2</int>
            <associationGroup>
              <Index>2</Index>
              <Nodes/>
            </associationGroup>
          </entry>
          <entry>
            <int>3</int>
            <associationGroup>
              <Index>3</Index>
              <Nodes>
                <int>1</int>
              </Nodes>
            </associationGroup>
          </entry>
        </configAssociations>
        <maxGroups>3</maxGroups>
      </associationCommandClass>
    </entry>
    <entry>
      <commandClass>MULTI_INSTANCE</commandClass>
      <multiInstanceCommandClass>
        <version>2</version>
        <instances>1</instances>
        <endpoints>
          <entry>
            <int>1</int>
            <endPoint>
              <deviceClass>
                <basicDeviceClass>ROUTING_SLAVE</basicDeviceClass>
                <genericDeviceClass>BINARY_SWITCH</genericDeviceClass>
                <specificDeviceClass>POWER_SWITCH_BINARY</specificDeviceClass>
              </deviceClass>
              <endpointId>1</endpointId>
              <supportedCommandClasses>
                <entry>
                  <commandClass>BASIC</commandClass>
                  <basicCommandClass>
                    <version>0</version>
                    <instances>0</instances>
                    <isGetSupported>true</isGetSupported>
                  </basicCommandClass>
                </entry>
                <entry>
                  <commandClass>SWITCH_BINARY</commandClass>
                  <binarySwitchCommandClass>
                    <version>1</version>
                    <instances>1</instances>
                    <isGetSupported>true</isGetSupported>
                  </binarySwitchCommandClass>
                </entry>
              </supportedCommandClasses>
            </endPoint>
          </entry>
          <entry>
            <int>2</int>
            <endPoint>
              <deviceClass>
                <basicDeviceClass>ROUTING_SLAVE</basicDeviceClass>
                <genericDeviceClass>BINARY_SWITCH</genericDeviceClass>
                <specificDeviceClass>POWER_SWITCH_BINARY</specificDeviceClass>
              </deviceClass>
              <endpointId>2</endpointId>
              <supportedCommandClasses>
                <entry>
                  <commandClass>BASIC</commandClass>
                  <basicCommandClass>
                    <version>0</version>
                    <instances>0</instances>
                    <isGetSupported>true</isGetSupported>
                  </basicCommandClass>
                </entry>
                <entry>
                  <commandClass>SWITCH_BINARY</commandClass>
                  <binarySwitchCommandClass>
                    <version>1</version>
                    <instances>1</instances>
                    <isGetSupported>true</isGetSupported>
                  </binarySwitchCommandClass>
                </entry>
              </supportedCommandClasses>
            </endPoint>
          </entry>
        </endpoints>
        <endpointsAreTheSameDeviceClass>true</endpointsAreTheSameDeviceClass>
      </multiInstanceCommandClass>
    </entry>
    <entry>
      <commandClass>SWITCH_ALL</commandClass>
      <switchAllCommandClass>
        <version>1</version>
        <instances>1</instances>
        <isGetSupported>true</isGetSupported>
        <mode>SWITCH_ALL_INCLUDE_ON_OFF</mode>
      </switchAllCommandClass>
    </entry>
    <entry>
      <commandClass>BASIC</commandClass>
      <basicCommandClass>
        <version>1</version>
        <instances>1</instances>
        <isGetSupported>true</isGetSupported>
      </basicCommandClass>
    </entry>
    <entry>
      <commandClass>VERSION</commandClass>
      <versionCommandClass>
        <version>1</version>
        <instances>1</instances>
        <libraryType>LIB_SLAVE_ENHANCED</libraryType>
        <protocolVersion>3.52</protocolVersion>
        <applicationVersion>2.2</applicationVersion>
      </versionCommandClass>
    </entry>
    <entry>
      <commandClass>MANUFACTURER_SPECIFIC</commandClass>
      <manufacturerSpecificCommandClass>
        <version>1</version>
        <instances>1</instances>
      </manufacturerSpecificCommandClass>
    </entry>
    <entry>
      <commandClass>NO_OPERATION</commandClass>
      <noOperationCommandClass>
        <version>1</version>
        <instances>1</instances>
      </noOperationCommandClass>
    </entry>
    <entry>
      <commandClass>SWITCH_BINARY</commandClass>
      <binarySwitchCommandClass>
        <version>1</version>
        <instances>1</instances>
        <isGetSupported>true</isGetSupported>
      </binarySwitchCommandClass>
    </entry>
  </supportedCommandClasses>
  <nodeNeighbors>
    <int>1</int>
  </nodeNeighbors>
  <lastSent>2016-05-13 18:35:01.394 UTC</lastSent>
  <lastReceived>2016-05-13 18:35:01.456 UTC</lastReceived>
</node>

The fibaro is working now, if input1 gets powered, relay1 will be closed. Thats nice if openHAB is down, but I want some more control.
Is it possible to override the state of the relay? Or can I somehow catch the command coming from input going to the relay?

It’s unclear what you’re looking for, please explain better.
Do you want openhab to just switch lights during certain hours, but motion detectors fire all day long ?

If you connect the motion detectors like switches (to inputs I1 and I2), then they’ll turn on the lights on when they detect and back off when they time out.
But that’s just as they would do if there wasn’t any relay inbetween. The only difference would be that you get the switching info into openhab so you see light state and detector events there, and you could also use the OH GUI to switch lights manually.

Generally speaking, local switching takes precedence, you cannot ‘catch’ the electric command.
If it’s about switching during certain hours only, then there’s different possibilities:

  1. write a rule that triggers on input state changes (i.e. motion detector firing) and turn lamps back off during times when you don’t want them to turn on.
    (you need two items if you attach the lights to O1 and O2 outputs:
    Switch OutdoorLamp “outdoor lamp on FGS-222 out port 1” {zwave=“2:1”}
    Switch LampPost “lamp post on FGS-222 out port 2” {zwave=“2:2”}

  2. buy a zwave motion detector instead locally attaching yours, plus use the rule from 1)

  3. you could attach your detector to FGS-222 input I1 and BOTH lamps to output O2, so you have a blind output O1, plus use the rule from 1). But then you obviously cannot switch the lights independently.

Sorry if I was not clear about what I am looking for, I will try to explain it again.
But if I read your answer, I think what I want is not possible, or not the correct way.

-During daytime (when there is enough daylight), I want both the relays (output1 and output2), to stay turned off.
-During nighttime (when it is dark), I want output 1 to be turned on from sunset till midnight.
-When it is dark, and motion is detected (using the motion detector on input 1), i want both outputs to turn on, and stay on for 5 minutes.

So the following happens:

  • when there is daylight, the outputs never switch on
  • when it is dark, and before midnight, output1 will be on
  • when it is dark, and before midnight, and motion is detected, output2 will turn on
  • when it is dark, and before midnight, and motion is detected, both outputs will turn on

I considered buying a zwave motion detector, but found a lot of posts complaining about these detectors. So I decided to use a normal outdoor motion detector, and connect it to an zwave input.

If I want to use your possibility 1, will this rule be ‘fast’ enough? Will the light be switched off in time, or will it blink for a short time?

It’ll blink, thus no good idea.

zwave motion detectors are fine in general (and a better idea than your construction), just the Aeotec one on battery is a bad idea. But as you apparently have mains power where you want to place it, it has the option to power it from mains, too, then it’s working well.

As you want a time based logic that only the OH server can implement, you need a second zwave device, so logically, you have one sensor and one (or more) actor and the OH server inbetween to decide whether and when to forward the signal.
So either get a zwave motion detector or another zwave relay (or binary sensor) and attach your classic motion detector there.
My proposal #3 virtually splits your (single) relay into two halves, a sensor and a actor one.

Thanks for your help and explanation.

The dual relay apparently is not what I expected it to be, so I need something else.

I now have the following motion detector: http://www.steinel.de/Motion-Detectors/oxid/105082306.html

I will continue my project with some additional hardware, thanks!