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

Payload customization #5

Open
miguelhb opened this issue Aug 9, 2021 · 1 comment
Open

Payload customization #5

miguelhb opened this issue Aug 9, 2021 · 1 comment

Comments

@miguelhb
Copy link

miguelhb commented Aug 9, 2021

I think it would be useful to add the timestamp to the payload. Moreover, it would be an easy task. It is enough modifying this line (if i am not wrong):

self._mq.publish(self._mqtt_io.format(io.name), int(value))

Regards,

@naruxde
Copy link
Owner

naruxde commented Mar 12, 2022

Well, maybe it would be cool to add an extra topic with a json object?

Maybe the topic ../json with a payload like this:

{
  "timestamp": 1647083416.5863497,
  "io": [
    {
      "name": "RevPiStatus",
      "value": 1
    },
    {
      "name": "RevPiIOCycle",
      "value": 5
    },
    {
      "name": "RevPiLED",
      "value": 0
    },
    {
      "name": "t_aus",
      "value": 1
    },
    {
      "name": "t_an",
      "value": 0
    },
    {
      "name": "t_links",
      "value": 0
    },
    {
      "name": "t_rechts",
      "value": 0
    },
    {
      "name": "t_hoch",
      "value": 0
    },
    {
      "name": "t_runter",
      "value": 0
    },
    {
      "name": "t_blau",
      "value": 0
    },
    {
      "name": "t_rot",
      "value": 0
    },
    {
      "name": "I_9",
      "value": 0
    },
    {
      "name": "I_10",
      "value": 0
    },
    {
      "name": "I_11",
      "value": 0
    },
    {
      "name": "I_12",
      "value": 0
    },
    {
      "name": "I_13",
      "value": 0
    },
    {
      "name": "I_14",
      "value": 0
    },
    {
      "name": "I_15",
      "value": 0
    },
    {
      "name": "I_16",
      "value": 0
    },
    {
      "name": "O_1",
      "value": 0
    },
    {
      "name": "O_2",
      "value": 0
    },
    {
      "name": "O_3",
      "value": 0
    },
    {
      "name": "O_4",
      "value": 0
    },
    {
      "name": "O_5",
      "value": 0
    },
    {
      "name": "O_6",
      "value": 0
    },
    {
      "name": "O_7",
      "value": 0
    },
    {
      "name": "O_8",
      "value": 0
    },
    {
      "name": "h_an",
      "value": 0
    },
    {
      "name": "h_richtung",
      "value": 0
    },
    {
      "name": "h_hoch",
      "value": 0
    },
    {
      "name": "h_runter",
      "value": 0
    },
    {
      "name": "h_blau",
      "value": 0
    },
    {
      "name": "h_rot",
      "value": 0
    },
    {
      "name": "O_15",
      "value": 0
    },
    {
      "name": "O_16",
      "value": 0
    },
    {
      "name": "PWM_1",
      "value": 0
    },
    {
      "name": "core.a1green",
      "value": 0
    },
    {
      "name": "core.a1red",
      "value": 0
    },
    {
      "name": "core.a2green",
      "value": 0
    },
    {
      "name": "core.a2red",
      "value": 0
    }
  ]
}

We could add a timestamp the IOs and other things, what do you think?

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

No branches or pull requests

2 participants