Skip to content

Instantly share code, notes, and snippets.

@deek042
Last active February 19, 2022 02:15
Show Gist options
  • Save deek042/9c7a50c75ace34386963ffeeff871142 to your computer and use it in GitHub Desktop.
Save deek042/9c7a50c75ace34386963ffeeff871142 to your computer and use it in GitHub Desktop.
DroneMobile

The following flow will create a dashboard so you remotely start, stop, lock, or unlock your Dronemobile equipped vehicle. You can set schedules and a temperature threshold. I have it set so my Suburban won't start in the morning if the outside temp is above 35(F) and only on weekdays.

You will also need the following API wrapper installed. I did not create the API wrapper and have nothing to do with it.

"drone-mobile" by Hacksore "An unofficial nodejs API wrapper for DroneMobile" https://github.com/Hacksore/drone-mobile

2022-02-18 (8)

[
{
"id": "30c39a3f1403cd31",
"type": "tab",
"label": "DroneMobile",
"disabled": false,
"info": "",
"env": []
},
{
"id": "33f34f3a42b9b48c",
"type": "ui_text_input",
"z": "30c39a3f1403cd31",
"name": "",
"label": "UNLOCK PIN",
"tooltip": "",
"group": "a96510934745ea77",
"order": 1,
"width": "3",
"height": "1",
"passthru": false,
"mode": "number",
"delay": "0",
"topic": "topic",
"sendOnBlur": false,
"className": "",
"topicType": "msg",
"x": 180,
"y": 80,
"wires": [
[
"516e7fe4d5d4725b",
"dbe711ca948028d2",
"e885a180ee0279e2"
]
]
},
{
"id": "516e7fe4d5d4725b",
"type": "switch",
"z": "30c39a3f1403cd31",
"name": "PIN",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "3181",
"vt": "num"
},
{
"t": "neq",
"v": "3181",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 350,
"y": 80,
"wires": [
[
"4a3f2145c80f53ac"
],
[
"68c7f0f10d9595c2"
]
]
},
{
"id": "68c7f0f10d9595c2",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "INCORRECT PIN",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 80,
"wires": [
[
"f2b866b80660af02"
]
]
},
{
"id": "4a3f2145c80f53ac",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "CORRECT PIN",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 540,
"y": 40,
"wires": [
[
"e00158cc1a8a0578"
]
]
},
{
"id": "dbe711ca948028d2",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 180,
"y": 40,
"wires": [
[
"33f34f3a42b9b48c"
]
]
},
{
"id": "5a93a93028ba35cb",
"type": "ui_button",
"z": "30c39a3f1403cd31",
"name": "",
"group": "a96510934745ea77",
"order": 2,
"width": "3",
"height": "1",
"passthru": true,
"label": "Lock",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "lock_outline",
"payload": "node /home/pi/node_modules/drone-mobile/dronelock.js",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 150,
"y": 160,
"wires": [
[
"4b14677ecec5e6c0"
]
]
},
{
"id": "f4c392e4950cd6e8",
"type": "ui_button",
"z": "30c39a3f1403cd31",
"name": "",
"group": "a96510934745ea77",
"order": 3,
"width": "3",
"height": "1",
"passthru": false,
"label": "Stop",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "sync_disabled",
"payload": "node /home/pi/node_modules/drone-mobile/dronestop.js",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 150,
"y": 200,
"wires": [
[
"4b14677ecec5e6c0"
]
]
},
{
"id": "e885a180ee0279e2",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "Unlock",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "node /home/pi/node_modules/drone-mobile/droneunlock.js",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 150,
"y": 120,
"wires": [
[
"4b14677ecec5e6c0"
]
]
},
{
"id": "8c3a727898a6f7b7",
"type": "ui_button",
"z": "30c39a3f1403cd31",
"name": "",
"group": "a96510934745ea77",
"order": 4,
"width": "3",
"height": "1",
"passthru": true,
"label": "Start",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "sync",
"payload": "node /home/pi/node_modules/drone-mobile/dronestart.js",
"payloadType": "str",
"topic": "topic",
"topicType": "msg",
"x": 150,
"y": 240,
"wires": [
[
"4b14677ecec5e6c0"
]
]
},
{
"id": "dd668e3e5a8d73d8",
"type": "chronos-scheduler",
"z": "30c39a3f1403cd31",
"name": "Morning Schedule",
"config": "7a8bc0d9dee80f55",
"schedule": [
{
"trigger": {
"type": "time",
"value": "05:20",
"offset": 0,
"random": false
},
"output": {
"type": "msg",
"property": {
"name": "payload",
"type": "bool",
"value": "true"
}
}
}
],
"multiPort": false,
"disabled": false,
"outputs": 1,
"x": 170,
"y": 820,
"wires": [
[
"3672f397cf61cb71"
]
]
},
{
"id": "3672f397cf61cb71",
"type": "gate",
"z": "30c39a3f1403cd31",
"name": "button gate",
"controlTopic": "control",
"defaultState": "open",
"openCmd": "enabled",
"closeCmd": "disabled",
"toggleCmd": "toggle",
"defaultCmd": "default",
"statusCmd": "status",
"persist": true,
"storeName": "memory",
"x": 450,
"y": 800,
"wires": [
[
"d14dace08903aa21"
]
]
},
{
"id": "71afaf25d947a7cc",
"type": "ui_text",
"z": "30c39a3f1403cd31",
"group": "a96510934745ea77",
"order": 13,
"width": "6",
"height": "1",
"name": "return info",
"label": "",
"format": "{{msg.payload}}",
"layout": "col-center",
"className": "",
"x": 1260,
"y": 500,
"wires": []
},
{
"id": "3ed72ada3c3013d7",
"type": "link in",
"z": "30c39a3f1403cd31",
"name": "",
"links": [
"cf20f33460c8a8bb",
"9ee242c7e77c2b71",
"2a761e546a8168c2",
"c753f30e4a6fc706",
"37abf200f193332c",
"8baf9eb6a90b472f",
"e00158cc1a8a0578",
"f2b866b80660af02"
],
"x": 1155,
"y": 520,
"wires": [
[
"71afaf25d947a7cc",
"82a364854dbec83a"
]
]
},
{
"id": "2a761e546a8168c2",
"type": "link out",
"z": "30c39a3f1403cd31",
"name": "",
"mode": "link",
"links": [
"3ed72ada3c3013d7"
],
"x": 415,
"y": 200,
"wires": []
},
{
"id": "435e336e4b2f2d64",
"type": "ui_text",
"z": "30c39a3f1403cd31",
"group": "a96510934745ea77",
"order": 14,
"width": "6",
"height": "1",
"name": "return date",
"label": "",
"format": "{{msg.payload}}",
"layout": "col-center",
"className": "",
"x": 1450,
"y": 540,
"wires": []
},
{
"id": "82a364854dbec83a",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$now('[M01].[D01].[Y0001] [H01]:[m01]:[s01]', '-0600')",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 540,
"wires": [
[
"435e336e4b2f2d64"
]
]
},
{
"id": "d9512fb358a1cc61",
"type": "link in",
"z": "30c39a3f1403cd31",
"name": "",
"links": [
"23104f4c9c07314c",
"9e8bcda01e31b416"
],
"x": 55,
"y": 240,
"wires": [
[
"8c3a727898a6f7b7"
]
]
},
{
"id": "9e8bcda01e31b416",
"type": "link out",
"z": "30c39a3f1403cd31",
"name": "",
"mode": "link",
"links": [
"d9512fb358a1cc61"
],
"x": 895,
"y": 800,
"wires": []
},
{
"id": "e00158cc1a8a0578",
"type": "link out",
"z": "30c39a3f1403cd31",
"name": "",
"mode": "link",
"links": [
"3ed72ada3c3013d7"
],
"x": 655,
"y": 40,
"wires": []
},
{
"id": "f2b866b80660af02",
"type": "link out",
"z": "30c39a3f1403cd31",
"name": "",
"mode": "link",
"links": [
"3ed72ada3c3013d7"
],
"x": 655,
"y": 80,
"wires": []
},
{
"id": "220f2f6d6a7365e3",
"type": "openweathermap in",
"z": "30c39a3f1403cd31",
"name": "",
"wtype": "current",
"lon": "-96.01616239311173",
"lat": "41.17828575845878",
"city": "",
"country": "",
"language": "en",
"x": 180,
"y": 600,
"wires": [
[
"1e9eb04857b4decb"
]
]
},
{
"id": "634fb3a46971c0ae",
"type": "ui_text",
"z": "30c39a3f1403cd31",
"group": "a96510934745ea77",
"order": 9,
"width": "3",
"height": "1",
"name": "",
"label": "Outside Temp:",
"format": "{{msg.payload}}",
"layout": "row-spread",
"className": "",
"x": 600,
"y": 600,
"wires": []
},
{
"id": "1e9eb04857b4decb",
"type": "unit-converter",
"z": "30c39a3f1403cd31",
"category": "temperature",
"inputUnit": "C",
"outputUnit": "F",
"inputField": "payload.tempc",
"outputField": "payload",
"inputFieldType": "msg",
"outputFieldType": "msg",
"roundOutputField": true,
"outputFieldDecimals": "0",
"name": "",
"x": 380,
"y": 600,
"wires": [
[
"634fb3a46971c0ae",
"05eb2cb481085907",
"6050bc5b87df7af1"
]
]
},
{
"id": "4b14677ecec5e6c0",
"type": "exec",
"z": "30c39a3f1403cd31",
"command": "",
"addpay": "payload",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": true,
"oldrc": false,
"name": "",
"x": 310,
"y": 180,
"wires": [
[
"2a761e546a8168c2"
],
[],
[]
]
},
{
"id": "d0f4fd4621dab77e",
"type": "ui_button",
"z": "30c39a3f1403cd31",
"name": "",
"group": "a96510934745ea77",
"order": 5,
"width": "3",
"height": "1",
"passthru": false,
"label": "Disable",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "Disabled",
"payloadType": "str",
"topic": "control",
"topicType": "str",
"x": 200,
"y": 780,
"wires": [
[
"3672f397cf61cb71"
]
]
},
{
"id": "1a1fe5adda137fa9",
"type": "ui_button",
"z": "30c39a3f1403cd31",
"name": "",
"group": "a96510934745ea77",
"order": 6,
"width": "3",
"height": "1",
"passthru": false,
"label": "Enable",
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"payload": "Enabled",
"payloadType": "str",
"topic": "control",
"topicType": "str",
"x": 200,
"y": 740,
"wires": [
[
"3672f397cf61cb71"
]
]
},
{
"id": "6f75928d64dd984e",
"type": "ui_text",
"z": "30c39a3f1403cd31",
"group": "a96510934745ea77",
"order": 7,
"width": "6",
"height": "1",
"name": "button text",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-center",
"className": "",
"x": 1450,
"y": 80,
"wires": []
},
{
"id": "b655befd2b138625",
"type": "status",
"z": "30c39a3f1403cd31",
"name": "button gate status",
"scope": [
"3672f397cf61cb71"
],
"x": 950,
"y": 80,
"wires": [
[
"1fdeb35a712fbd6e"
]
]
},
{
"id": "1fdeb35a712fbd6e",
"type": "switch",
"z": "30c39a3f1403cd31",
"name": "",
"property": "status.text",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "open",
"vt": "str"
},
{
"t": "eq",
"v": "closed",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1130,
"y": 80,
"wires": [
[
"307de79da3932acc"
],
[
"18c8a661c6c79ca8"
]
]
},
{
"id": "307de79da3932acc",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Enabled",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 60,
"wires": [
[
"6f75928d64dd984e"
]
]
},
{
"id": "18c8a661c6c79ca8",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Disabled",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 100,
"wires": [
[
"6f75928d64dd984e"
]
]
},
{
"id": "16b4caa49a61355f",
"type": "status",
"z": "30c39a3f1403cd31",
"name": "Schedule Status",
"scope": [
"dd668e3e5a8d73d8"
],
"x": 1280,
"y": 420,
"wires": [
[
"d5d3e2aa09ca93fc"
]
]
},
{
"id": "d5d3e2aa09ca93fc",
"type": "ui_text",
"z": "30c39a3f1403cd31",
"group": "a96510934745ea77",
"order": 11,
"width": 0,
"height": 0,
"name": "next event",
"label": "",
"format": "{{msg.status.text}}",
"layout": "row-center",
"className": "",
"x": 1490,
"y": 420,
"wires": []
},
{
"id": "d14dace08903aa21",
"type": "weekday",
"z": "30c39a3f1403cd31",
"name": "weekdays",
"sun": false,
"mon": true,
"tue": true,
"wed": true,
"thu": true,
"fri": true,
"sat": false,
"x": 600,
"y": 800,
"wires": [
[
"20f27ea1f130e765"
],
[]
]
},
{
"id": "20f27ea1f130e765",
"type": "gate",
"z": "30c39a3f1403cd31",
"name": "temp gate",
"controlTopic": "control",
"defaultState": "open",
"openCmd": "enabled",
"closeCmd": "disabled",
"toggleCmd": "toggle",
"defaultCmd": "default",
"statusCmd": "status",
"persist": true,
"storeName": "memory",
"x": 780,
"y": 800,
"wires": [
[
"9e8bcda01e31b416"
]
]
},
{
"id": "05eb2cb481085907",
"type": "switch",
"z": "30c39a3f1403cd31",
"name": "Temp Switch",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lte",
"v": "35",
"vt": "num"
},
{
"t": "gt",
"v": "35",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 570,
"y": 640,
"wires": [
[
"381d25279069cff0"
],
[
"4c808a4f1c79a141"
]
]
},
{
"id": "a6e90048ede8b0c6",
"type": "ui_text",
"z": "30c39a3f1403cd31",
"group": "a96510934745ea77",
"order": 10,
"width": "3",
"height": "1",
"name": "temp disable",
"label": "",
"format": "{{msg.payload}}",
"layout": "row-center",
"className": "",
"x": 1450,
"y": 240,
"wires": []
},
{
"id": "487904a3dabd66e8",
"type": "status",
"z": "30c39a3f1403cd31",
"name": "temp gate status",
"scope": [
"20f27ea1f130e765"
],
"x": 960,
"y": 240,
"wires": [
[
"46674f72a0e70188"
]
]
},
{
"id": "46674f72a0e70188",
"type": "switch",
"z": "30c39a3f1403cd31",
"name": "",
"property": "status.text",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "open",
"vt": "str"
},
{
"t": "eq",
"v": "closed",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1130,
"y": 240,
"wires": [
[
"03d22eb18a79517c"
],
[
"0da25ea1d1098789"
]
]
},
{
"id": "03d22eb18a79517c",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Enabled",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 220,
"wires": [
[
"a6e90048ede8b0c6"
]
]
},
{
"id": "0da25ea1d1098789",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Disabled",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 260,
"wires": [
[
"a6e90048ede8b0c6"
]
]
},
{
"id": "381d25279069cff0",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "enabled",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 680,
"wires": [
[
"20f27ea1f130e765"
]
]
},
{
"id": "4c808a4f1c79a141",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "disabled",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 720,
"wires": [
[
"20f27ea1f130e765"
]
]
},
{
"id": "6050bc5b87df7af1",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "Format Temp",
"rules": [
{
"t": "set",
"p": "push.text",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 610,
"y": 560,
"wires": [
[
"21ab66fd7c934542"
]
]
},
{
"id": "21ab66fd7c934542",
"type": "chronos-repeat",
"z": "30c39a3f1403cd31",
"name": "",
"config": "7a8bc0d9dee80f55",
"mode": "simple",
"interval": "15",
"intervalUnit": "minutes",
"crontab": "",
"expression": "",
"untilType": "nextMsg",
"untilValue": "",
"untilDate": "",
"untilOffset": 0,
"untilRandom": false,
"msgIngress": "forward",
"preserveCtrlProps": false,
"ignoreCtrlProps": false,
"x": 810,
"y": 560,
"wires": [
[
"02d7a95673ca5ac6"
]
]
},
{
"id": "02d7a95673ca5ac6",
"type": "link out",
"z": "30c39a3f1403cd31",
"name": "",
"mode": "link",
"links": [
"6cc30c341942306e",
"6f00610622ee80c0"
],
"x": 975,
"y": 560,
"wires": []
},
{
"id": "6cc30c341942306e",
"type": "link in",
"z": "30c39a3f1403cd31",
"name": "",
"links": [
"02d7a95673ca5ac6"
],
"x": 355,
"y": 920,
"wires": [
[
"2af2c8343e32b238"
]
]
},
{
"id": "2af2c8343e32b238",
"type": "change",
"z": "30c39a3f1403cd31",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "status",
"tot": "str"
},
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "control",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 920,
"wires": [
[
"3672f397cf61cb71",
"20f27ea1f130e765"
]
]
},
{
"id": "5982544ee0776c36",
"type": "chronos-scheduler",
"z": "30c39a3f1403cd31",
"name": "Afternoon Schedule",
"config": "7a8bc0d9dee80f55",
"schedule": [
{
"trigger": {
"type": "time",
"value": "14:20",
"offset": 0,
"random": false
},
"output": {
"type": "msg",
"property": {
"name": "payload",
"type": "bool",
"value": "true"
}
}
}
],
"multiPort": false,
"disabled": false,
"outputs": 1,
"x": 170,
"y": 880,
"wires": [
[
"3672f397cf61cb71"
]
]
},
{
"id": "aaabec120c16c126",
"type": "status",
"z": "30c39a3f1403cd31",
"name": "Schedule Status",
"scope": [
"5982544ee0776c36"
],
"x": 1280,
"y": 460,
"wires": [
[
"679cdf20353a9772"
]
]
},
{
"id": "679cdf20353a9772",
"type": "ui_text",
"z": "30c39a3f1403cd31",
"group": "a96510934745ea77",
"order": 12,
"width": 0,
"height": 0,
"name": "next event",
"label": "",
"format": "{{msg.status.text}}",
"layout": "row-center",
"className": "",
"x": 1490,
"y": 460,
"wires": []
},
{
"id": "a96510934745ea77",
"type": "ui_group",
"name": "Suburban",
"tab": "b6c8e28df787ad14",
"order": 2,
"disp": false,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "7a8bc0d9dee80f55",
"type": "chronos-config",
"name": "LAVISTA",
"sunPositions": []
},
{
"id": "b6c8e28df787ad14",
"type": "ui_tab",
"name": "Suburban",
"icon": "directions_car",
"order": 3,
"disabled": false,
"hidden": false
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment