Announcement

Collapse
No announcement yet.

Shelly, Sonoff and Tuya power monitoring devices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Shelly, Sonoff and Tuya power monitoring devices

    I have accumulated a variety of smartplugs/adapters that have power monitoring capability. Those that I am discussing here are rated at 16 Amps and have one channel of power monitoring. The Shelly 1PM, Slitinto NX-SP201, BNLink BNC-60 and Sonoff S31 were all obtained from Amazon. From the factory each provides a setup oriented to their proprietary smartphone app.

    I do not know for certain, but I believe the CPU Tuya plugin https://forums.homeseer.com/forum/3r...iedra-software will be able to communicate with the Tuya firmware in the Slitinto and BNLink and achieve non-cloud control. The Shelly 1PM is natively more DIY-friendly with local HTTP and MQTT protocols. This device can be interfaced with AK Shelly https://forums.homeseer.com/forum/li...helly-alexbk66 or BIG5 https://forums.homeseer.com/forum/li.../big5-risquare using HTTP or any of the MQTT plugins such as mcsMQTT https://forums.homeseer.com/forum/li...chael-mcsharry using MQTT. The Sonoff S31 has no non-cloud integration solution using factory firmware.

    After some initial evaluation I installed Tasmota firmware in all the devices.

    I attempted to use the MQTT capability of the Shelly using factory firmware, but was not able it using the Shelly Android App. Shelly later informed me that MQTT cannot be enabled from the App, but only from a browser communicating with the web server running on the Shelly 1PM. I was going to go back and install the factory firmware to evaluate the factory MQTT implementation, but Shelly indicated that they do not provide the Shelly 1PM binary for user flashing.

    The Shelly and Tuya devices have glued cases so not possible to open them and then close them without some damage to the case. Shelly provides an access port to make changing firmware easy. Tuya devices were flashed without opening the cases using Tuya Convert. Future versions of Tuya factory firmware may not allow use of Tuya Convert. The Sonoff S31 is a snap-fit case that is easy to disassemble and reassemble. The through-hole connections for flashing are well labeled and flashing was not difficult.

    I have seen HLW8012/BL0897 as the power monitoring chip in the Tuya devices. Sonoff S31 uses CSE7766 which provides more stable readings. I was not able to find schematic for Shelly 1PM so not certain what power monitoring device is installed, but likely the HLW8012 since Tasmota operates the same with it and the Tuya devices.

    I did not find any calibration mechanisms with the factory firmware. I did not test the Tuya or Sonnoff devices before installing Tasmota, but I did test the Shelly 1PM. The Shelly was reporting about 5% less power use than what showing on my meter. With different frequencies and voltages all over the world I suspect that the factory just calibrated so some happy medium. Tasmota does provide calibration capability so for those that care about actual power, current and voltage levels then Tasmota becomes a good avenue.

    The Shelly and Tuya firmware do provide for accumulation of energy use totals. Both provide this capability by letting the cloud server accumulate the individual readings. In the Shelly 1PM case this is still true so the Shelly 1PM will not accumulate total power usage even when using its non-cloud HTTP or MQTT servers. Of course one can setup their own local database, but this adds a complexity. Tasmota firmware uses internal flash to store the accumulated power. As long as the same appliance is connected to the plug then this provides a good way to view total power use. The total can be reset in Tasmota so the device can be moved to another appliance and accounting restarted.

    All firmwares provide instantaneous power readings with cycles times dependent upon the internal polling rates. Tasmota uses 200 millisecond interval for its readings. I was surprised when I first looked at the reporting from the Shelly as it was very high and then in a few seconds stabilized. It looks like the Shelly has some filtering to smooth out the reported power. I am not able to tell if this filtering was done in the cloud or done in the device. It was something I wanted to test, but not able to reload the firmware for the test.

    Another good automation use of power monitoring plugs/adapters is to detect patterns of consumption. Detection of these patterns can then be used as event triggers. For example, it is easy to monitor the energy use of a washing machine to detect which part of the wash cycle it is in and in my case when the spin cycle has completed. Tasmota rules do really well for the pattern matching/event trigger capability.

    What is common for all these devices is that digital ground and mains ground share a common circuit with the power monitoring chip. This means that one should not even try to take advantage of other GPIO on the ESP8266/ESP8265 for some DIY enhancements. It is just not safe to have hot ground connected to anything outside the case.


    #2
    Hi Michael,

    Just came across this post looking for information on cost effective energy monitoring options for homeseer at the plug level. I have a whole panel Aeotec home energy monitor for the whole house but I want better resolution to audit where my wattages on each leg are going to when everything seems to be off i still have about 200 watts of idle power in use according to the whole home meter.

    I just ordered 2 sonoff S31 outlets on amazon and I'm already using your mcsMQTT plugin for a wink relay integration. Do you have a link to a guide on flashing the SONOFF S31 outlets to Tasmota and more about what Tasmota is and then how to integrate them as devices in Homeseer.

    A lot of the posts I'm finding discuss that this is possible but make a lot of assumptions about the readers knowledge level as if they've already got the plugs integrated or flashed for example.

    I've looked at a few ZigBee and zwave outlets with energy monitoring but they range from $50-100 CAD PER outlet. I just got 2 SONOFF S31's for $34 CAD on amazon shipped.

    Seeing as I want about 4-6 of these outlets for 2 fridges, computers, a network rack, and a few other high wattage devices, paying $50-100 per outlet is a non starter. It would take 5+ years of working in some automation to shut some of these things down at night just to save that cost of the outlets in power.

    So I'm looking in the $10-20 range per outlet max. These were $17CAD per. I had some TP-LINK outlets but they are just on/off with no energy monitoring. energy monitoring is the prime requirement.

    Any thoughts or advice?

    Thanks for making mcsMQTT and for making it FREE!

    Comment


      #3
      You can start here: https://tasmota.github.io/docs/Getting-Started/

      If you are starting from scratch you'll have to do some reading/testing but it's really worth it.

      These power monitoring plugs from Costco are 20$ in store (2-pack, 10$/each) and can be flashed with Tamsota OTA (no soldering - software only - Kali linux on a USB key does the trick if you are on windows ); Still available in store as of last week.

      https://www.costco.ca/ce-smart-home-...100476838.html

      using a number of these here. Works like a charm for 120V devices;
      240V applicances (clothes dryer, etc) is also possible for the same $ (+ basic soldering skills)


      Hope this helps,

      Yann

      Comment


        #4
        I good starter video on the S31 flashing with Tasmota is at https://www.digiblur.com/2018/11/sma...th-sonoff.html. If I recall correctly I used dupont cable pins inserted into the circuit board holes rather than soldering since I only needed a temporary connection.

        Get the latest version of Tasmota from https://github.com/arendst/Tasmota/releases. Looks like it is 9.2 now. tasmota.bin is the one you want.

        I use Tasmotizer as the flashing software. https://github.com/tasmota/tasmotizer You will find other flashing programs, but Tasmotizer makes is really easy.

        A few pointers.
        1. Never flash when 120V is applied to the plug
        2. Use 3.3V USB/FTDI voltage level and not 5V. Every adapter I have seen either has a jumper for the voltage level or two separate pins.
        3. Most problematic aspect of flashing is to assure GPIO is jumpered to ground at the time you apply 3.3V to the device. You only need to hold it for a few seconds.
        4. After flashing the WiFi credentials can be entered via serial USB/FTDI or can be done by connecting to device via browser after connection to the SSID being broadcast by the Sonoff device. I use laptop for the WiFi. I believe the YouTube video walks through this.

        Comment


          #5
          Originally posted by Michael McSharry View Post
          I good starter video on the S31 flashing with Tasmota is at https://www.digiblur.com/2018/11/sma...th-sonoff.html. If I recall correctly I used dupont cable pins inserted into the circuit board holes rather than soldering since I only needed a temporary connection.

          Get the latest version of Tasmota from https://github.com/arendst/Tasmota/releases. Looks like it is 9.2 now. tasmota.bin is the one you want.

          I use Tasmotizer as the flashing software. https://github.com/tasmota/tasmotizer You will find other flashing programs, but Tasmotizer makes is really easy.

          A few pointers.
          1. Never flash when 120V is applied to the plug
          2. Use 3.3V USB/FTDI voltage level and not 5V. Every adapter I have seen either has a jumper for the voltage level or two separate pins.
          3. Most problematic aspect of flashing is to assure GPIO is jumpered to ground at the time you apply 3.3V to the device. You only need to hold it for a few seconds.
          4. After flashing the WiFi credentials can be entered via serial USB/FTDI or can be done by connecting to device via browser after connection to the SSID being broadcast by the Sonoff device. I use laptop for the WiFi. I believe the YouTube video walks through this.
          Nice!

          I happened to buy a FTDI adapter a few weeks back to try to root my wink hub to make use of the lutron radio in it for my caeseta switches. So I can use it for this as well. It has the 3.3v/5v jumper and I saw a few videos on flashing the SONOFF S31's this afternoon. Seems pretty straight forward to flash them, get them on your wifi, and then enable mqtt via browser. After that just have to associate them with mcsMQTT I guess?

          Comment


            #6
            Looks like you have done your homework. If you have further questions about use of mcsMQTT then better to open a thread in that forum to continue the discussion.

            Comment

            Working...
            X