Shelly Plug-S goes Homematic - with original Firmware

    • Offizieller Beitrag
    • Autor


    © 2019 Stefan K. (aka 66er) - detailed information about this at the end of the manual (#3)


    Hello everybody,


    to integrate the Shelly PlugS into Homematic, you do not need any third-party firmware, that you have to flash.


    Below my solution with the original firmware:


    techn. Requirements:

    • compatible with the homematic systems CCU2, CCU3, Charly, as well as all offshoots like RaspberryMatic and piVCCU.
    • installed add-on CUxD in current version

    (The knowledge about the handling CUxD, such as devices create, I assume at this point, otherwise "exploded" this guide Thank you for understanding.)


    The advantages from my point of view:

    • very cheap price (19,90 €) compared to the Homematic original (from 39,95 € as a kit with LM)
    • all Shelly PlugS properties are preserved as I operate the actuators with the original manufacturer firmware
    • all future Shelly2.5 updates / updates will be usable
    • Full Shelly app usability in parallel with homematic automation
    • Operation as local solution or via Shelly-Cloud, additionally Homematic


    I implemented the following functions on the Homematic page:

    • ON OFF
    • Update of the current switching state in a freely adjustable interval, regardless of whether the operation is via Homematic or Shelly app or button
    • alternatively: status via action functions of the Shelly Plug S
    • Optional monitoring of the online status (accessibility via WLAN)

    A view to the connection:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    Picture 1

    I would like to recommend you to take a look at these threads before the implementation:

    • Important notes on the Shelly couplings on Homematic
    • Actions vs. Status queries in the Shelly couplings

    (I'm sorry, both is only written in German postings at this time. If possible, i'll translate them. I need some time for this)

    At the appropriate place in the manual, everyone has to decide for themselves which route the switching status monitor wants to use. ;)


    The implementation:


    (On the description of the creation of the CUxD devices I give up at this point, of course there is the CUxD document!)

    If not yet available, please create a device (28) System Exec! Above that the commands are issued. (No entries are made in CUxD-Exec!)


    Creation of a CUxD (40) 16-channel universal control as a switch

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    With each channel of the CUxD device, 1 Shelly PlugS can be mapped.


    The settings of the channels:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    Settings for SWITCH|CMD_SHORT:

    Code
    wget -q -O - 'http://192.168.1.139/relay/0?turn~3doff'

    Settings for SWITCH|CMD_LONG:

    Code
    wget -q -O - 'http://192.168.1.139/relay/0?turn~3don'

    Adapt the IP address of the Shelly PlugS in each case!


    This makes the PlugS ready for use and can be switched on and off.

    :)


    Have fun with it.

    • Offizieller Beitrag
    • Autor

    Update the switch-state


    Since the introduction of "Actions" in the Shelly firmware, there are 2 status updating options (3 if combined).


    The update is important, so that in Homematic the switching state is also correct, if e.g. via the Shelly app;) Pros and cons are described in # 1 linked thread.


    A. (once) via Actions:


    Setting for: OUTPUT SWITCHED ON URL:

    Code
    http://<IP der CCU>:8181/x.exe?Antwort=dom.GetObject("CUxD.CUX4000010:1.SET_STATE").State(1)

    Setting for: OUTPUT SWITCHED OFF URL:

    Code
    http://<IP der CCU>:8181/x.exe?Antwort=dom.GetObject("CUxD.CUX4000010:1.SET_STATE").State(0)

    Each set the checkmark at "Enabled" and save with "SAVE"!

    In each case adapt the IP address of the Homematic central unit and the CUxD device address to your installation!


    The Shelly PlugS now updates the switching status of the CUxD device without resending commands to homematic page.


    B. (cyclic) via homematic center:


    For the autom. Updating the switching status we need 1 timer ...

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    Update every 60 seconds (time variable)


    ... that triggers the update program:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    Alternatively, in the IF, it is also possible to trigger on the "Timerevent" of the timer.

    Missing only the script for the 1st THEN line:

    According to the instructions in the script have to be adapted:

    IP of the Shelly PlugS  

    CUxD Exec channel

    CUxD channel of the PlugS


    C: combination of A and B:

    Combining A and B, one can benefit from the advantage of A, the direct feedback and the advantage of B, the cyclical update (if a call from A is lost or not processed).

    The update time (timer) can then be significantly higher, resulting in a reduction of network traffic.

    Now, the switching state of the PlugS is also updated in Homematic when switching via the app or Shelly scenes.:)

    Have fun with it.

    • Offizieller Beitrag
    • Autor

    Optional ads:


    1.) current power display:


    evaluates the performance of the Shelly PlugS, displays it in the CUxD device and of course the value can also be used in programs.


    For this we need 1 system variable for the current performance value:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    The variables are assigned to the corresponding channel of the Shelly CUxD device. This makes it visible as shown in Figure 1 in # 1.


    In the status updating program (see picture in # 2) we add a 2nd THEN line to update the performance data.


    Attention:

    The names of the system variables must not contain any "spaces" !

    The script for this:

    In the set interval of the timer, the current power is now updated. :)


    2. Online Status:


    As with all other couplings, the opt. display of the online status is also made using the system variable and CUxD ping device (28).


    To display the online status, 1 system variable is required:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    The variable is linked again to the corresponding channel of the CUxD device and thus displayed there.


    The online status is monitored and controlled by a CUxD ping channel. That, with 1 CUxd Ping device (28) up to 16 Shelly PlugS can be monitored. Of course, a free channel of an existing CUxD ping can be used.


    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    Adjust IP!


    Settings for: SWITCH|CMD_EXEC_TRUE:

    Code
    extra/timer.tcl Onlinestatus_Shelly-PlugS_Garage 1

    Settings for SWITCH|CMD_EXEC_FALSE:

    Code
    extra/timer.tcl Onlinestatus_Shelly-PlugS_Garage 0

    Adapt the name of the system variable in each case! (here:Onlinestatus_Shelly-PlugS_Garage)

    In the set interval of the timer, the online status is now updated. :)


    Have fun with it.


    ____________________________________________________________

    The instructions including the scripts and pictures are subject to copyright. Anyone who infringes the copyright (for example, pictures or texts illegally copied and published on other websites), according to §§ 106 ff UrhG punishable, can also be warned for a fee and must pay damages (§ 97 UrhG).


    © 2019 Stefan K. (aka 66er)

    All rights reserved