GithubHelp home page GithubHelp logo

read_single_value about iec62056-21 HOT 5 CLOSED

pwitab avatar pwitab commented on July 23, 2024
read_single_value

from iec62056-21.

Comments (5)

dawidce avatar dawidce commented on July 23, 2024

Or maybe it's easier to parse response from read_standard_readout function and find data ?

from iec62056-21.

Krolken avatar Krolken commented on July 23, 2024

I use different strategies depending on how much the data costs. If cost and bandwidth isn't a problem I just do standard readout since I don't have to change much afterwards. Lots of MNOs also charge you in incremental steps for each session. So if you pay at least for 1 kB for every session you might as well read all of it.
If I am able I adjust the standard readout (can be done usually by the manufacturers software), I try to do that to get the data I need.
And if I just only need the one data or data not available in standard readout I do single read.

Seems like you are using the LP-1 with Wifi? So I would just read the standard readout.
But if you have time please try out the single read to find if it works properly on the device. I am trying to find a better API to use the different password mechnisms, but it seems very device specific sometimes so it might be better handles elsewhere.

from iec62056-21.

dawidce avatar dawidce commented on July 23, 2024

im using LP-1 with Ethernet. How should i parse standard readout to get single data (1.8.0?) what kind of type is AnswerDataMessage ?

from iec62056-21.

Krolken avatar Krolken commented on July 23, 2024

Simplest thing would be to use the data property of AnswerDataMessage. The data structure of AnswerDataMessage consists if DataBlock that consists of DataLines that consists of DataSets. It is just to conform to the standard and make it easy to parse the data coming from the meter, but the interesting is the list of DataSets that actually hold the data.

data_list: List[DataSet] = answer_data_msg.data

Data sets consists of address, value and unit. See

class DataSet(Iec6205621Data):

So if you only need one element search the list for it and if you think you need more values you can for example create a mapping using dict with the address as key and then just look up by address.

from iec62056-21.

Krolken avatar Krolken commented on July 23, 2024

Closing this since it seems done. If there is anything else just open it again.

from iec62056-21.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.