Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some news field for future DDF (Consumption/power device) #5890

Merged
merged 3 commits into from Mar 26, 2022

Conversation

Smanar
Copy link
Collaborator

@Smanar Smanar commented Mar 19, 2022

Not used yet, but add

  • Current phase 1
  • Curent phase 2
  • Current phase 3
  • A second consumption
  • A production counter.

@Smanar Smanar changed the title Add some news field for future DDF Add some news field for future DDF (Consumption/power device) Mar 19, 2022
@manup
Copy link
Member

manup commented Mar 25, 2022

I'm not sure about state/consumption_2 and state/production and their meaning, is there a specific device which requires these?

@Smanar
Copy link
Collaborator Author

Smanar commented Mar 25, 2022

state/production for all devices that mesure consumption and production.
And yes, we are on the DDF ATM, it's a device used for the whole house, so users with solar panel have production too.
The attribute 0x0001 is for production (not consumption)


				<attribute id="0x0000" name="Current Summation Delivered" type="u48" access="r" required="m"></attribute>
				<attribute id="0x0001" name="Current Summation Received" type="u48" access="r" required="o"></attribute>

state/consumption_2
I m trying to be generic for this one, but yes the same device than before mesure consumption during 2 period (not the same price), so the device have 2 counters ( or more)
I can use period name, but will need for exemple state/consumptionHC and state/consumptionHP and can't be used for other usage.

@manup
Copy link
Member

manup commented Mar 26, 2022

Cool, thanks that's indeed useful data to have 👍

@manup manup added this to the v2.15.1 milestone Mar 26, 2022
@manup manup merged commit 6ec6ff4 into dresden-elektronik:master Mar 26, 2022
@ebaauw
Copy link
Collaborator

ebaauw commented Mar 26, 2022

I agree it’s useful to add attributes for these, but I’d urge to reconsider the naming and API design. I don’t know about Zigbee power meters, but in the DSMR standard they support consumption vs delivery attributes for not just consumption, but also power and current. Also the attributes in the Simple Metering cluster talk about delivered vs received. I would really prefer consumption (even consumption_received) vs consumption_delivered instead of production. Also I light of future power_delivered and current_delivered.

For three-phase electricity it’s probably best to use a subobject per phase, allowing for power, current, and voltage per phase. DSMR doesn’t define a consumption per phase, though. It does allow for different rates (e.g. day vs night rates), both for consumption delivered and received.

@Smanar
Copy link
Collaborator Author

Smanar commented Mar 26, 2022

It's not a problem for me, I can use state/consumption and state/consumption_delivered time for third app support state/consumption_received.

Can do a new PR, I will adapt my future DDF for consuption, and can keep state/consumption and state/consumption_delivered for compatiblity with third app.

For the Tree phase, do you have a json exemple ? IDK if it s better to make something for future or try to keep the compatibilities with third app ...

@ebaauw
Copy link
Collaborator

ebaauw commented Mar 27, 2022

Don't really have an example for any Zigbee device, but here is how I parse the DSMR telegram into JSON:

{
  "type": "ISK5\\2M550T-1012",
  "version": "5.0",
  "msg_text": "",
  "electricity": {
    "id": "E0044007118529318",
    "lastupdated": "2019-12-29T23:37:14",
    "tariff": "low",
    "consumption": {
      "low": 4000.647,
      "normal": 1154.948
    },
    "power": 1765,
    "failures": {
      "short": 9,
      "long": 4,
      "log": {
        "2018-03-27T06:41:11": 180,
        "2019-01-08T10:59:23": 2603
      }
    },
    "l1": {
      "voltage": 236.9,
      "sags": 1,
      "swells": 1,
      "current": 0,
      "power": 132
    },
    "l2": {
      "voltage": 235.1,
      "sags": 1,
      "swells": 1,
      "current": 0,
      "power": 37
    },
    "l3": {
      "voltage": 234.9,
      "sags": 1,
      "swells": 1,
      "current": 6,
      "power": 1596
    }
  },
  "electricityBack": {
    "id": "E0044007118529318B",
    "lastupdated": "2019-12-29T23:37:14",
    "tariff": "low",
    "consumption": {
      "low": 0,
      "normal": 0
    },
    "power": 0,
    "l1": {
      "power": 0
    },
    "l2": {
      "power": 0
    },
    "l3": {
      "power": 0
    }
  }
}

@Smanar
Copy link
Collaborator Author

Smanar commented Mar 27, 2022

So you want to use array in the JSON ? or dictionary ?

@ebaauw
Copy link
Collaborator

ebaauw commented Mar 27, 2022

That seems cleaner than repeated attributes with a changing suffix. Don't think we use that much today. Really need to do a proper design of the API going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants