Announcement

Collapse
No announcement yet.

How Can mcsMQTT Pull Data Into HomeSeer Energy?

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

  • Michael McSharry
    replied
    Is the data for this sensor being received and HS devices being updated? Does the Control/Status UI of the Feature on the Edit tab show it to be a number? To assure all data is stored then the MISC checkbox setting should be set to store on both Set and Change Value.

    Leave a comment:


  • jeanv
    replied
    Now with 5.26.5.0 my Whole House Watts Device does now show Energy / Watts on the Edit screen for the HS Device API Type:

    Click image for larger version

Name:	Screenshot_2022-08-30_00-37-13.jpg
Views:	42
Size:	15.8 KB
ID:	1564008

    Unfortunately still now appearance of the device on the HS Energy graphing:

    Click image for larger version

Name:	Screenshot_2022-08-30_00-40-12.jpg
Views:	33
Size:	38.2 KB
ID:	1564009

    Let me know if there is anything else you want me to test?

    Leave a comment:


  • Michael McSharry
    replied
    I scrubbed the logic for Feature Subtype edit in 5.26.5.0 mcsMQTT Change Log (HS4 & HS3) - HomeSeer Message Board I also update the Edit tab Type/Subtype text boxes when the Energy Database Save radio modified.

    My testing shows that the Tools/Energy page selector for items to graph have a dependency on the API definition (Type/Subtype) and there being some data in the database for the item. After adding another sensor for Energy storage the Energy page selector did not show it. After the first storage of data from a received MQTT message, then the Energy page selector showed the new sensor as available for graphing.

    Leave a comment:


  • Michael McSharry
    replied
    Continuing with the investigation the actual value of CentralScene is 1 and this is the same value as Watt, but a remapping has occurred because I assumed the states were listed in numerical order. If BinaryControl does not work, then try the other three. I do not know why the device showed up as expected on the energy page when I first tested it.

    Leave a comment:


  • Michael McSharry
    replied
    I looked deeper and see the SDK documentation does not list the properties in order by value. From the Edit tab select the second entry for subtype which is BinaryControl. This is a value of 1 which is the same 1 as the energy watt subtype. I will fix the plugin, but it would be good to confirm my analysis.

    Leave a comment:


  • Michael McSharry
    replied
    What you did looks to be what I expected. I know the the subType is not correct on the Edit tab for Energy devices. Energy does not follow the pattern of the others and I have not yet updated that logic. I did expect visibility from the HS Energy page. When I tested with only one energy device from mcsMQTT it did show up in the HS Energy page. My next step is to get the Edit tab to handle the subtype correctly for Energy Device types.

    Leave a comment:


  • jeanv
    replied
    Here is a video with the steps I followed... But before I also rebooted too

    Leave a comment:


  • Michael McSharry
    replied
    Did you toggle the radio on the General tab to Store in Watts after installing the update? From the Edit tab you should see the subtype is now energy related rather than battery.

    Leave a comment:


  • jeanv
    replied
    I tested you update (5.26.3.2) but it unfortunately made no difference. I still could not get the device to be listed under HomeSeer Energy. It really is not that big of a deal. I also sounds like that part of HS4 is in flux. I will make it all work with your charting functions plus the data I can export to InfluxDB. If the HomeSeer Energy stuff was both stable and easy to use, then sure, but since neither of those is true, I will stick with what I have thanks to your help.

    Leave a comment:


  • Michael McSharry
    replied
    The attached version in post 36 should give you what you originally asked about. I did see your post on RTL_433. I think it is great that you are trying to help others with such a post.

    Leave a comment:


  • jeanv
    replied
    Thanks so much Michael McSharry. It would be a nice to have but is not critical since now the Wattage data is going out to both your sort term SQLite via your plugin and also InfluxDB again via your plugin. With those two option I can put together some of the same data but need to create the work to do the current HomeSeer Energy (This Week vs Last Week), (Yesterday vs Today), etc...

    You have been such a tremendous help! I truly appreciate all of it and am trying to pay it forward by posting what I have learned and how I, for example, got my RTL_433 SDN receiver to work on windows as a service and push data to MQTT. It may help others.

    https://forums.homeseer.com/forum/ho...indows-service

    Leave a comment:


  • Michael McSharry
    replied
    I needed to add the SubType as Watts. 5.26.3.2 update attached. Uncheck the Store as Watt radio and then select it again. This will correctly set the properties so it shows up as a feature that can be selected from HS Energy (at least it did for me on my test).
    Attached Files

    Leave a comment:


  • Michael McSharry
    replied
    Looking at the HS4 SDK the following is observed in several places

    /// <summary>
    /// PLEASE NOTE: Code related to the Energy components in HomeSeer were ported from the HS3 plugin API and
    /// have not been fully tested to verify full functionality from the new SDK. The Energy API may undergo
    /// significant changes in the near future. Please use with caution.
    /// </summary>
    Click image for larger version

Name:	0x.png
Views:	59
Size:	36.8 KB
ID:	1563809

    Let me reset and see what the current status of the API for HS4 is now. I suspect I need to update subtype for Energy based upon the current API. Battery does not make sense but is the default if no other is specified.

    Leave a comment:


  • jeanv
    replied
    Unfortunately even after a reboot it still did not appear in the HomeSeer Energy list of devices. My device has the following for HS Device API Type:

    Click image for larger version

Name:	Screenshot_2022-08-28_17-29-51.jpg
Views:	69
Size:	14.5 KB
ID:	1563802

    Leave a comment:


  • Michael McSharry
    replied
    When HS Energy Database is selected then the following HS4 code is executed:

    Code:
    hs.Energy_SetEnergyDevice(oMQTT.Ref, HomeSeer.PluginSdk.Constants.enumEnergyDevice.Other)
    Dim DeviceType As HomeSeer.PluginSdk.Devices.Identification.TypeInfo = hs.GetPropertyByRef(oMQTT.Ref, HomeSeer.PluginSdk.Devices.EProperty.DeviceType)
    DeviceType.ApiType = HomeSeer.PluginSdk.Devices.Identification.EApiType.Feature
    DeviceType.Type = HomeSeer.PluginSdk.Devices.Identification.EFeatureType.Energ y
    hs.UpdatePropertyByRef(oMQTT.Ref, HomeSeer.PluginSdk.Devices.EProperty.DeviceType, DeviceType)
    The HS3 plugin uses this code

    Code:
    hs.Energy_SetEnergyDevice(oMQTT.Ref, EnergyAPIModule.enumEnergyDevice.Other)
    Dim dv As Scheduler.Classes.DeviceClass = hs.GetDeviceByRef(oMQTT.Ref)
    Dim info As HomeSeerAPI.DeviceTypeInfo_m.DeviceTypeInfo = dv.DeviceType_Get(hs)
    info.Device_API = DeviceTypeInfo.eDeviceAPI.Energy
    info.Device_Type = HomeSeerAPI.DeviceTypeInfo.eDeviceType_Energy.KWH
    dv.DeviceType_Set(hs) = info
    hs.SaveEventsDevices()
    I suspect the development was done under HS3 and the ported to HS4. The above is what I expect is needed for HS pages to recognize an energy device. It could be it only collects the list of energy devices on startup so you can try a HS restart.

    mcsMQTT Edit tab provides visibility into the properties so you can look there to make certain they are setup as an energy Feature. The example below is not an energy device, but it shows what you are looking for on the Edit tab.

    Click image for larger version  Name:	0x.png Views:	0 Size:	5.6 KB ID:	1563787

    I did not look any deeper, but when I was researching the code I see there were provisions for Non-Plugin Feature to store data in the HS energy database. In this case the Edit tab table would have a pink background.

    Leave a comment:

Working...
X