logo elektroda
logo elektroda
X
logo elektroda

Data in Domoticz transmitted via SDM 120 Modbus with Wemos d1

Slawek981 1803 2
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17955885
    Slawek981
    Level 7  
    Hello
    I have a SDM 120 Modbus meter hooked up to a Wemos d1 mini on ESPEasy software which sends data to domoticz. I want to monitor the power and the amount of energy produced (PV installation). As far as the power of the installation is concerned, the graphs are ok, i.e. I can view the entire day's production with any degree of accuracy. On the other hand, the kWh meter and the statistics in domoticz give the data when a full kwh is passed. Today, for example, I produced 2.97 kWh, and the graph and meter show 2 kwh (meter status 2.97). Tomorrow morning, after producing 0.03 kWh, it will mark this one kWh for me. I have a small installation of 1.2 kWp and I want the whole day to end with a result with 2 decimal places. How can this be changed ?

    Data in Domoticz transmitted via SDM 120 Modbus with Wemos d1 .

    Data in Domoticz transmitted via SDM 120 Modbus with Wemos d1 .
  • ADVERTISEMENT
  • #2 17957418
    xury
    Automation specialist
    This is probably because of the way the counter data is parsed. To say more, you would need to know the mechanisms for passing data to the Domoticz API, scripts, etc.
    More likely it is not the fault of Domoticz itself, but precisely the way the data is delivered.
  • #3 17957503
    Slawek981
    Level 7  
    This is the script for the counter, but I'm too thin to understand anything ;)

    return {

    baseType = 'device',

    name = 'Counter device adapter',

    matches = function (device, adapterManager)
    local res = ( device.deviceSubType == 'RFXMeter counter'
    or device.deviceSubType == 'Counter Incremental'
    or device.deviceSubType == 'Managed Counter')

    if (not res) then
    adapterManager.addDummyMethod(device, 'updateCounter')
    end

    return res
    end,

    process = function (device, data, domoticz, utils, adapterManager)

    -- from data: counter, counterToday, valueQuantity, valueUnits

    local valueFormatted = device.counterToday or ''
    local info = adapterManager.parseFormatted(valueFormatted, domoticz['radixSeparator'])
    device['counterToday'] = info['value']

    valueFormatted = device.counter or ''
    info = adapterManager.parseFormatted(valueFormatted, domoticz['radixSeparator'])
    device['counter'] = info['value']

    if device.deviceSubType == 'Managed Counter' and ( device.valueUnits == nil or device.valueUnits == "" ) then
    device.valueUnits = string.match(device._data.data.counter, '%a+%d*') or ''
    end

    function device.updateCounter(value)
    if type(value) == "table" then
    domoticz.log('no updateCounter with value of type table allowed !! ', utils.LOG_ERROR)
    return nil
    else
    return device.update(0, value)
    end
    end

    end

    }
ADVERTISEMENT