Announcement

Collapse
No announcement yet.

SONOFF S31 energy monitoring outlet with mcsMQTT and HS4 setup

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

    #16
    Installed Tasmota into S31 (Lite -has not energy monitoring)

    Click image for larger version  Name:	Capture0.PNG Views:	1 Size:	118.4 KB ID:	1455626

    Reset S31 and observed WiFi SSID of tasmota_xxx and connected to this SSID. Used browser to navigate to 192.168.4.1 (Tasmota page) and changed the AP1 SSID and AP1 to my local network values. Also changed Hostname to S31-113 to make identification easy. Clicked Save.

    Restored Laptop SSID to local network. Looked in Router DHCP table to see what IP was assigned to the S31-113 device. In this case it was 192.168.0.211. Use browser to navigate to this IP. Selected Configuration option, selected Configure Module, Selected Save.


    Click image for larger version  Name:	Capture4.PNG Views:	1 Size:	37.3 KB ID:	1455627

    Click image for larger version  Name:	Capture9.PNG Views:	0 Size:	15.9 KB ID:	1455779


    Returned to Configuration page and selected MQTT and entered the broker IP in Host text box. This was the IP of Homeseer in this case. Changed the Topic to be S31-113 and changed Full topic to remove prefix.

    Click image for larger version  Name:	Capture5.PNG Views:	1 Size:	48.5 KB ID:	1455628

    Selected Console and entered SetOption19 1 so that it will send info on topic homeasistant/.../config topic

    Click image for larger version  Name:	Capture1.PNG Views:	3 Size:	358.3 KB ID:	1455623


    Recognized that the topic being sent is S31-113 so when to HS mcsMQTT plugin, MQTT page, General tab and entered it on the Obsolete row with /# suffix



    Click image for larger version  Name:	Capture2.PNG Views:	1 Size:	6.8 KB ID:	1455624


    Observed on Association Tab and in HS Device Management that no S31-113 topics and devices exist.

    Cycled power on S31 so the homeassistant/.../config topic is broadcast and mcsMQTT will recognize the topics for configuration when the S31 report them.

    Observed in the Tasmota console that the homeassistant messages were delivered on power cycle.

    Click image for larger version  Name:	Capture7.PNG Views:	1 Size:	176.4 KB ID:	1455629

    Observed on Association Tab that S31 has reported after power cycle

    Click image for larger version  Name:	Capture2.PNG Views:	1 Size:	382.3 KB ID:	1455625


    Went to Tasmota Main page and used toggle button to change the relay from off to on so that a new MQTT message would be sent and HS device can be setup. Observed in HS that the power device existed and the state is ON

    Click image for larger version  Name:	Capture8.PNG Views:	1 Size:	107.4 KB ID:	1455630

    Went to Tasmota Configuration, Configure Logging and changed the reporting cycle from 300 seconds to 60 seconds so I do not need to wait 5 minutes for the energy devices to be created. This changes the update rate to every minute rather than every 5 minutes.

    Observed in HS the devices created

    Click image for larger version  Name:	Capture10.PNG Views:	0 Size:	105.3 KB ID:	1455780 Observed that no suffix existed on the sensor measurements. When to /deviceutility and Status Graphics tab of HS and added the Suffix and assured the decimal places was as desired.

    Click image for larger version  Name:	Capture11.PNG Views:	0 Size:	235.7 KB ID:	1455781 Observed on HS Devices page the formatted sensor status

    Click image for larger version  Name:	Capture13.PNG Views:	0 Size:	18.4 KB ID:	1455782

    I had expected the suffix to have automatically been set by homeassistant discovery so looked at the message and saw it in the message so now need to see why "A" was not automatically done. I was using the HS3 plugin for this sequence.

    Code:
    homeassistant/sensor/1B8996_ENERGY_Current/config
    
    {"name":"Tasmota ENERGY Current","stat_t":"S31-113/SENSOR","avty_t":"S31-113/LWT","pl_avail":"Online","pl_not_avail":"Offline","uniq_id": "1B8996_ENERGY_Current","dev":{"ids":["1B8996"]},[COLOR=#c0392b][B]"unit_of_meas":"A"[/B][/COLOR],"ic":"mdi:alpha-a-circle-outline","frc_upd":true,"val_tpl":"{{value_json['ENERGY']['Current']}}"}
    1
    I then repeated the steps above using the HS4 starting at the point where General Tab Obsolete S31-113/# was used to remove the devices created by the HS3 plugin. Reset the S31 and now observed the expected suffix. It means the HS3 plugin needs to be updated to get the suffix automatically. This update is at http://mcsSprinklers.com/mcsMQTT_5_14_3_1.zip


    Click image for larger version  Name:	Capture16.PNG Views:	0 Size:	348.0 KB ID:	1455783


    On the initial Module Configuration of the S31 I had neglected to press Save after selecting S31 so the devices was still configured as Sonoff Basic. This is why the initial attempt did not have the Energy devices created.








    Comment


      #17
      Ok had more time to look at this...

      The first thing i noticed different was that you removed the %prefix%/ from the full topic. I did this as well, rebooted, removed the obsolte topics associated with topic/# and that was all i needed. It recreated the device, with all the energy monitoring sub features.

      So it seems the issue has something to do with removing the %prefix% for the full topic or perhaps it was just that i renamed the topic as well. i changed it from sonoff-s31-1 to minifridge so I can more easily tell what each of my 7 plugs will refer to. I'm adding the IP to each tile as i go as well so i can tell minifridge for example is 192.168.0.xx ip and go to its config page if I have to.

      Click image for larger version

Name:	tasmota17.PNG
Views:	352
Size:	18.0 KB
ID:	1456783

      A couple of issues I found though:

      I tried to remove a few of the unneeded energy monitoring features like reactive power, I unchecked the 'A' box and it would come back to the tile after a few seconds, so I rejected it and unassociated it again, and then it still came back but I deleted the feature in the HS device after rejecting it and it stayed gone then. Not sure if bug or working as intended.

      I tried to add the IP address from the topic minifridge/HASS_STATE:IPAddress with ip string 192.168.0.29 and it shows up in the tile as 0 even when the UI element selected in the edit panel of the association is 'text'. I also was able to group it with the parent tile as well by changing the Gouping Parent Ref

      I tried to edit the suffix for the watts feature but it does not change anything. I didn't know about the deviceutility page at all in HS4 but I can reach it manually and then edit the watts feature and set the power suffix to 'Watts' but the tile still shows 'W' (A doesnt becomes Amps either when I change that one

      Lastly, if I change the logging from 300 to 60 or even 10 will that change the update frequency of the energy monitoring values? I would like them to update more often. I have my home energy monitor updating every 5 seconds on my mobile dashboard. i'd kind of like to do about 5-10 seconds for each plug too. 5 minutes is way to long to change . my mini fridge might be off, turn on, and run for 4 minutes then turn off and the power in the tile wouldnt change from 0 sometimes. Another reason is if I wanted pushover alerts to my phone if the washing machine plug goes above 20 watts and then drops back under 20 watts to signal the load is done. I would want that to not take 5 minutes to update and trigger an event.



      Click image for larger version

Name:	tasmota18.PNG
Views:	222
Size:	55.5 KB
ID:	1456784
      Click image for larger version

Name:	tasmota19.PNG
Views:	223
Size:	53.2 KB
ID:	1456785

      Comment


        #18
        I unchecked the 'A' box and it would come back to the tile after a few seconds
        The unassociate was a bug and fixed

        HS3 http://mcssprinklers.com/mcsMQTT_5_14_3_5.zip
        HS4 http://mcssprinklers.com/HSPI_mcsMQTT_5_14_3_5.zip

        Uploader Override instructions at first post of https://forums.homeseer.com/forum/hs...es-to-influxdb

        I tried to add the IP address from the topic minifridge/HASS_STATE:IPAddress with ip string 192.168.0.29 and it shows up in the tile as 0 even when the UI element selected in the edit panel of the association is 'text'.
        I suspect you only get HASS messages on startup of Tasmota. Had you restarted Tasmota after selecting it to be Text? There is also an option on the Edit tab to store in DeviceString vs. DeviceValue. For Text it will be DeviceString, but I think this happens automatically.

        I tried to edit the suffix for the watts feature but it does not change anything. I didn't know about the deviceutility page at all in HS4 but I can reach it manually and then edit the watts feature and set the power suffix to 'Watts' but the tile still shows 'W' (A doesnt becomes Amps either when I change that one
        This is a HS display function. In the List rather than the Tile does it show the full suffix after editing it or only the first letter?

        Lastly, if I change the logging from 300 to 60 or even 10 will that change the update frequency of the energy monitoring values?
        I would need to look at the source to know what the Tasmota update interval it. I suspect it is around 200 ms. You can get a rough idea by looking at the main page of the Tasmota device and see how often that screen updates the energy numbers.

        Reporting via MQTT is set by the Logging page on Tasmota. Default is 300 seconds. There may be some minimum limit so as to not overload the ESP8266, but I know I have some setup in the seconds rather than minutes range. You likely will want the Energy topic(s) to be set in mcsMQTT to Express mode (E column checkbox) to reduce the burden on HS and CPU use for both it and mcsMQTT. The manual describes Express mode.

        Comment

        Working...
        X