Skip to content

Can't set data with key named other than "data" #33

Open
@Nertskull

Description

@Nertskull

If I have a FSM defined similar to as as follows:

 {
    "state": {
        "status": "OFF-RESET",
        "data": {
            "light-state": 0
        }
    },
    "transitions": {
        "OFF-RESET": {
            "motion-on": {
                "status": "ON-TRANSITIONING",
                "data": {
                    "light-state": "1"
                }
            },
            "switched-on": {
                "status": "ON-SWITCHED",
                "data": {
                    "light-state": "1"
                }
            },

then everything works as expected. But is must be named "data". Is there a way to change it to a different key name? Such as this:

   {
    "state": {
        "status": "OFF-RESET",
        "set-values": {
            "light-state": 0
        }
    },
    "transitions": {
        "OFF-RESET": {
            "motion-on": {
                "status": "ON-TRANSITIONING",
                "set-values": {
                    "light-state": "1"
                }
            },
            "switched-on": {
                "status": "ON-SWITCHED",
                "set-values": {
                    "light-state": "1"
                }
            },

If I do anything like this, and then put a debug node w/ msg.payload.set-values, I get light-state: 0. But it never will change to 1. I would prefer to not use "data" as that payload.data is used for so many things and conflicts with some of my other nodes. Is there a way to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions