Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "id": "ab5272b7.abafc",
- "type": "tab",
- "label": "AIS GPS Position",
- "disabled": false,
- "info": ""
- },
- {
- "id": "9fe8cd5c.4b97d",
- "type": "api-call-service",
- "z": "ab5272b7.abafc",
- "name": "Sofia Tracker",
- "server": "dabe5919.ea01a8",
- "version": 1,
- "service_domain": "device_tracker",
- "service": "see",
- "entityId": "",
- "data": "msg.payload",
- "dataType": "jsonata",
- "mergecontext": "",
- "output_location": "",
- "output_location_type": "none",
- "mustacheAltTags": false,
- "x": 977,
- "y": 200,
- "wires": [
- []
- ]
- },
- {
- "id": "760edd35.4ac9f4",
- "type": "signalk-subscribe",
- "z": "ab5272b7.abafc",
- "name": "navigation.position",
- "mode": "sendAll",
- "flatten": true,
- "context": "vessels.self",
- "path": "navigation.position",
- "source": "",
- "period": "10000",
- "x": 190,
- "y": 140,
- "wires": [
- [
- "ca8ae0c7.a4b0c"
- ]
- ]
- },
- {
- "id": "dfc0e458.eedc88",
- "type": "debug",
- "z": "ab5272b7.abafc",
- "name": "",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "false",
- "x": 710,
- "y": 160,
- "wires": []
- },
- {
- "id": "ca8ae0c7.a4b0c",
- "type": "join",
- "z": "ab5272b7.abafc",
- "name": "",
- "mode": "custom",
- "build": "array",
- "property": "payload",
- "propertyType": "msg",
- "key": "topic",
- "joiner": "\\n",
- "joinerType": "str",
- "accumulate": false,
- "timeout": "2",
- "count": "3",
- "reduceRight": false,
- "reduceExp": "",
- "reduceInit": "",
- "reduceInitType": "",
- "reduceFixup": "",
- "x": 510,
- "y": 200,
- "wires": [
- [
- "dfc0e458.eedc88",
- "77a3a8a9.73d5d8"
- ]
- ]
- },
- {
- "id": "f5dba1cf.2787f",
- "type": "signalk-subscribe",
- "z": "ab5272b7.abafc",
- "name": "navigation.speed",
- "mode": "sendAll",
- "flatten": true,
- "context": "vessels.self",
- "path": "navigation.speedOverGround",
- "source": "",
- "period": "10000",
- "x": 180,
- "y": 200,
- "wires": [
- [
- "ca8ae0c7.a4b0c",
- "206810f8.8ebc7"
- ]
- ]
- },
- {
- "id": "77a3a8a9.73d5d8",
- "type": "function",
- "z": "ab5272b7.abafc",
- "name": "Track and Notify",
- "func": "var home = true\nvar speed = msg.payload[1]\nvar lon = msg.payload[0].longitude\nvar lat = msg.payload[0].latitude\nvar alarm = msg.payload[2]\n\n\nif (alarm = \"armed_away\") {\n if (speed > 0.1) {\n var home = false \n }\n}\n\nmsg.payload = {\n \"dev_id\":\"Sofia\",\n \"gps\": [lat, lon],\n \"consider_home\": home\n}\n\nif (home === true) {\n // Use output 1 only, not sounding alarm\n return [msg, null];\n} else {\n // Use output 1 and 2, also activating the alarm\n return [msg, msg]; \n}\n\n",
- "outputs": 2,
- "noerr": 0,
- "x": 720,
- "y": 200,
- "wires": [
- [
- "2da72064.6f649",
- "9fe8cd5c.4b97d"
- ],
- [
- "7e2416f4.ba0fb8",
- "fed9a83c.3181a8"
- ]
- ]
- },
- {
- "id": "2da72064.6f649",
- "type": "debug",
- "z": "ab5272b7.abafc",
- "name": "",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "false",
- "x": 977,
- "y": 160,
- "wires": []
- },
- {
- "id": "206810f8.8ebc7",
- "type": "api-current-state",
- "z": "ab5272b7.abafc",
- "name": "Alarm",
- "server": "dabe5919.ea01a8",
- "version": 1,
- "outputs": 1,
- "halt_if": "",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "override_topic": false,
- "entity_id": "alarm_control_panel.sofia_alarm",
- "state_type": "str",
- "state_location": "payload",
- "override_payload": "msg",
- "entity_location": "data",
- "override_data": "msg",
- "blockInputOverrides": false,
- "x": 350,
- "y": 240,
- "wires": [
- [
- "ca8ae0c7.a4b0c"
- ]
- ]
- },
- {
- "id": "7e2416f4.ba0fb8",
- "type": "function",
- "z": "ab5272b7.abafc",
- "name": "Message",
- "func": "msg.payload =\n{\n \"data\": {\n \"message\": \"Båten beveger seg og alarmen er på!\",\n \"title\": \"ALARM\"\n }\n}\nreturn msg;",
- "outputs": 1,
- "noerr": 0,
- "x": 700,
- "y": 280,
- "wires": [
- [
- "46760dd9.05e5d4"
- ]
- ]
- },
- {
- "id": "46760dd9.05e5d4",
- "type": "api-call-service",
- "z": "ab5272b7.abafc",
- "name": "Alarm!",
- "server": "dabe5919.ea01a8",
- "version": 1,
- "service_domain": "notify",
- "service": "notify",
- "entityId": "",
- "data": "{}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "payload",
- "output_location_type": "msg",
- "mustacheAltTags": false,
- "x": 957,
- "y": 289,
- "wires": [
- []
- ]
- },
- {
- "id": "fed9a83c.3181a8",
- "type": "debug",
- "z": "ab5272b7.abafc",
- "name": "",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "false",
- "x": 977,
- "y": 249,
- "wires": []
- },
- {
- "id": "cfb2c7b5.a50208",
- "type": "inject",
- "z": "ab5272b7.abafc",
- "name": "Alarm Test",
- "topic": "",
- "payload": "",
- "payloadType": "date",
- "repeat": "",
- "crontab": "",
- "once": false,
- "onceDelay": 0.1,
- "x": 520,
- "y": 280,
- "wires": [
- [
- "7e2416f4.ba0fb8"
- ]
- ]
- },
- {
- "id": "dabe5919.ea01a8",
- "type": "server",
- "z": "",
- "name": "Home Assistant",
- "legacy": false,
- "hassio": false,
- "rejectUnauthorizedCerts": false,
- "ha_boolean": "y|yes|true|on|home|open",
- "connectionDelay": true
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement