NOd red sonoff temp and humidity sensor

Hello to all.

I have some sonoff digital temp and humidity sensor. How could i make in red node a temp and humidity automation. I am unable to get the real time humidity and temperature.

I’m pretty sure the output of a device event node is a string of letters and so then you need to turn it into an Object. Then you put a change node to move the value you want (copy the link to where it is from a debug node using the copy link icon) to the main msg.payload. Then you will just have a number and can use a switch node to automate what you want.

finaly i got a temp, but is showing with 0,5 C in plus. :frowning:

I got a message that register-device: state should be JSON. how


Where is the problem, i dont know. now i cant see nothing

I don’t think I’ve ever created an only temperature device but I always create a settings or a default text in JSON format as per the eWeLInk API document with if you click the book icon near the debug icon will show you the documents for the selected node and the create device node icon has a link to the API. Sometimes you can get away without writing stuff though and leave it at {}.

What are you trying to achieve? I don’t understand the flow. If possible I avoid Function Nodes and just use the official calculator node to do basic maths. The calculator node is available in the palette manager.

Once you’ve created a device you need to send a particular template to the put-device-state node so just put a template node before it. At the bottom of that node is an option to send output as an object. It needs an object sent to it.

Hy. I wanna create more scenes with temp controling the trzvb. So i have in each room temp sensor and trzvb and i wanna make a temp control scenes.
So please if you can help me.

Warmest regards

If you have a real input device and a real output device you don’t need either the Register Device or the put-device-state node anywhere.

All you need to do is extract the temperature value from the out out of a device event node from the T/H sensor and control the TRV with a control device node.

Use the following nodes:

  1. device event from t/h sensor
  2. JSON node to convert a string to an object
    3 change node [move temperature from subcategory to being main payload]
  3. switch node (eg if above temperature of X output 1]
  4. control device node to control the TRV
    Plus lots of debug nodes to help troubleshoot. You can always turn them off when you’re happy with that node.

You can add a switch node to check the sting of letter contains “temperature” in between 1 and 2, a filter node between 3 and 4 to check it has changed to avoid wasted CPU cycles and a calculator node (multiply by 1 and output rounded to 0 decimal places) to check all changes are atleast 1 degree, but that is all optional. Once it is working you can add them.

So one more try. here is my flow. First event is the temp sensor, the second is the button/switch( virtual). I puted after the temp controller 2 logycal node. Because we have 2 outputs on the temp controller. the appaer is cooling, under is heating. How to do to be enabled this scene, just if the button is on. It is off i wanna turn off all trzvb-s. doesnt work brrrrr

Why is there a trigger node?


without debug nodes here is the node layout

[
    {
        "id": "ce6f29ccdd1ee8b2",
        "type": "control-device",
        "z": "b840efda68ba8fb9",
        "name": "TRV on",
        "server": "",
        "list": "",
        "category": "",
        "device": "",
        "v2Data": "{}",
        "x": 1720,
        "y": 240,
        "wires": [
            []
        ]
    },
    {
        "id": "b2522dddbbcbf78f",
        "type": "control-device",
        "z": "b840efda68ba8fb9",
        "name": "TRV off",
        "server": "",
        "list": "",
        "category": "",
        "device": "",
        "v2Data": "{}",
        "x": 1720,
        "y": 420,
        "wires": [
            []
        ]
    },
    {
        "id": "4048b889c7b32095",
        "type": "event-state",
        "z": "b840efda68ba8fb9",
        "name": "temperature",
        "server": "",
        "list": "",
        "category": "",
        "device": "",
        "state": "",
        "x": 330,
        "y": 220,
        "wires": [
            [
                "e3771954831180b4"
            ]
        ]
    },
    {
        "id": "b6dbdfd61f24f009",
        "type": "event-state",
        "z": "b840efda68ba8fb9",
        "name": "Switch",
        "server": "",
        "list": "",
        "category": "",
        "device": "",
        "state": "",
        "x": 310,
        "y": 360,
        "wires": [
            [
                "577885503ee09ee8"
            ]
        ]
    },
    {
        "id": "e3771954831180b4",
        "type": "json",
        "z": "b840efda68ba8fb9",
        "name": "",
        "property": "payload",
        "action": "obj",
        "pretty": false,
        "x": 490,
        "y": 220,
        "wires": [
            [
                "814babfb6aac9341"
            ]
        ]
    },
    {
        "id": "814babfb6aac9341",
        "type": "change",
        "z": "b840efda68ba8fb9",
        "name": "",
        "rules": [
            {
                "t": "move",
                "p": "payload.payload.temperature.temperature",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 800,
        "y": 220,
        "wires": [
            [
                "cb12fc19fb96d61d"
            ]
        ]
    },
    {
        "id": "cb12fc19fb96d61d",
        "type": "switch",
        "z": "b840efda68ba8fb9",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "lt",
                "v": "25",
                "vt": "str"
            },
            {
                "t": "gte",
                "v": "25",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 1110,
        "y": 220,
        "wires": [
            [
                "8fefdb57b03aacc9"
            ],
            [
                "a4b4d1bd1bab26d5",
                "b2522dddbbcbf78f"
            ]
        ]
    },
    {
        "id": "8fefdb57b03aacc9",
        "type": "change",
        "z": "b840efda68ba8fb9",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "temperature",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1280,
        "y": 200,
        "wires": [
            [
                "acf08111488abc0b"
            ]
        ]
    },
    {
        "id": "a4b4d1bd1bab26d5",
        "type": "change",
        "z": "b840efda68ba8fb9",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "temperature",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1280,
        "y": 240,
        "wires": [
            [
                "acf08111488abc0b"
            ]
        ]
    },
    {
        "id": "577885503ee09ee8",
        "type": "switch",
        "z": "b840efda68ba8fb9",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "cont",
                "v": "on",
                "vt": "str"
            },
            {
                "t": "cont",
                "v": "off",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 1110,
        "y": 360,
        "wires": [
            [
                "aad0ac013f2d9c3b"
            ],
            [
                "63584d2690f96a3e",
                "b2522dddbbcbf78f"
            ]
        ]
    },
    {
        "id": "acf08111488abc0b",
        "type": "BooleanLogicUltimate",
        "z": "b840efda68ba8fb9",
        "name": "AND gate",
        "payloadPropName": "payload",
        "filtertrue": "onlytrue",
        "persist": true,
        "sInitializeWith": "WaitForPayload",
        "triggertopic": "trigger",
        "outputtriggeredby": "all",
        "inputCount": 2,
        "topic": "result",
        "restrictinputevaluation": false,
        "delayEvaluation": 0,
        "translatorConfig": "",
        "x": 1530,
        "y": 280,
        "wires": [
            [
                "ce6f29ccdd1ee8b2"
            ],
            [],
            []
        ]
    },
    {
        "id": "aad0ac013f2d9c3b",
        "type": "change",
        "z": "b840efda68ba8fb9",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "switch",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1280,
        "y": 340,
        "wires": [
            [
                "acf08111488abc0b"
            ]
        ]
    },
    {
        "id": "63584d2690f96a3e",
        "type": "change",
        "z": "b840efda68ba8fb9",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "switch",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1280,
        "y": 380,
        "wires": [
            [
                "acf08111488abc0b"
            ]
        ]
    }
]

just import that code and setup ewelink nodes/add debug nodes

I want to start the messages just if the asociated virtual switch state is on. The controller send automatic messages. Here i can set histersy… How to insert an if, to check if the virtual button is turned on send message if not dont send, stop the flow

Outputs

This node has two outputs for controlling your cooler and heater. Both outputs emits a boolean to determine if your appliance should be turned on (true) or turned off (false). The first output represents the cooler, and the second output represents the heater. Messages are sent with topic cooling-controller and heating-controller respectively so you could merge them in your flow and use topic to distinguish.

who can help for me? :smiley:


How to open the gate node