Shelly 3EM goes Homematic - with original Firmware

    • Offizieller Beitrag

    Hello Homematic Friends,

    finally the time comes, the integration of Shelly 3EM in the HomeMatic. The Shelly 3EM was a long time coming!

    To integrate the Shelly 3EM 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.)


    I implemented the following functions on the Homematic page:

    • ON / OFF
    • Update of the currently switching state in a freely adjustable interval, regardless of whether the operation is via Homematic or Shelly app or button
    • Optional monitoring of the online status (accessibility via WLAN)
    • Optional monitoring of currently power (W) per phase
    • Optional monitoring of currently voltage (V) per phase
    • Optional monitoring of currenty current (A) per phase
    • Optional monitoring of currently total consumed Energy (kWh) per phase
    • Optional monitoring of currently consumed total Energy (kWh)


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

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


    A view to the connection:

    Shelly 3EM Ansicht2.png

    Picture 1

    Note!

    At this point I would like to point out, based on the amount of measurement data, that it is also possible to "sort" the individual electrical quantities in separate CUxD device channels. On / off has no function there!

    You only have to make sure that the channels of the "CUxD (40) 16-channel universal control as switch" are assigned accordingly in the system variables and the scripts !!!


    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

    (I use a free channel of the remote control of the Shelly EM!)

    CUxD (40) als Schalter.png

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


    The settings of the channels:

    The Shelly 3EM has two measuring channels to which two transducers can be connected.

    Attention !: However, only one relay / switching output is integrated to control an external controls. When creating scenes or actions, the correct channel selection must be observed!

    Shelly 3EM Schaltaktor.png

    SWITCH|CMD_EXEC: Check mark!

    Settings for SWITCH|CMD_SHORT:

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

    Settings for SWITCH|CMD_LONG:

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

    Adapt the IP address of the Shelly 3EM in each case!


    This makes the Shelly 3EM ready for use and can be switched on and off. :)

    ____________________________________________________________

    The instructions including the scripts and pictures are subject to copyright. Who violates the copyright (for example, images or texts illegally copied and published on other websites), makes itself gem. §§ 106 ff UrhG punishable, can also be warned with costs and must pay damages (§ 97 UrhG).

    © 2020 SparkyMaster

    • Offizieller Beitrag

    Update the switch-state

    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.


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

    Shelly 3EM Timer.png

    Update every 60 seconds (time variable)


    ... that triggers the update program:

    Shelly 3EM Programm2.png

    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 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


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

    ____________________________________________________________

    The instructions including the scripts and pictures are subject to copyright. Who violates the copyright (for example, images or texts illegally copied and published on other websites), makes itself gem. §§ 106 ff UrhG punishable, can also be warned with costs and must pay damages (§ 97 UrhG).

    © 2020 SparkyMaster

    • Offizieller Beitrag

    Optional ads:

    1.) 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:

    Shelly 3EM Onlinestatus.png

    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 EM can be monitored. Of course, a free channel of an existing CUxD ping can be used.

    Shelly 3EM Ping.png

    Adjust IP!

    Settings for: SWITCH|CMD_EXEC_TRUE:

    Code
    extra/timer.tcl Onlinestatus_Shelly3EM_Hauptzaehler 1

    Settings for SWITCH|CMD_EXEC_FALSE:

    Code
    extra/timer.tcl Onlinestatus_Shelly3EM_Hauptzaehler 0

    Adapt the name of the system variable in each case! (here:Onlinestatus_Shelly3EM_Hauptzaehler)


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


    2.) currently power display:

    evaluates the power of the Shelly 3EM channels, displays it in the CUxD device and of course the value can also be used in programs.

    For this we need 3 system variable (per Phase) for the currently power value:

    Shelly 3EM SysPower.png

    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 power data.

    Attention:

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

    The script for this:

    Adapt the name of the system variable in each case! (here:Shelly_3EM_Hauptzaehler_Leistung1)

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

    IP of the Shelly 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


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


    3.) currently voltage display:

    evaluates the voltage of the Shelly 3EM, displays it in the CUxD device and of course the value can also be used in programs.


    For this we need 3 system variable (per Phase) for the currently voltage value:

    Shelly 3EM SysVoltage.png

    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 3rd THEN line to update the voltage data.

    Attention:

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

    The script for this:

    Adapt the name of the system variable in each case! (here:Shelly_3EM_Hauptzaehler_Spannung1)

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

    IP of the Shelly 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


    In the set interval of the timer, the currently voltage is now updated. :)


    4. currently current display:

    evaluates the current of the Shelly 3EM channels, displays it in the CUxD device and of course the value can also be used in programs.


    For this we need 3 system variable (per Phase) for the currently current value:

    Shelly 3EM SysStrom.png

    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 4th THEN line to update the current data.

    Attention:

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

    The script for this:

    Adapt the name of the system variable in each case! (here:Shelly_3EM_Hauptzaehler_Strom1)

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

    IP of the Shelly 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


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


    5. currently total consumed energy display:

    evaluates the total consumed energy of the Shelly 3EM channels, displays it in the CUxD device and of course the value can also be used in programs.

    For this we need 3 system variable (per Phase) for the currently total consumed Energy:

    Shelly 3EM SysBezug.png

    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 5th THEN line to update the total consumed energy data.

    Attention:

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

    The script for this: (Stefan (66er), thank you for the help and support!)

    Adapt the name of the system variable in each case! (here:Shelly_3EM_Hauptzaehler_Energie1_Bezug)

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

    IP of the Shelly 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


    In the set interval of the timer, the total consumed energy is now updated. :)


    ____________________________________________________________

    The instructions including the scripts and pictures are subject to copyright. Who violates the copyright (for example, images or texts illegally copied and published on other websites), makes itself gem. §§ 106 ff UrhG punishable, can also be warned with costs and must pay damages (§ 97 UrhG).

    © 2020 SparkyMaster

  • SparkyMaster 18. Februar 2020 um 13:05

    Hat das Thema freigeschaltet.
    • Offizieller Beitrag

    6. currently consumed total energy display:

    evaluates the consumed total energy of the Shelly 3EM channels (total of all 3 channels), 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 currently total consumed Energy:

    Shelly 3EM SysBezugGesamt.png

    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 6th THEN line to update the consumed total energy data.

    Attention:

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

    The script for this: (Stefan (66er), thank you for the help and support!)

    Adapt the name of the system variable in each case!

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

    IP of the Shelly 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


    In the set interval of the timer, the consumed total energy is now updated. :)


    ____________________________________________________________

    The instructions including the scripts and pictures are subject to copyright. Who violates the copyright (for example, images or texts illegally copied and published on other websites), makes itself gem. §§ 106 ff UrhG punishable, can also be warned with costs and must pay damages (§ 97 UrhG).

    © 2020 SparkyMaster

    • Offizieller Beitrag

    7. currently total returned energy display:

    evaluates the total returned energy (Photovoltaik) of the Shelly 3EM channels, displays it in the CUxD device and of course the value can also be used in programs.

    For this we need 3 system variable (per Phase) for the currently total returned Energy:

    Shelly 3EM SysEinspeisung.png

    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 7th THEN line to update the total returned energy data.

    Attention:

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

    The script for this:

    Adapt the name of the system variable in each case! (here: Shelly_3EM_Hauptzaehler_Energie_Einspeisung1)
    According to the instructions in the script have to be adapted:

    IP of the Shelly 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


    In the set interval of the timer, the total returned energy is now updated. :)


    8. currently total returned energy display:

    evaluates the total returned energy (Photovoltaik) of the Shelly 3EM channels (total of all 3 channels), 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 currently total returned energy:

    Shelly 3EM SysEinspeisungGesamt.png

    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 8th THEN line to update the consumed total returned energy data.

    Attention:

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

    The script for this:

    Adapt the name of the system variable in each case! (here: Shelly_3EM_Hauptzaehler_Energie_EinspeisungGesamt)

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

    IP of the Shelly 3EM

    CUxD Exec channel

    CUxD channel of the Shelly 3EM


    In the set interval of the timer, the total returned energy is now updated. :)


    ____________________________________________________________

    The instructions including the scripts and pictures are subject to copyright. Who violates the copyright (for example, images or texts illegally copied and published on other websites), makes itself gem. §§ 106 ff UrhG punishable, can also be warned with costs and must pay damages (§ 97 UrhG).

    © 2020 SparkyMaster