Software

Home Automation

Logitech Harmony with ioBroker

Install the Fakeroku Adapter in ioBroker

Switch to the adapter tab and search for fakeroku to find and install the Fakeroku Emulator. Once installed configure the adapter to use your host machines IPv4 interface (Do not leave it a 0.0.0.0 !) - the adapter will display your hosts IP address. In my case this is 192.168.2.111. You can leave the multicast IP, device name and service port at their default values:

Logitech Harmony MQTT Control with ioBroker

You can now switch back to the general tutorial to add the virtual device to your Logitech Harmony Hub.

INSTAR MQTT Setup

The Fakeroku virtual device will now give you access to the following buttons on your Harmony Remote:

Logitech Harmony MQTT Control with ioBroker

For example Button 1 will send the payload string Rev to Node-RED when you press it.

Logitech Harmony MQTT Control with ioBroker

Press all available buttons and refresh the ioBroker Object Tree to see the objects that we can now start to work with:

  1. Rev - Unused
  2. Play - Start a x Second Video Recording
  3. Fwd - Unused
  4. Home - Deactivate the Alarm
  5. Up - Move Camera Up by one Step
  6. Right - Move Camera Right by one Step
  7. Down - Move Camera Down by one Step
  8. Left - Move Camera Left by one Step
  9. Select - Stop Camera Movement
  10. Back - Activate the Alarm
  11. Info - Trigger enabled Alarm Actions

We now need to add an adapter that allows us to write a script so we can trigger an MQTT update for our camera when we receive a message from our Harmony Remote. I would recommend to use the Node-RED Adapter in ioBroker. Once you have it set up you can continue using our Node-RED tutorial to connect your camera (see also INSTAR MQTT & Node-RED):

Logitech Harmony MQTT Control with ioBroker

Alternatively, you can install the Script Engine Adapter and use Blockly to do the work:

Logitech Harmony MQTT Control with ioBroker

Logitech Harmony MQTT Control with ioBroker

Here you can now import the JSON code from the end of this article to add the following code blocks:

Logitech Harmony MQTT Control with ioBroker

Pan & Tilt your Camera

This sequence listens to the Up, Right, Down and Left button and updates the according "One-Step" MQTT Topics on your camera:

Logitech Harmony MQTT Control with Node-RED

Schalten Sie Ihren Alarm scharf, bevor Sie Ihr Haus verlassen

Diese Sequenz aktiviert/deaktiviert den Alarm auf Ihrer Kamera. Wenn sie scharf gestellt ist, behält Ihre Kamera Ihr Wohnzimmer im Auge. Wenn der Alarm deaktiviert wird, dreht sich die Kamera zur Seite und deaktiviert alle Bewegungserkennungsbereiche. Hinweis: Wenn Sie den kamerainternen PIR-Bewegungssensor in Kombination mit diesen Erfassungsbereichen verwenden, müssen Sie den Sensor ebenfalls deaktivieren, damit dies funktioniert:

Logitech Harmony MQTT Control with Node-RED

Arm your Alarm before your leave your Home

This sequence defines an armed and disarmed state for your camera. When armed your camera will keep an eye on your living room. When disarmed your camera will turn away and deactivates all motion detection areas. Note that if you are using the camera's internal PIR motion sensor in combination with those detection areas, you will have to deactivate the sensor as well for this to work:

Logitech Harmony MQTT Control with Node-RED

Start a Manual Video Recording

This sequence enables you to start a manual video recording when pressing the Play button on your remote. Note that the delay node is currently set to 30s - you can adjust the length of your according by changing this value.

Trigger an Alarm

And now to the simplest sequence of this flow. Pressing the Info button will trigger an alarm on your camera. This event will trigger all active alarm actions on your camera - like vide recordings, email notifications, FTP uploads, etc.:

Logitech Harmony MQTT Control with Node-RED

Conclusion

This is just a small overview over all the available MQTT Topics on your camera. All of them can be send and combined with a press of a button on your Logitech Harmony Remote. More information for using the INSTAR MQTT interface with ioBroker can be found in our full tutorial.

Blockly JSON Export

<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="comment" id="8^U1_,dk,ef6^t^|JZ;+" x="-38" y="-113">
    <field name="COMMENT">Pan&amp;Tilt</field>
    <next>
      <block type="on_ext" id="L[B8uguVD|3@=nC}NO~3">
        <mutation items="1"></mutation>
        <field name="CONDITION">ge</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
          <shadow type="field_oid" id="qQHP{$c4InRp$o6vp@BB">
            <field name="oid">fakeroku.0.ioBroker.keys.Up</field>
          </shadow>
        </value>
        <statement name="STATEMENT">
          <block type="control" id="g@M?e*b1_8ezO{_(PUcP">
            <mutation delay_input="false"></mutation>
            <field name="OID">mqtt.0.instar.local.features.ptz.movestep.raw</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="text" id="u2H{{k$7nO+({(J4,2,C">
                <field name="TEXT">up</field>
              </block>
            </value>
          </block>
        </statement>
        <next>
          <block type="on_ext" id="e}$7(hV3E%Bx9}kmKFca">
            <mutation items="1"></mutation>
            <field name="CONDITION">gt</field>
            <field name="ACK_CONDITION"></field>
            <value name="OID0">
              <shadow type="field_oid" id="@+%)|7?Tc?G=;j(`i@PX">
                <field name="oid">fakeroku.0.ioBroker.keys.Down</field>
              </shadow>
            </value>
            <statement name="STATEMENT">
              <block type="control" id="d|K@:1dO!{[K{LTTP0mj">
                <mutation delay_input="false"></mutation>
                <field name="OID">mqtt.0.instar.local.features.ptz.movestep.raw</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="text" id="2b.9ZC^jUqK49w{Advj=">
                    <field name="TEXT">down</field>
                  </block>
                </value>
              </block>
            </statement>
            <next>
              <block type="on_ext" id="44Fs~A5pQ8,*n#TG]ogM">
                <mutation items="1"></mutation>
                <field name="CONDITION">gt</field>
                <field name="ACK_CONDITION"></field>
                <value name="OID0">
                  <shadow type="field_oid" id="-nPyi);a$Bo}fA5$S.|w">
                    <field name="oid">fakeroku.0.ioBroker.keys.Left</field>
                  </shadow>
                </value>
                <statement name="STATEMENT">
                  <block type="control" id="jip7o1U:49HL|mJ}*`;t">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">mqtt.0.instar.local.features.ptz.movestep.raw</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="text" id="~q*ow@aD`6;OXnXp9_#]">
                        <field name="TEXT">left</field>
                      </block>
                    </value>
                  </block>
                </statement>
                <next>
                  <block type="on_ext" id="S%mT*RL0iur1u/~URa5T">
                    <mutation items="1"></mutation>
                    <field name="CONDITION">gt</field>
                    <field name="ACK_CONDITION"></field>
                    <value name="OID0">
                      <shadow type="field_oid" id="QQ|X]mXDJ1nlt~X8X*I/">
                        <field name="oid">fakeroku.0.ioBroker.keys.Right</field>
                      </shadow>
                    </value>
                    <statement name="STATEMENT">
                      <block type="control" id="7hy/D$Kc;6J47RUilQXM">
                        <mutation delay_input="false"></mutation>
                        <field name="OID">mqtt.0.instar.local.features.ptz.movestep.raw</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="text" id="#-yvwy4/W(Iv?-S9Mv^+">
                            <field name="TEXT">right</field>
                          </block>
                        </value>
                      </block>
                    </statement>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </next>
  </block>
  <block type="comment" id="!5:tmZx6,dztS)h%[*8u" x="613" y="-113">
    <field name="COMMENT">Armed/Disarmed</field>
    <next>
      <block type="on_ext" id="i!23)Yl3-5$$.sejbmp_">
        <mutation items="1"></mutation>
        <field name="CONDITION">gt</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
          <shadow type="field_oid" id="tzCjnGT_Ez(9hR};yXOF">
            <field name="oid">fakeroku.0.ioBroker.keys.Home</field>
          </shadow>
        </value>
        <statement name="STATEMENT">
          <block type="control" id="Vk{M_q)$w9t*Mz/zy2RA">
            <mutation delay_input="false"></mutation>
            <field name="OID">mqtt.0.instar.local.features.ptz.preset.raw</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="text" id="A)LBw=FpoE6Y[vPX;O!!">
                <field name="TEXT">0</field>
              </block>
            </value>
            <next>
              <block type="control" id="tS~GsJye~?T(JP;6Gb#i">
                <mutation delay_input="false"></mutation>
                <field name="OID">mqtt.0.instar.local.alarm.area1.enable.raw</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="text" id="mux/WG[~#y7c,dRz.r@0">
                    <field name="TEXT">0</field>
                  </block>
                </value>
                <next>
                  <block type="control" id="F5Nz|ow2PC3:9%QcrAu6">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">mqtt.0.instar.local.alarm.area2.enable.raw</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="text" id="6a:*b1o-q.[T3d(pWU[r">
                        <field name="TEXT">0</field>
                      </block>
                    </value>
                    <next>
                      <block type="control" id="qthuoOsu2lMx-+!J`-b`">
                        <mutation delay_input="false"></mutation>
                        <field name="OID">mqtt.0.instar.local.alarm.area3.enable.raw</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="text" id="{()9t/y6#0Sm0OAKoC3T">
                            <field name="TEXT">0</field>
                          </block>
                        </value>
                        <next>
                          <block type="control" id="s=Sq;fBh=fA8f[#:I-h}">
                            <mutation delay_input="false"></mutation>
                            <field name="OID">mqtt.0.instar.local.alarm.area4.enable.raw</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="text" id="!1-dhH:@0^h?U[^FEV)D">
                                <field name="TEXT">0</field>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </statement>
        <next>
          <block type="on_ext" id="KQOr`fV9fb|5u$J#Afs|">
            <mutation items="1"></mutation>
            <field name="CONDITION">gt</field>
            <field name="ACK_CONDITION"></field>
            <value name="OID0">
              <shadow type="field_oid" id="B?-au^pP[51TLqvw:;3_">
                <field name="oid">fakeroku.0.ioBroker.keys.Back</field>
              </shadow>
            </value>
            <statement name="STATEMENT">
              <block type="control" id="tcQJu_~KY^*xk+LMclxe">
                <mutation delay_input="false"></mutation>
                <field name="OID">mqtt.0.instar.local.features.ptz.preset.raw</field>
                <field name="WITH_DELAY">FALSE</field>
                <value name="VALUE">
                  <block type="text" id="RUTkXYszfDj__Z_xLRP]">
                    <field name="TEXT">1</field>
                  </block>
                </value>
                <next>
                  <block type="control" id=".nqhS?=t]X?:Iw*N;yi8">
                    <mutation delay_input="false"></mutation>
                    <field name="OID">mqtt.0.instar.local.alarm.area1.enable.raw</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="text" id="H`Irv[C~yr]D.(Dud,s!">
                        <field name="TEXT">1</field>
                      </block>
                    </value>
                    <next>
                      <block type="control" id="{@T2R}:y[tVE3RmDJGyZ">
                        <mutation delay_input="false"></mutation>
                        <field name="OID">mqtt.0.instar.local.alarm.area2.enable.raw</field>
                        <field name="WITH_DELAY">FALSE</field>
                        <value name="VALUE">
                          <block type="text" id="f72fIjd@pgEmbpkN*wRD">
                            <field name="TEXT">1</field>
                          </block>
                        </value>
                        <next>
                          <block type="control" id="X[d_,-{4-?HtN_u^.lpo">
                            <mutation delay_input="false"></mutation>
                            <field name="OID">mqtt.0.instar.local.alarm.area3.enable.raw</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="text" id="Y@n%b]+$BX2m|?6H;i(*">
                                <field name="TEXT">1</field>
                              </block>
                            </value>
                            <next>
                              <block type="control" id="g6;}H)hk]Ln(@8fJMVFm">
                                <mutation delay_input="false"></mutation>
                                <field name="OID">mqtt.0.instar.local.alarm.area4.enable.raw</field>
                                <field name="WITH_DELAY">FALSE</field>
                                <value name="VALUE">
                                  <block type="text" id="=^gtJ-l7v-sKpl7r{:Js">
                                    <field name="TEXT">1</field>
                                  </block>
                                </value>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </statement>
          </block>
        </next>
      </block>
    </next>
  </block>
  <block type="comment" id="Ej}EwLZxa*uxjJp@h`x3" x="-37" y="463">
    <field name="COMMENT">Manual Recording</field>
    <next>
      <block type="on_ext" id="lT^wG1zJA[jTZ}seS1X?">
        <mutation items="1"></mutation>
        <field name="CONDITION">ge</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
          <shadow type="field_oid" id="$:sE0PF+cj*=@nWe$mDw">
            <field name="oid">fakeroku.0.ioBroker.keys.Play</field>
          </shadow>
        </value>
        <statement name="STATEMENT">
          <block type="control" id="k,*ua/iJiGU=kKMK9aNN">
            <mutation delay_input="false"></mutation>
            <field name="OID">mqtt.0.instar.local.features.manualrec.start.raw</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="text" id="{WUob~?`ZYTi{y/a1!Zm">
                <field name="TEXT">60</field>
              </block>
            </value>
            <next>
              <block type="control" id="=-sj.d3H/rmDw+{LNgp}">
                <mutation delay_input="true"></mutation>
                <field name="OID">mqtt.0.instar.local.features.manualrec.stop.raw</field>
                <field name="WITH_DELAY">TRUE</field>
                <field name="DELAY_MS">30</field>
                <field name="UNIT">sec</field>
                <field name="CLEAR_RUNNING">FALSE</field>
                <value name="VALUE">
                  <block type="text" id="#q3EP{m}T6$=|Jh9dT*f">
                    <field name="TEXT">off</field>
                  </block>
                </value>
              </block>
            </next>
          </block>
        </statement>
      </block>
    </next>
  </block>
  <block type="comment" id="J]FEoC33xQY(@kf;+wMz" x="-38" y="687">
    <field name="COMMENT">Trigger Alarm</field>
    <next>
      <block type="on_ext" id="Hdx}6@U[djCs$6ChcSO?">
        <mutation items="1"></mutation>
        <field name="CONDITION">ge</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
          <shadow type="field_oid" id="H$d@+hd{G*}azTCiGg%$">
            <field name="oid">fakeroku.0.ioBroker.keys.Info</field>
          </shadow>
        </value>
        <statement name="STATEMENT">
          <block type="control" id="_jUfMn2vQn#qO7bPWU2#">
            <mutation delay_input="false"></mutation>
            <field name="OID">mqtt.0.instar.local.alarm.pushalarm.raw</field>
            <field name="WITH_DELAY">FALSE</field>
            <value name="VALUE">
              <block type="text" id="32?hPl+U(C[i:2hzhWdP">
                <field name="TEXT">1</field>
              </block>
            </value>
          </block>
        </statement>
      </block>
    </next>
  </block>
</xml>
INSTAR Forum

Discuss this article on the INSTAR Forum !