# \[Solved\] Node-red to pyton Mega IO

**URL:** <https://discourse.nodered.org/t/solved-node-red-to-pyton-mega-io/5032>\
**Category:** General\
**Created:** [19 November 2018 10:41 UTC](https://discourse.nodered.org/t/solved-node-red-to-pyton-mega-io/5032 "2018-11-19T10:41:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IvarMvl](https://avatars.discourse-cdn.com/v4/letter/i/3e96dc/32.png) [@IvarMvl](https://discourse.nodered.org/u/IvarMvl)\
**Post date:** [19 November 2018 10:41 UTC](https://discourse.nodered.org/t/solved-node-red-to-pyton-mega-io/5032/1 "2018-11-19T10:41:43Z")

</div>

i am tying to turn the relais on and off from my Mega IO raspberry

cant figure it out

my Node red Flow

[  
{  
"id": "e7f6ddc.067dca",  
"type": "tab",  
"label": "Flow 1",  
"disabled": false,  
"info": ""  
},  
{  
"id": "c29f52f4.17482",  
"type": "ui\_button",  
"z": "e7f6ddc.067dca",  
"name": "RELAY OFF",  
"group": "b5d72511.6dc02",  
"order": 0,  
"width": 0,  
"height": 0,  
"passthru": false,  
"label": "RELAY OFF",  
"color": "",  
"bgcolor": "",  
"icon": "",  
"payload": "false",  
"payloadType": "bool",  
"topic": "",  
"x": 326,  
"y": 772,  
"wires": [  
[  
"33c635cf.843692"  
]  
]  
},  
{  
"id": "25c7d2fc.7a0ed6",  
"type": "ui\_button",  
"z": "e7f6ddc.067dca",  
"name": "RELAY ON",  
"group": "b5d72511.6dc02",  
"order": 0,  
"width": 0,  
"height": 0,  
"passthru": false,  
"label": "RELAY ON",  
"color": "",  
"bgcolor": "",  
"icon": "",  
"payload": "true",  
"payloadType": "bool",  
"topic": "",  
"x": 323,  
"y": 706,  
"wires": [  
[  
"d85d7ee6.4442a"  
]  
]  
},  
{  
"id": "d85d7ee6.4442a",  
"type": "function",  
"z": "e7f6ddc.067dca",  
"name": "Get Param",  
"func": "set\_relay(1, 1, 1)\nreturn msg;",  
"outputs": 1,  
"noerr": 0,  
"x": 560,  
"y": 707,  
"wires": [  
[  
"f00ed999.bffc18"  
]  
]  
},  
{  
"id": "33c635cf.843692",  
"type": "function",  
"z": "e7f6ddc.067dca",  
"name": "Get Params",  
"func": "set\_relay(1, 1, 0)\nreturn msg;",  
"outputs": 1,  
"noerr": 0,  
"x": 554,  
"y": 771,  
"wires": [  
[  
"f00ed999.bffc18"  
]  
]  
},  
{  
"id": "f00ed999.bffc18",  
"type": "exec",  
"z": "e7f6ddc.067dca",  
"command": "megaio 0 awrite",  
"addpay": true,  
"append": "",  
"useSpawn": "false",  
"timer": "1",  
"oldrc": false,  
"name": "MEGA-IO",  
"x": 772,  
"y": 737,  
"wires": [  
[],  
[  
"fd04ec53.e199b8"  
],  
[]  
]  
},  
{  
"id": "fd04ec53.e199b8",  
"type": "debug",  
"z": "e7f6ddc.067dca",  
"name": "",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "payload",  
"x": 969,  
"y": 808,  
"wires": []  
},  
{  
"id": "b5d72511.6dc02",  
"type": "ui\_group",  
"z": "e7f6ddc.067dca",  
"name": "Mega-IO test",  
"tab": "5548ac65.acf3ac",  
"disp": true,  
"width": "6",  
"collapse": false  
},  
{  
"id": "5548ac65.acf3ac",  
"type": "ui\_tab",  
"z": "e7f6ddc.067dca",  
"name": "RELAY TEST",  
"icon": "dashboard"  
}  
]

---

<div class="post-metadata">

**Author:** ![IvarMvl](https://avatars.discourse-cdn.com/v4/letter/i/3e96dc/32.png) [@IvarMvl](https://discourse.nodered.org/u/IvarMvl)\
**Post date:** [19 November 2018 11:06 UTC](https://discourse.nodered.org/t/solved-node-red-to-pyton-mega-io/5032/2 "2018-11-19T11:06:13Z")

</div>

i got it working

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 November 2018 11:07 UTC](https://discourse.nodered.org/t/solved-node-red-to-pyton-mega-io/5032/3 "2018-11-19T11:07:42Z")

</div>

when pasting flows, please gfollow the directions in [How to import a flow into the editor](https://discourse.nodered.org/t/how-to-import-a-flow-into-the-editor/895)
