-
-
Save weha/ecdccd7f918636474fc3bf58b8e6c218 to your computer and use it in GitHub Desktop.
Node Red flow to monitor Eeve / Toadi to Home Assistant via MQTT (including auto discovery) - https://community.home-assistant.io/t/eeve-toadi-willow/405097
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "76106b40e1ce3c2f", | |
"type": "tab", | |
"label": "Willow to MQTT", | |
"disabled": false, | |
"info": "", | |
"env": [] | |
}, | |
{ | |
"id": "408cfb1f4dc379be", | |
"type": "junction", | |
"z": "76106b40e1ce3c2f", | |
"x": 520, | |
"y": 840, | |
"wires": [ | |
[ | |
"f3160912175db2ac", | |
"5b3d30e6ef5f5fd1", | |
"529cb9ee97de6076", | |
"494874dbcc642afb", | |
"8bcbf55cee1b276a", | |
"67bdc5e1984406b3" | |
] | |
] | |
}, | |
{ | |
"id": "114c146f98589a35", | |
"type": "mqtt out", | |
"z": "76106b40e1ce3c2f", | |
"name": "mqtt without retain", | |
"topic": "", | |
"qos": "", | |
"retain": "false", | |
"respTopic": "", | |
"contentType": "", | |
"userProps": "", | |
"correl": "", | |
"expiry": "", | |
"broker": "c1f9b3d52d33b78a", | |
"x": 1910, | |
"y": 60, | |
"wires": [], | |
"info": "test" | |
}, | |
{ | |
"id": "d8f740430de5284c", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "get JSON", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1220, | |
"y": 340, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1" | |
] | |
] | |
}, | |
{ | |
"id": "0d58429fcdbce311", | |
"type": "inject", | |
"z": "76106b40e1ce3c2f", | |
"name": "update sensors", | |
"props": [ | |
{ | |
"p": "flowType", | |
"v": "sensor", | |
"vt": "str" | |
} | |
], | |
"repeat": "10", | |
"crontab": "", | |
"once": true, | |
"onceDelay": "60", | |
"topic": "", | |
"x": 130, | |
"y": 420, | |
"wires": [ | |
[ | |
"4c649abe395578c0" | |
] | |
] | |
}, | |
{ | |
"id": "7913c148927d239f", | |
"type": "debug", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"active": true, | |
"tosidebar": true, | |
"console": false, | |
"tostatus": false, | |
"complete": "true", | |
"targetType": "full", | |
"statusVal": "", | |
"statusType": "auto", | |
"x": 310, | |
"y": 140, | |
"wires": [] | |
}, | |
{ | |
"id": "a837d1f0e5aa608a", | |
"type": "mqtt out", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"topic": "willow/connectionError", | |
"qos": "", | |
"retain": "", | |
"respTopic": "", | |
"contentType": "", | |
"userProps": "", | |
"correl": "", | |
"expiry": "", | |
"broker": "c1f9b3d52d33b78a", | |
"x": 360, | |
"y": 80, | |
"wires": [] | |
}, | |
{ | |
"id": "8cdf8b2f2539af9f", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/batteryStatus", | |
"func": "/*\nhttp://x.x.x.x:8080/system/batteryStatus\n{\n \"availableMowingTime\": 685,\n \"chargerState\": 0,\n \"percentage\": 100,\n \"percentagePerMowingHour\": 7,\n \"temperature\": 11\n}\n*/\nreturn [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_availableMowingTime',\n name: 'Battery Status Available MowingTime',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:calendar-clock-outline',\n value_template: '{{ value_json.availableMowingTime }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/availableMowingTime/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_percentagePerMowingHour',\n name: 'Battery Status Percentage Per Mowing Hour',\n device: msg.toadi_device,\n unit_of_measurement: '%',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.percentagePerMowingHour }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/percentagePerMowingHour/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_temperature',\n name: 'Battery Status Temperature',\n device: msg.toadi_device,\n device_class: 'temperature',\n unit_of_measurement: '°C',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.temperature | round(2) }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/temperature/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_battery_percentage',\n name: msg.toadi_name + ' Battery Percentage',\n device: msg.toadi_device,\n device_class: 'battery',\n unit_of_measurement: '%',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.percentage }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/battery_percentage/config'\n },\n{\n payload: {\n unique_id: msg.toadi_reference+'_charger_state',\n name: msg.toadi_name + ' Charger State',\n device: msg.toadi_device,\n device_class: 'power',\n payload_on: '1',\n payload_off: '0',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.chargerState }}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/charger_state/config'\n },\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1930, | |
"y": 180, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "be38429c527a723d", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/mowingInfo", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 940, | |
"y": 460, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "6bdbbebe7cc60504", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/bootcount", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 930, | |
"y": 220, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "6ab8f3f4a8448ee1", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/batteryStatus", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 950, | |
"y": 180, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "21fbffa95d2be7de", | |
"type": "mqtt out", | |
"z": "76106b40e1ce3c2f", | |
"name": "mqtt with retain", | |
"topic": "", | |
"qos": "", | |
"retain": "true", | |
"respTopic": "", | |
"contentType": "", | |
"userProps": "", | |
"correl": "", | |
"expiry": "", | |
"broker": "c1f9b3d52d33b78a", | |
"x": 2270, | |
"y": 400, | |
"wires": [], | |
"info": "test" | |
}, | |
{ | |
"id": "da10c8f3733d579c", | |
"type": "switch", | |
"z": "76106b40e1ce3c2f", | |
"name": "endpoint", | |
"property": "endpoint", | |
"propertyType": "msg", | |
"rules": [ | |
{ | |
"t": "eq", | |
"v": "/image/front/img.jpg", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/activities/info", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/statuslog", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/batteryStatus", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/dockingInfo", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/emergencyStop", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/heater", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/mowerInfo", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/mowingInfo", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/networkInfo", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/sensors/baseboard", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/sensors/module", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/version", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/exploringInfo", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/powermanager", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/system/memoryInfo", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/settings/mowing", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/settings/mowingPlanner", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/settings/docking", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/settings/lineMowActivity", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/settings/mowActivity", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "/settings/mapping", | |
"vt": "str" | |
} | |
], | |
"checkall": "true", | |
"repair": false, | |
"outputs": 22, | |
"x": 1640, | |
"y": 440, | |
"wires": [ | |
[ | |
"45f5546925eb4b96" | |
], | |
[ | |
"6bacf2cdcab9a8fe" | |
], | |
[ | |
"b2f0f9bc03e48eba" | |
], | |
[ | |
"8cdf8b2f2539af9f" | |
], | |
[ | |
"d34a9e186aaea4d8" | |
], | |
[ | |
"00c2957a7a405539" | |
], | |
[ | |
"869336380625ea3f" | |
], | |
[], | |
[ | |
"8c25bdcb244fbc50" | |
], | |
[ | |
"e897039186ace599" | |
], | |
[], | |
[], | |
[ | |
"7a9138147661e937" | |
], | |
[ | |
"3f46c7e6c132341b" | |
], | |
[ | |
"fb2008061d27441e" | |
], | |
[ | |
"5d166de699ae1a8f" | |
], | |
[ | |
"3ecd8a5b7fb1c877" | |
], | |
[ | |
"0ce10ed340c6dd52" | |
], | |
[ | |
"b5889ec9a7668aaa" | |
], | |
[ | |
"199b0af2c88d3b1a" | |
], | |
[ | |
"56a9f0ade0f0a976" | |
], | |
[] | |
] | |
}, | |
{ | |
"id": "8c25bdcb244fbc50", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/mowingInfo", | |
"func": "/*\nhttp://x.x.x.x:8080/system/mowingInfo\n{\n\t\"currentZoneId\" : 1,\n\t\"lastRainTime\" : \"2022-03-20 09:50:02\",\n\t\"mowingTime\" : \n\t{\n\t\t\"today\" : 0,\n\t\t\"total\" : 4271\n\t},\n\t\"nextZoneId\" : -1,\n\t\"numberOfZones\" : 1,\n\t\"todayEndTime\" : \"15:56:27\",\n\t\"totalArea\" : 1004.849096,\n\t\"totalElapsedMowingTime\" : 1742,\n\t\"totalRequiredMowingTime\" : 0,\n\t\"zonesInfo\" : \n\t[\n\t\t{\n\t\t\t\"area\" : 1004.849096,\n\t\t\t\"elapsedMowingTime\" : 1742,\n\t\t\t\"elapsedMowingTimeToday\" : 0,\n\t\t\t\"id\" : 1,\n\t\t\t\"requiredMowingTime\" : 0,\n\t\t\t\"resumeMowingTime\" : \"2022-03-22 09:41:00\"\n\t\t}\n\t]\n}\n*/\nvar zonesInfo = msg.payload.zonesInfo;\nvar numberOfZones = zonesInfo.length;\nvar result = [\n{\n payload: {\n unique_id: msg.toadi_reference+'_current_zone_id',\n name: msg.toadi_name + ' Current Zone Id',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:texture-box',\n value_template: '{{ value_json.currentZoneId }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/current_zone_id/config'\n},{\n payload: {\n unique_id: msg.toadi_reference+'_mowing_time_today',\n name: msg.toadi_name + ' Mowing Time Today',\n device: msg.toadi_device,\n unit_of_measurement: 'min',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:timer-outline',\n value_template: '{{ value_json.mowingTime.today }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/mowing_time_today/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_lastRainTime',\n name: msg.toadi_name + ' Last Rain Time',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:timer-outline',\n value_template: '{{ value_json.lastRainTime }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/last_rain_time/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_todayEndTime',\n name: msg.toadi_name + ' Today End Time',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:timer-outline',\n value_template: '{{ value_json.todayEndTime }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/today_end_time/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_mowing_time_total',\n name: msg.toadi_name + ' Mowing Time Total',\n device: msg.toadi_device,\n unit_of_measurement: 'min',\n state_class:'total',\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:timer-outline',\n value_template: '{{ value_json.mowingTime.total }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/mowing_time_total/config'\n}\n];\n\n/*\nfor (var i = 0; i < numberOfZones; i++) {\n result.push(\n {\n payload: {\n unique_id: msg.toadi_reference+'_zone_'+zonesInfo[i].id,\n name: msg.toadi_name + ' Zone '+zonesInfo[i].id,\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:texture-box',\n value_template: '{% if value_json.currentZoneId == value_json.zonesInfo['+i+'].id %}Mowing{% else %}Idle{% endif %}',\n payload_on: 'Mowing',\n payload_off: 'Idle',\n json_attributes_topic: msg.toadi_name+msg.endpoint,\n json_attributes_template: '{\"area\": \"{{ value_json.zonesInfo['+i+'].area | round(0) }}\", \"elapsedMowingTime\": \"{{ (value_json.zonesInfo['+i+'].elapsedMowingTime / 60) | round(0) }}\", \"elapsedMowingTimeToday\": \"{{ (value_json.zonesInfo['+i+'].elapsedMowingTimeToday / 60) | round(0) }}\", \"requiredMowingTime\": \"{{ (value_json.zonesInfo['+i+'].requiredMowingTime / 60) | round(0) }}\", \"percentageComplete\": \"{% if 0 in [ value_json.zonesInfo['+i+'].requiredMowingTime, value_json.zonesInfo['+i+'].elapsedMowingTime ] %}0{% else %}{{ ((value_json.zonesInfo['+i+'].requiredMowingTime / value_json.zonesInfo['+i+'].elapsedMowingTime) * 10) | round(0) }}{% endif %}\"}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/zone_'+zonesInfo[i].id+'/config'\n }\n );\n}\n*/\nreturn [result];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 460, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "d34a9e186aaea4d8", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/dockingInfo", | |
"func": "/*\nhttp://x.x.x.x:8080/system/dockingInfo\n\n{\n\t\"chargeStatus\" : \"Vin Uvcl active\",\n\t\"chargerState\" : \"cc-cv charge\",\n\t\"chargingCurrent\" : 2.4362164878845216,\n\t\"chargingPower\" : 32.176526481073097,\n\t\"counters\" : \n\t{\n\t\t\"AutoCharging\" : 111,\n\t\t\"ConnectToCharger\" : 10,\n\t\t\"FindPositionInMap\" : 8,\n\t\t\"GotoChargingStationProximity\" : 221,\n\t\t\"GotoRetryPosition\" : 575,\n\t\t\"ManualCharging\" : 130,\n\t\t\"PositionInFrontOfChargingStation\" : 390,\n\t\t\"StartDocking\" : 2\n\t},\n\t\"dockingPosition\" : \"Good\",\n\t\"dockingState\" : \"AutoCharging\"\n}\n*/\nreturn [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_docking_state',\n name: msg.toadi_name + ' Docking State',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.dockingState }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/docking_state/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_docking_position',\n name: msg.toadi_name + ' Docking Position',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.dockingPosition }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/docking_position/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_charge_status',\n name: msg.toadi_name + ' Charge Status',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.chargeStatus }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/charge_status/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_charger_state',\n name: msg.toadi_name + ' Charger State',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.chargerState }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/charger_state/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_charging_current',\n name: msg.toadi_name + ' Charging Current',\n device: msg.toadi_device,\n device_class: 'current',\n unit_of_measurement: 'A',\n state_class: 'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ (value_json.chargingCurrent | float) | round(2) }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/charging_current/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_chargingPower',\n name: msg.toadi_name + ' Charging Power',\n device: msg.toadi_device,\n device_class: 'current',\n unit_of_measurement: 'W',\n state_class: 'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ (value_json.chargingPower | float) | round(2) }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/chargingPower/config'\n }\n ]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 300, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "25f9cad42d177c45", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/dockingInfo", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 940, | |
"y": 300, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "2f9ab070cffe32ad", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/mowerInfo", | |
"func": "/*\nhttp://x.x.x.x:8080/system/mowerInfo\n{\n\t\"mowerHeight\" : 0.042000003159046173,\n\t\"rpm\" : 0\n}\n*/\n\nreturn [[\n{\n // mower height via settings\n /*payload: {\n unique_id: msg.toadi_reference+'_mower_height',\n name: msg.toadi_name + ' Mower Height',\n device: msg.toadi_device,\n unit_of_measurement: 'cm',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:align-vertical-distribute',\n value_template: '{{ (value_json.mowerHeight | float * 100) | round(2) }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/mower_height/config'*/\n},\n\n// rpm in status log\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1910, | |
"y": 420, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "c3a35f3c09d18f04", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/mowerInfo", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 930, | |
"y": 420, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "7a9138147661e937", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/version", | |
"func": "/*\nhttp://x.x.x.x:8080/system/version\n{\n\t\"applicationVersion\" : \"3.3.8-202203041428+1595455\",\n\t\"osVersion\" : \"5b4df5062a9f010a621ffb72a2f0688fc921c450\"\n}\n*/\n\nreturn [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_version_application',\n name: msg.toadi_name + ' Version Application',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:application',\n value_template: '{{ value_json.applicationVersion }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/version_application/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_version_os',\n name: msg.toadi_name + ' Version OS',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:calendar-text',\n value_template: '{{ value_json.osVersion }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/version_os/config'\n }\n ]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1900, | |
"y": 540, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "8d623cf51d94e76a", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/version", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 920, | |
"y": 540, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "5a3fbc7cf45dd45f", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"d": true, | |
"name": "/system/heater", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 920, | |
"y": 380, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "869336380625ea3f", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/heater", | |
"func": "/*\nhttp://x.x.x.x:8080/system/heater\n{\n\t\"status\" : \"off\"\n}\n*/\nreturn [[\n{\n payload: {\n unique_id: msg.toadi_reference+'_heater_status',\n name: msg.toadi_name + ' Heater Status',\n device: msg.toadi_device,\n device_class: 'heat',\n payload_on: 'on',\n payload_off: 'off',\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:radiator',\n value_template: '{{ value_json.status }}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/heater_status/config'\n}\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1900, | |
"y": 380, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "8fad06dacfbb7aba", | |
"type": "inject", | |
"z": "76106b40e1ce3c2f", | |
"name": "update MQTT discovery", | |
"props": [ | |
{ | |
"p": "flowType", | |
"v": "mqttDiscovery", | |
"vt": "str" | |
} | |
], | |
"repeat": "", | |
"crontab": "00 01 * * *", | |
"once": true, | |
"onceDelay": "60", | |
"topic": "", | |
"x": 150, | |
"y": 300, | |
"wires": [ | |
[ | |
"4c649abe395578c0" | |
] | |
] | |
}, | |
{ | |
"id": "02eb5bd7e2a869a1", | |
"type": "switch", | |
"z": "76106b40e1ce3c2f", | |
"name": "flowType", | |
"property": "flowType", | |
"propertyType": "msg", | |
"rules": [ | |
{ | |
"t": "eq", | |
"v": "camera", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "sensor", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "mqttDiscovery", | |
"vt": "str" | |
} | |
], | |
"checkall": "true", | |
"repair": false, | |
"outputs": 3, | |
"x": 1460, | |
"y": 300, | |
"wires": [ | |
[ | |
"114c146f98589a35" | |
], | |
[ | |
"114c146f98589a35" | |
], | |
[ | |
"da10c8f3733d579c" | |
] | |
] | |
}, | |
{ | |
"id": "e897039186ace599", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/networkInfo", | |
"func": "/*\nhttp://x.x.x.x:8080/system/networkInfo\n{\n\t\"default\" : \"Wifi\",\n\t\"mobile\" : \n\t{\n\t\t\"reason\" : \"None\",\n\t\t\"state\" : \"Online\"\n\t},\n\t\"state\" : \"Online\",\n\t\"wifi\" : \n\t{\n\t\t\"localIp\" : \"x.x.x.x\",\n\t\t\"reason\" : \"None\",\n\t\t\"signal\" : 51,\n\t\t\"ssid\" : \"IoT\",\n\t\t\"state\" : \"Online\"\n\t}\n}\n*/\n\nreturn [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_wifi_signal',\n name: msg.toadi_name + ' Wifi Signal',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n unit_of_measurement: '%',\n icon: 'mdi:signal',\n value_template: '{{ value_json.wifi.signal }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/wifi_signal/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_wifi_ssid',\n name: msg.toadi_name + ' Wifi SSID',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:wifi',\n value_template: '{{ value_json.wifi.ssid }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/wifi_ssid/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_wifi_state',\n name: msg.toadi_name + ' Wifi State',\n device: msg.toadi_device,\n device_class: 'connectivity',\n payload_on: 'Online',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.wifi.state }}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/wifi_state/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_mobile_state',\n name: msg.toadi_name + ' Mobile State',\n device: msg.toadi_device,\n device_class: 'connectivity',\n payload_on: 'Online',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.mobile.state }}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/mobile_state/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_mobile_reason',\n name: msg.toadi_name + ' Mobile Reason',\n device: msg.toadi_device,\n device_class: 'connectivity',\n payload_on: 'Online',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.mobile.reason }}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/mobile_reason/config'\n }\n ]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 500, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "978945109cc2232a", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/networkInfo", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 940, | |
"y": 500, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "45f5546925eb4b96", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/image/front/img.jpg", | |
"func": "return [[\n {\n payload: {\n unique_id: 'toadi_camera_front',\n name: 'Toadi Camera Front',\n device: msg.toadi_device,\n topic: msg.toadi_name+msg.endpoint\n },\n topic: 'homeassistant/camera/toadi_camera_front/config'\n }\n]];\n", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 100, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "a3152f411cb8f5cb", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/image/front/img.jpg", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 940, | |
"y": 100, | |
"wires": [ | |
[ | |
"887e37cd8d41b0f8" | |
] | |
] | |
}, | |
{ | |
"id": "887e37cd8d41b0f8", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "GET binary", | |
"method": "GET", | |
"ret": "bin", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"authType": "", | |
"senderr": true, | |
"x": 1170, | |
"y": 100, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1" | |
] | |
] | |
}, | |
{ | |
"id": "6282c4c1df7b3c37", | |
"type": "catch", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"scope": null, | |
"uncaught": false, | |
"x": 100, | |
"y": 100, | |
"wires": [ | |
[ | |
"a837d1f0e5aa608a", | |
"7913c148927d239f" | |
] | |
] | |
}, | |
{ | |
"id": "f44b58208dc894d9", | |
"type": "inject", | |
"z": "76106b40e1ce3c2f", | |
"d": true, | |
"name": "update camera", | |
"props": [ | |
{ | |
"p": "flowType", | |
"v": "camera", | |
"vt": "str" | |
} | |
], | |
"repeat": "1", | |
"crontab": "", | |
"once": true, | |
"onceDelay": 0.1, | |
"topic": "", | |
"x": 120, | |
"y": 360, | |
"wires": [ | |
[ | |
"4c649abe395578c0" | |
] | |
] | |
}, | |
{ | |
"id": "08532cdd8dcec28b", | |
"type": "switch", | |
"z": "76106b40e1ce3c2f", | |
"name": "flowType", | |
"property": "flowType", | |
"propertyType": "msg", | |
"rules": [ | |
{ | |
"t": "eq", | |
"v": "camera", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "switch", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "willowSetup", | |
"vt": "str" | |
}, | |
{ | |
"t": "else" | |
} | |
], | |
"checkall": "false", | |
"repair": false, | |
"outputs": 4, | |
"x": 600, | |
"y": 360, | |
"wires": [ | |
[ | |
"a3152f411cb8f5cb" | |
], | |
[ | |
"32eac6dd94498aa6" | |
], | |
[ | |
"4778309cdf3b8e81" | |
], | |
[ | |
"6ab8f3f4a8448ee1", | |
"6bdbbebe7cc60504", | |
"25f9cad42d177c45", | |
"5a3fbc7cf45dd45f", | |
"c3a35f3c09d18f04", | |
"be38429c527a723d", | |
"978945109cc2232a", | |
"8d623cf51d94e76a", | |
"838e366ecc405ea4", | |
"60b39fca4c15775a", | |
"ab61dabff3d82e74", | |
"a1e9a99fdb3e57aa", | |
"081f3b0750ad5231", | |
"c477db7fa0ad5a38", | |
"408cfb1f4dc379be" | |
] | |
] | |
}, | |
{ | |
"id": "838e366ecc405ea4", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/emergencyStop", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;\n\n\n// return [[\n// {\n// url: msg.toadi_uri + node.name,\n// topic: msg.toadi_name + node.name,\n// endpoint: node.name\n// }\n// ]];", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 950, | |
"y": 340, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "00c2957a7a405539", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/emergencyStop", | |
"func": "/*\nhttp://x.x.x.x:8080/system/emergencyStop\n{\n\t\"description\" : \"Sensors: [\\\"learning\\\"]\"\n}\n*/\nreturn [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_emergency_stop_description',\n name: msg.toadi_name + ' Emergency Stop Description',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:car-brake-alert',\n value_template: '{{ value_json.description }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/emergency_stop_description/config'\n }\n ]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1930, | |
"y": 340, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "60b39fca4c15775a", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/statuslog", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 910, | |
"y": 260, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "b2f0f9bc03e48eba", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/statuslog", | |
"func": "return [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_activity',\n name: msg.toadi_name + ' Activity',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{% for key in value_json.statuslog.activity %}{{key}},{% endfor %}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/activity/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_sensor_gps',\n name: msg.toadi_name + ' GPS',\n device: msg.toadi_device,\n source_type: 'gps',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.statuslog.sensors.gps.valid }}',\n payload_available: 'true',\n payload_not_available: 'false',\n icon: 'mdi:robot-mower',\n json_attributes_topic: msg.toadi_reference+msg.endpoint,\n json_attributes_template: '{\"latitude\": \"{{ value_json.statuslog.sensors.gps.latitude}}\", \"longitude\": \"{{ value_json.statuslog.sensors.gps.longitude}}\", \"gps_accuracy\": \"{{ value_json.statuslog.sensors.gps.accuracy}}\"}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/sensor_gps/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_baseboard_humidity',\n name: msg.toadi_name + ' Baseboard Humidity',\n device: msg.toadi_device,\n device_class: 'humidity',\n unit_of_measurement: '%',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.statuslog.sensors.humidity.baseboard | round (0) }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/baseboard_humidity/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_baseboard_temperature',\n name: msg.toadi_name + ' Baseboard Temperature',\n device: msg.toadi_device,\n device_class: 'temperature',\n unit_of_measurement: '°C',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.statuslog.sensors.temperature.baseboard | round (2) }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/baseboard_temperature/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_module_temperature',\n name: msg.toadi_name + ' Module Temperature',\n device: msg.toadi_device,\n device_class: 'temperature',\n unit_of_measurement: '°C',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.statuslog.sensors.temperature.module | round (2) }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/module_temperature/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_rpm',\n name: msg.toadi_name + ' Rpm',\n device: msg.toadi_device,\n unit_of_measurement: 'rpm',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:fan',\n value_template: '{{ value_json.statuslog.mower.rpm }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/rpm/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_mower_state',\n name: msg.toadi_name + ' Mower State',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:fan',\n value_template: '{{ value_json.statuslog.mower.state }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/mower_state/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_charger_state',\n name: msg.toadi_name + ' Charger State',\n device: msg.toadi_device,\n device_class: 'power',\n payload_on: '1',\n payload_off: '0',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.statuslog.battery.chargerState }}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/charger_state/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_battery_percentage',\n name: msg.toadi_name + ' Battery Percentage',\n device: msg.toadi_device,\n device_class: 'battery',\n unit_of_measurement: '%',\n state_class:'measurement',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.statuslog.battery.percentage }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/battery_percentage/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_emergency_stop_hard',\n name: msg.toadi_name + ' Emergency Stop',\n device: msg.toadi_device,\n icon: 'mdi:car-brake-alert',\n state_topic: msg.toadi_reference+msg.endpoint,\n state_on: true,\n state_off: false,\n optimistic: false,\n value_template: '{{ value_json.statuslog.emergencyStop.active }}',\n command_topic: msg.toadi_reference+'/set/emergencyStop'\n },\n topic: 'homeassistant/switch/'+msg.toadi_reference+'/emergency_stop_hard/config'\n },\n\t{\n payload: {\n unique_id: msg.toadi_reference+'_rain_status',\n name: msg.toadi_name + ' Rain Status',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:weather-rainy',\n value_template: '{{ value_json.statuslog.sensors.rain.name }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/rain_status/config'\n },\n]];\n", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1890, | |
"y": 260, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "ab61dabff3d82e74", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/activities/info", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 920, | |
"y": 140, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "6bacf2cdcab9a8fe", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/activities/info", | |
"func": "/*\nhttp://x.x.x.x:8080/activities/info\n{\n\t\"scheduledActivity\" : \"MowingPlannerActivity\",\n\t\"userActivity\" : \"\"\n}\n*/\n\nreturn [[\n{\n payload: {\n unique_id: msg.toadi_reference+'_scheduled_activity',\n name: msg.toadi_name + ' Scheduled Activity',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:calendar-clock-outline',\n value_template: '{{ value_json.scheduledActivity }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/scheduled_activity/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_user_activity',\n name: msg.toadi_name + ' User Activity',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n icon: 'mdi:account-check-outline',\n value_template: '{{ value_json.userActivity }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/user_activity/config'\n}\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1900, | |
"y": 140, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "0169343a4b91326f", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"method": "use", | |
"ret": "txt", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1190, | |
"y": 700, | |
"wires": [ | |
[] | |
] | |
}, | |
{ | |
"id": "75a389967a6a0c2b", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "set flowType", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "flowType", | |
"pt": "msg", | |
"to": "switch", | |
"tot": "str" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 290, | |
"y": 180, | |
"wires": [ | |
[ | |
"4c649abe395578c0" | |
] | |
] | |
}, | |
{ | |
"id": "4c649abe395578c0", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "configuration", | |
"func": "//Configuration\nvar toadi = {\n ip: '192.168.0.100',\n serial: 'TOADI000000000',\n mac: '12:34:56:78:9a:bc',\n custom_name: 'Willow'\n};\n\nmsg.toadi_uri = 'http://'+toadi.ip+':8080';\nmsg.toadi_name = toadi.custom_name;\nmsg.toadi_reference = msg.toadi_name.replace(/[^\\w\\s]/gi, '')\nmsg.toadi_reference = msg.toadi_reference.toLowerCase(); \nmsg.toadi_reference = msg.toadi_reference.split(' ').join('_');\nmsg.toadi_device = {\n configuration_url: 'http://'+toadi.ip+':8080/',\n identifiers: toadi.serial,\n connections: [\n [\n \"mac\",\n toadi.mac\n ]\n ],\n manufacturer: \"Eeve\",\n name: toadi.custom_name,\n suggested_area: \"Garden\",\n model: \"Willow\",\n via_device: \"Node Red\"\n};\n\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 410, | |
"y": 360, | |
"wires": [ | |
[ | |
"08532cdd8dcec28b", | |
"eda4615b480bf154" | |
] | |
] | |
}, | |
{ | |
"id": "c477db7fa0ad5a38", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/exploringInfo", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 940, | |
"y": 580, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "a1e9a99fdb3e57aa", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"d": true, | |
"name": "/system/memoryInfo", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 940, | |
"y": 660, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "081f3b0750ad5231", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/powermanager", | |
"func": "msg.url = msg.toadi_uri + node.name;\nmsg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\n\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 950, | |
"y": 620, | |
"wires": [ | |
[ | |
"d8f740430de5284c" | |
] | |
] | |
}, | |
{ | |
"id": "3f46c7e6c132341b", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/exploringInfo", | |
"func": "/*\nhttp://x.x.x.x:8080/system/exploringInfo\n{\n\t\"exploringState\":\"Idle\",\n\t\"startedOnStation\":false\n}\n*/\n\nreturn [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_exploring_info_state',\n name: msg.toadi_name + ' Exploring State',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.exploringState }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/exploring_info_state/config'\n },{\n payload: {\n unique_id: msg.toadi_reference+'_exploring_info',\n name: msg.toadi_name + ' Exploring from station',\n device: msg.toadi_device,\n payload_available: 'true',\n payload_not_available: 'false',\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.startedOnStation }}'\n },\n topic: 'homeassistant/binary_sensor/'+msg.toadi_reference+'/exploring_info/config'\n }\n ]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 580, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "fb2008061d27441e", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/powermanager", | |
"func": "/*\nhttp://x.x.x.x:8080/system/powermanager\n{\n\t\"status\": \"ReducedPower\"\n}\n*/\n\nreturn [[\n{\n payload: {\n unique_id: msg.toadi_reference+'_power_manager',\n name: msg.toadi_name + ' Power Manager',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.status }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/power_manager/config'\n }\n ]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1930, | |
"y": 620, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "5d166de699ae1a8f", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/system/memoryInfo", | |
"func": "/*\nhttp://x.x.x.x:8080/system/memoryInfo\n{\n \"buffers\": 189424,\n \"cached\": 1148528,\n \"free\": 587768,\n \"procPss\": 1784766,\n \"procSize\": 13706496,\n \"total\": 4056388,\n \"used\": 2130668\n}\n*/\n\nreturn [[\n {\n payload: {\n unique_id: msg.toadi_reference+'_memory_buffers',\n name: msg.toadi_name + ' Memory Buffers',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.buffers }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/memory_buffers/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_memory_cached',\n name: msg.toadi_name + ' Memory Cached',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.cached }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/memory_cached/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_memory_free',\n name: msg.toadi_name + ' Memory free',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.free }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/memory_free/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_memory_procPss',\n name: msg.toadi_name + ' Memory procPss',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.procPss }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/memory_procPss/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_memory_procSize',\n name: msg.toadi_name + ' Memory procSize',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.procSize }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/memory_procSize/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_memory_total',\n name: msg.toadi_name + ' Memory total',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.total }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/memory_total/config'\n },\n {\n payload: {\n unique_id: msg.toadi_reference+'_memory_used',\n name: msg.toadi_name + ' Memory used',\n device: msg.toadi_device,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.used }}'\n },\n topic: 'homeassistant/sensor/'+msg.toadi_reference+'/memory_used/config'\n },\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 660, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "77338c21309c463d", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "beginTimeAfterSunrise", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 950, | |
"y": 740, | |
"wires": [ | |
[ | |
"9d6a7d4807b7af43" | |
] | |
] | |
}, | |
{ | |
"id": "9d6a7d4807b7af43", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "get JSON", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1180, | |
"y": 740, | |
"wires": [ | |
[ | |
"da8f19915002e5d6" | |
] | |
] | |
}, | |
{ | |
"id": "da8f19915002e5d6", | |
"type": "join", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"mode": "custom", | |
"build": "object", | |
"property": "payload", | |
"propertyType": "msg", | |
"key": "key", | |
"joiner": "\\n", | |
"joinerType": "str", | |
"accumulate": false, | |
"timeout": "", | |
"count": "1", | |
"reduceRight": false, | |
"reduceExp": "", | |
"reduceInit": "", | |
"reduceInitType": "", | |
"reduceFixup": "", | |
"x": 1310, | |
"y": 740, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1", | |
"aee831fe73a74ce6" | |
] | |
] | |
}, | |
{ | |
"id": "3767d329d51444c5", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "mowingPattern", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 920, | |
"y": 780, | |
"wires": [ | |
[ | |
"7377094dc0ed70cc" | |
] | |
] | |
}, | |
{ | |
"id": "7377094dc0ed70cc", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "get JSON", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1180, | |
"y": 780, | |
"wires": [ | |
[ | |
"85cbc6fcee1c607b" | |
] | |
] | |
}, | |
{ | |
"id": "85cbc6fcee1c607b", | |
"type": "join", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"mode": "custom", | |
"build": "object", | |
"property": "payload", | |
"propertyType": "msg", | |
"key": "key", | |
"joiner": "\\n", | |
"joinerType": "str", | |
"accumulate": false, | |
"timeout": "", | |
"count": "2", | |
"reduceRight": false, | |
"reduceExp": "", | |
"reduceInit": "", | |
"reduceInitType": "", | |
"reduceFixup": "", | |
"x": 1310, | |
"y": 780, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1", | |
"aee831fe73a74ce6" | |
] | |
] | |
}, | |
{ | |
"id": "d23fc46ee6cfd675", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "mowingFrequency", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 930, | |
"y": 820, | |
"wires": [ | |
[ | |
"7377094dc0ed70cc" | |
] | |
] | |
}, | |
{ | |
"id": "5b3d30e6ef5f5fd1", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/mowingPlanner", | |
"func": "msg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\nmsg.join = msg.endpoint.replace('/settings/','');\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 710, | |
"y": 800, | |
"wires": [ | |
[ | |
"3767d329d51444c5", | |
"d23fc46ee6cfd675" | |
] | |
] | |
}, | |
{ | |
"id": "f3160912175db2ac", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/mowing", | |
"func": "msg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\nmsg.join = msg.endpoint.replace('/settings/','');\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 680, | |
"y": 740, | |
"wires": [ | |
[ | |
"77338c21309c463d" | |
] | |
] | |
}, | |
{ | |
"id": "7a091f98ce94e6ef", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "fixedPole", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 900, | |
"y": 900, | |
"wires": [ | |
[ | |
"465b4e5422313784" | |
] | |
] | |
}, | |
{ | |
"id": "494874dbcc642afb", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/docking", | |
"func": "msg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\nmsg.join = msg.endpoint.replace('/settings/','');\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 680, | |
"y": 880, | |
"wires": [ | |
[ | |
"b50ac3e4a3ab0459", | |
"7a091f98ce94e6ef", | |
"109b84aec6585a3d" | |
] | |
] | |
}, | |
{ | |
"id": "b50ac3e4a3ab0459", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "autoDockingEnabled", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 940, | |
"y": 860, | |
"wires": [ | |
[ | |
"465b4e5422313784" | |
] | |
] | |
}, | |
{ | |
"id": "465b4e5422313784", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "get JSON", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1180, | |
"y": 860, | |
"wires": [ | |
[ | |
"29fefe6eb227eaf4" | |
] | |
] | |
}, | |
{ | |
"id": "29fefe6eb227eaf4", | |
"type": "join", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"mode": "custom", | |
"build": "object", | |
"property": "payload", | |
"propertyType": "msg", | |
"key": "key", | |
"joiner": "\\n", | |
"joinerType": "str", | |
"accumulate": false, | |
"timeout": "", | |
"count": "3", | |
"reduceRight": false, | |
"reduceExp": "", | |
"reduceInit": "", | |
"reduceInitType": "", | |
"reduceFixup": "", | |
"x": 1310, | |
"y": 860, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1", | |
"aee831fe73a74ce6" | |
] | |
] | |
}, | |
{ | |
"id": "109b84aec6585a3d", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "safeDrivingToChargerEnabled", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 970, | |
"y": 940, | |
"wires": [ | |
[ | |
"465b4e5422313784" | |
] | |
] | |
}, | |
{ | |
"id": "529cb9ee97de6076", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/lineMowActivity", | |
"func": "msg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\nmsg.join = msg.endpoint.replace('/settings/','');\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 710, | |
"y": 980, | |
"wires": [ | |
[ | |
"219ec910e95697e0" | |
] | |
] | |
}, | |
{ | |
"id": "219ec910e95697e0", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "lineDirection", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 910, | |
"y": 980, | |
"wires": [ | |
[ | |
"5cf2ff967ad96bdb" | |
] | |
] | |
}, | |
{ | |
"id": "5cf2ff967ad96bdb", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "get JSON", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1180, | |
"y": 980, | |
"wires": [ | |
[ | |
"e8f0c584debf263b" | |
] | |
] | |
}, | |
{ | |
"id": "e8f0c584debf263b", | |
"type": "join", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"mode": "custom", | |
"build": "object", | |
"property": "payload", | |
"propertyType": "msg", | |
"key": "key", | |
"joiner": "\\n", | |
"joinerType": "str", | |
"accumulate": false, | |
"timeout": "", | |
"count": "1", | |
"reduceRight": false, | |
"reduceExp": "", | |
"reduceInit": "", | |
"reduceInitType": "", | |
"reduceFixup": "", | |
"x": 1310, | |
"y": 980, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1", | |
"aee831fe73a74ce6" | |
] | |
] | |
}, | |
{ | |
"id": "8454a0b902ae7694", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "mowBorderWidth", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 930, | |
"y": 1060, | |
"wires": [ | |
[ | |
"0001d0accb210488" | |
] | |
] | |
}, | |
{ | |
"id": "8bcbf55cee1b276a", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/mowActivity", | |
"func": "msg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\nmsg.join = msg.endpoint.replace('/settings/','');\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 700, | |
"y": 1040, | |
"wires": [ | |
[ | |
"9c83d29a973fb877", | |
"8454a0b902ae7694", | |
"4ac01f0d71740d87" | |
] | |
] | |
}, | |
{ | |
"id": "9c83d29a973fb877", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "mowBorderMinimumWidth", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 960, | |
"y": 1020, | |
"wires": [ | |
[ | |
"0001d0accb210488" | |
] | |
] | |
}, | |
{ | |
"id": "0001d0accb210488", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "get JSON", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1180, | |
"y": 1020, | |
"wires": [ | |
[ | |
"4c9e0a2cf587000d" | |
] | |
] | |
}, | |
{ | |
"id": "4c9e0a2cf587000d", | |
"type": "join", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"mode": "custom", | |
"build": "object", | |
"property": "payload", | |
"propertyType": "msg", | |
"key": "key", | |
"joiner": "\\n", | |
"joinerType": "str", | |
"accumulate": false, | |
"timeout": "", | |
"count": "3", | |
"reduceRight": false, | |
"reduceExp": "", | |
"reduceInit": "", | |
"reduceInitType": "", | |
"reduceFixup": "", | |
"x": 1310, | |
"y": 1020, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1", | |
"aee831fe73a74ce6" | |
] | |
] | |
}, | |
{ | |
"id": "765b3df862969761", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "exploringEnabled", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 930, | |
"y": 1180, | |
"wires": [ | |
[ | |
"f6a46d0250cbd5e4" | |
] | |
] | |
}, | |
{ | |
"id": "67bdc5e1984406b3", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/mapping", | |
"func": "msg.topic = msg.toadi_reference + node.name;\nmsg.endpoint = node.name;\nmsg.join = msg.endpoint.replace('/settings/','');\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 690, | |
"y": 1160, | |
"wires": [ | |
[ | |
"aba07cb370e5a3f7", | |
"765b3df862969761" | |
] | |
] | |
}, | |
{ | |
"id": "aba07cb370e5a3f7", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "multizoneEnabled", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 930, | |
"y": 1140, | |
"wires": [ | |
[ | |
"f6a46d0250cbd5e4" | |
] | |
] | |
}, | |
{ | |
"id": "f6a46d0250cbd5e4", | |
"type": "http request", | |
"z": "76106b40e1ce3c2f", | |
"name": "get JSON", | |
"method": "GET", | |
"ret": "obj", | |
"paytoqs": "ignore", | |
"url": "", | |
"tls": "", | |
"persist": false, | |
"proxy": "", | |
"insecureHTTPParser": false, | |
"authType": "", | |
"senderr": true, | |
"headers": [], | |
"x": 1180, | |
"y": 1140, | |
"wires": [ | |
[ | |
"7edfcc636fee3793" | |
] | |
] | |
}, | |
{ | |
"id": "7edfcc636fee3793", | |
"type": "join", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"mode": "custom", | |
"build": "object", | |
"property": "payload", | |
"propertyType": "msg", | |
"key": "key", | |
"joiner": "\\n", | |
"joinerType": "str", | |
"accumulate": false, | |
"timeout": "", | |
"count": "2", | |
"reduceRight": false, | |
"reduceExp": "", | |
"reduceInit": "", | |
"reduceInitType": "", | |
"reduceFixup": "", | |
"x": 1310, | |
"y": 1140, | |
"wires": [ | |
[ | |
"02eb5bd7e2a869a1", | |
"aee831fe73a74ce6" | |
] | |
] | |
}, | |
{ | |
"id": "3ecd8a5b7fb1c877", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/mowing", | |
"func": "return [[\n\n{\n payload: {\n\t\tdevice: msg.toadi_device,\n\t\t\"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/beginTimeAfterSunrise\",\n\t\tname: msg.toadi_name + ' Wait hours after sunrise',\n\t\tstep: \"60\",\n \t\"max\": 720,\n \t\"min\": 0,\n \t\"unit_of_measurement\": \"min\",\n\t\tentity_category: \"config\",\n\t\tuniq_id: msg.toadi_reference+'_wait_hours_setting',\n\t\t\"state_topic\": msg.toadi_reference+msg.endpoint,\n\t\tvalue_template: '{{ (value_json.beginTimeAfterSunrise) }}'\n },\n topic: 'homeassistant/number/'+msg.toadi_reference+'/wait_hours/config'\n},\n\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 740, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "0ce10ed340c6dd52", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/mowingPlanner", | |
"func": "return [[\n{\n payload: {\n\t\tdevice: msg.toadi_device,\n\t\t\"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/mowingFrequency\",\n\t\tname: msg.toadi_name + ' Mowing Frequency',\n \"options\": [\n \"STOP\",\n \"LESS\",\n \"NORMAL\",\n \"MORE\",\n \"CONTINUOUS\"\n ],\n\t\tentity_category: \"config\",\n\t\tuniq_id: msg.toadi_reference+'_mowing_frequency_setting',\n\t\t\"state_topic\": msg.toadi_reference+msg.endpoint,\n\t\tvalue_template: '{{ (value_json.mowingFrequency) }}'\n },\n topic: 'homeassistant/select/'+msg.toadi_reference+'/mowing_frequency/config'\n},\n{\n payload: {\n\t\tdevice: {\n\t\t\tidentifiers: [msg.toadi_reference],\n\t\t\t\"connections\": msg.toadi_device.connections,\n\t\t\tname: msg.toadi_name,\n\t\t},\n\t\tcommand_topic: msg.toadi_reference+'/set'+msg.endpoint+\"/mowingPattern\",\n\t\tname: msg.toadi_name + ' Mowing Pattern',\n options: [\n \"RANDOM\",\n \"LINES\"\n ],\n\t\tentity_category: \"config\",\n\t\tuniq_id: msg.toadi_reference+'_mowing_pattern_setting',\n\t\tstate_topic: msg.toadi_reference+msg.endpoint,\n\t\tvalue_template: '{{ (value_json.mowingPattern) }}'\n },\n topic: 'homeassistant/select/'+msg.toadi_reference+'/mowing_pattern/config'\n},\n\n// rpm in status log\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1940, | |
"y": 780, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "4ac01f0d71740d87", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "mowerHeight", | |
"func": "msg.url = msg.toadi_uri + msg.endpoint + '/' + node.name;\nmsg.key = node.name;\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 920, | |
"y": 1100, | |
"wires": [ | |
[ | |
"0001d0accb210488" | |
] | |
] | |
}, | |
{ | |
"id": "56a9f0ade0f0a976", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/mowActivity", | |
"func": "return [[\n{\n payload: {\n\t\tdevice: msg.toadi_device,\n\t\t\"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/mowerHeight\",\n\t\tname: msg.toadi_name + ' Mower Height',\n\t\tstep: \"1\",\n \t\"max\": 90,\n \t\"min\": 25,\n \t\"unit_of_measurement\": \"mm\",\n\t\tentity_category: \"config\",\n\t\tuniq_id: msg.toadi_reference+'_mower_height_setting',\n\t\t\"state_topic\": msg.toadi_reference+msg.endpoint,\n\t\tvalue_template: '{{ value_json.mowerHeight }}'\n },\n topic: 'homeassistant/number/'+msg.toadi_reference+'/mower_height/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_safe_border_mowing_setting',\n name: msg.toadi_name + ' DD Safe border mowing',\n device: msg.toadi_device,\n \"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/mowBorderWidth\",\n icon: 'mdi:border-all-variant',\n payload_on: 0.45,\n payload_off: 0,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.mowBorderWidth }}',\n },\n topic: 'homeassistant/switch/'+msg.toadi_reference+'/safe_border_mowing/config'\n},\n{\n payload: {\n\t\tdevice: msg.toadi_device,\n\t\t\"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/mowBorderMinimumWidth\",\n\t\tname: msg.toadi_name + ' DD Minimum Border Width',\n\t\tstep: \"1\",\n \t\"max\": 45,\n \t\"min\": 0,\n \t\"unit_of_measurement\": \"mm\",\n\t\tentity_category: \"config\",\n\t\tuniq_id: msg.toadi_reference+'_min_border_width_setting',\n\t\t\"state_topic\": msg.toadi_reference+msg.endpoint,\n\t\tvalue_template: '{{ value_json.mowBorderMinimumWidth }}'\n },\n topic: 'homeassistant/number/'+msg.toadi_reference+'/min_border_width/config'\n},\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1930, | |
"y": 900, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "1567eba6ea3b9e9f", | |
"type": "mqtt in", | |
"z": "76106b40e1ce3c2f", | |
"name": "willow/settings/set", | |
"topic": "willow/set/#", | |
"qos": "2", | |
"datatype": "utf8", | |
"broker": "c1f9b3d52d33b78a", | |
"nl": false, | |
"rap": true, | |
"rh": 0, | |
"inputs": 0, | |
"x": 110, | |
"y": 180, | |
"wires": [ | |
[ | |
"75a389967a6a0c2b" | |
] | |
] | |
}, | |
{ | |
"id": "cbd97fdd96bfc9a5", | |
"type": "comment", | |
"z": "76106b40e1ce3c2f", | |
"name": "Readme 1st", | |
"info": "# Main configuration\nIf you change the custom name, make sure you change the MQTT listener & connection error as well.\nIt should match what toadi_reference will be.\n\n# Forecast\n**Only with some javascript knowledge.**\nFor the forecast, you need to configure the entity name in the \"Get log\" function node and the forecast sensor from HA.\nIt's only possible to use this if you have MySQL recorder enabled and have a forecast with a low & high temperature.\nDouble check the \"process forecast\" function node for the variable naems in the foreach loop.\nFeel free to change the temperatures required in that same node.\n", | |
"x": 410, | |
"y": 320, | |
"wires": [] | |
}, | |
{ | |
"id": "32eac6dd94498aa6", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "Process switch", | |
"func": "function isInt(value) {\n return !isNaN(value) && \n parseInt(Number(value)) == value && \n !isNaN(parseInt(value, 10));\n}\n\nfunction convert_payload(parameter,string) {\n if (string == 'ON') return true;\n if (string == 'OFF') return false;\n if (!isInt(string)) string = '\"'+string+'\"';\n switch (parameter) {\n case 'mowBorderMinimumWidth':\n msg.payload = parseInt(msg.payload) / 100;\n break;\n }\n return string;\n}\n\nvar topic = msg.topic.split('/');\nmsg.method = 'GET';\nswitch (topic[2]) {\n case 'settings':\n msg.method = 'POST';\n var count = topic.length;\n msg.payload = convert_payload(topic[count - 1],msg.payload);\n msg.url = msg.toadi_uri+msg.topic.replace(msg.toadi_reference+'/set','');\n break;\n case 'emergencyStop':\n msg.url = msg.toadi_uri+'/navigation/';\n if (msg.payload == 'ON') msg.url += 'hardEmergencyStop';\n else msg.url += 'releaseEmergencyStop';\n break;\n case 'reboot':\n msg.url = msg.toadi_uri+'/maintenance/reboot';\n break;\n case 'shutdown':\n msg.url = msg.toadi_uri+'/maintenance/shutdown';\n break;\n}\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 920, | |
"y": 700, | |
"wires": [ | |
[ | |
"0169343a4b91326f" | |
] | |
] | |
}, | |
{ | |
"id": "199b0af2c88d3b1a", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/lineMowActivity", | |
"func": "return [[\n{\n payload: {\n\t\tdevice: msg.toadi_device,\n\t\t\"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/lineDirection\",\n\t\tname: msg.toadi_name + ' Line Direction',\n\t\tstep: \"1\",\n \t\"max\": 360,\n \t\"min\": 0,\n \t\"unit_of_measurement\": \"°\",\n\t\tentity_category: \"config\",\n\t\tuniq_id: msg.toadi_reference+'_line_direction_setting',\n\t\t\"state_topic\": msg.toadi_reference+msg.endpoint,\n\t\tvalue_template: '{{ value_json.lineDirection }}'\n },\n topic: 'homeassistant/number/'+msg.toadi_reference+'/line_direction/config'\n},\n\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1940, | |
"y": 860, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "b5889ec9a7668aaa", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "/settings/docking", | |
"func": "return [[\n{\n payload: {\n unique_id: msg.toadi_reference+'_auto_docking',\n name: msg.toadi_name + ' Auto Docking',\n device: msg.toadi_device,\n \"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/autoDockingEnabled\",\n icon: 'mdi:cellphone-dock',\n state_on: true,\n state_off: false,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.autoDockingEnabled }}',\n },\n topic: 'homeassistant/switch/'+msg.toadi_reference+'/auto_docking/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_fixed_pole',\n name: msg.toadi_name + ' Fixed Pole',\n device: msg.toadi_device,\n \"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/fixedPole\",\n icon: 'mdi:lock',\n state_on: true,\n state_off: false,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.fixedPole }}',\n },\n topic: 'homeassistant/switch/'+msg.toadi_reference+'/fixed_pole/config'\n},\n{\n payload: {\n unique_id: msg.toadi_reference+'_dock_safe_driving',\n name: msg.toadi_name + ' Dock Safe Driving',\n device: msg.toadi_device,\n \"command_topic\": msg.toadi_reference+'/set'+msg.endpoint+\"/safeDrivingToChargerEnabled\",\n icon: 'mdi:safety-goggles',\n state_on: true,\n state_off: false,\n state_topic: msg.toadi_reference+msg.endpoint,\n value_template: '{{ value_json.safeDrivingToChargerEnabled }}',\n },\n topic: 'homeassistant/switch/'+msg.toadi_reference+'/dock_safe_driving/config'\n},\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1920, | |
"y": 820, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "c3420922682dd85f", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "Buttons", | |
"func": "return [[\n{\n payload: {\n\t\tdevice: msg.toadi_device,\n\t\tcommand_topic: msg.toadi_reference+'/set/reboot',\n\t\tname: msg.toadi_name + ' Reboot',\n\t\tuniq_id: msg.toadi_reference+'_reboot',\n\t\t\"entity_category\": \"diagnostic\"\n },\n topic: 'homeassistant/button/'+msg.toadi_reference+'/reboot/config'\n},\n{\n payload: {\n\t\tdevice: msg.toadi_device,\n\t\tcommand_topic: msg.toadi_reference+'/set/shutdown',\n\t\tname: msg.toadi_name + ' Shutdown',\n\t\tuniq_id: msg.toadi_reference+'_shutdown',\n\t\t\"entity_category\": \"diagnostic\"\n },\n topic: 'homeassistant/button/'+msg.toadi_reference+'/shutdown/config'\n}\n]];", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 1880, | |
"y": 20, | |
"wires": [ | |
[ | |
"21fbffa95d2be7de" | |
] | |
] | |
}, | |
{ | |
"id": "eda4615b480bf154", | |
"type": "switch", | |
"z": "76106b40e1ce3c2f", | |
"name": "mqttDiscovery", | |
"property": "flowType", | |
"propertyType": "msg", | |
"rules": [ | |
{ | |
"t": "eq", | |
"v": "mqttDiscovery", | |
"vt": "str" | |
} | |
], | |
"checkall": "true", | |
"repair": false, | |
"outputs": 1, | |
"x": 920, | |
"y": 60, | |
"wires": [ | |
[ | |
"c3420922682dd85f" | |
] | |
] | |
}, | |
{ | |
"id": "4778309cdf3b8e81", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "Get log", | |
"func": "var entity = 'sensor.iloker32_temperature';\n\nvar threedays = new Date(Date.now() - 3 * 24 * 3600 * 1000)\nmsg.threedays_unix = (Math.floor(threedays.getTime()) / 1000);\n\nmsg.topic=\"SELECT MIN(CAST(state AS signed)) AS temp FROM states WHERE state != 'unavailable' AND metadata_id = (SELECT metadata_id FROM states_meta WHERE entity_id LIKE '\"+entity+\"' LIMIT 1) AND last_updated_ts > \" + msg.threedays_unix + \";\"\nreturn msg;", | |
"outputs": 1, | |
"timeout": "", | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 120, | |
"y": 520, | |
"wires": [ | |
[ | |
"f1883d901ba0820c" | |
] | |
] | |
}, | |
{ | |
"id": "f1883d901ba0820c", | |
"type": "mysql", | |
"z": "76106b40e1ce3c2f", | |
"mydb": "52a9ecc4d46bb061", | |
"name": "", | |
"x": 270, | |
"y": 520, | |
"wires": [ | |
[ | |
"50965cd83450bf2e" | |
] | |
] | |
}, | |
{ | |
"id": "f6a40d0fff88b6cf", | |
"type": "inject", | |
"z": "76106b40e1ce3c2f", | |
"d": true, | |
"name": "Willow setup by weather forecast", | |
"props": [ | |
{ | |
"p": "payload" | |
}, | |
{ | |
"p": "flowType", | |
"v": "willowSetup", | |
"vt": "str" | |
} | |
], | |
"repeat": "", | |
"crontab": "00 08 * * *", | |
"once": false, | |
"onceDelay": 0.1, | |
"topic": "", | |
"payload": "", | |
"payloadType": "date", | |
"x": 180, | |
"y": 240, | |
"wires": [ | |
[ | |
"4c649abe395578c0" | |
] | |
] | |
}, | |
{ | |
"id": "50965cd83450bf2e", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "Past weather", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "temp_past", | |
"pt": "msg", | |
"to": "payload[0].temp", | |
"tot": "msg" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 440, | |
"y": 520, | |
"wires": [ | |
[ | |
"2e23a76017ca5291" | |
] | |
] | |
}, | |
{ | |
"id": "2e23a76017ca5291", | |
"type": "api-current-state", | |
"z": "76106b40e1ce3c2f", | |
"name": "Forecast", | |
"server": "23b4aaa0b0a85e41", | |
"version": 3, | |
"outputs": 1, | |
"halt_if": "", | |
"halt_if_type": "str", | |
"halt_if_compare": "is", | |
"entity_id": "weather.buienradar", | |
"state_type": "str", | |
"blockInputOverrides": false, | |
"outputProperties": [ | |
{ | |
"property": "payload", | |
"propertyType": "msg", | |
"value": "", | |
"valueType": "entityState" | |
}, | |
{ | |
"property": "data", | |
"propertyType": "msg", | |
"value": "", | |
"valueType": "entity" | |
} | |
], | |
"for": "0", | |
"forType": "num", | |
"forUnits": "minutes", | |
"override_topic": false, | |
"state_location": "payload", | |
"override_payload": "msg", | |
"entity_location": "data", | |
"override_data": "msg", | |
"x": 130, | |
"y": 580, | |
"wires": [ | |
[ | |
"77f7ebc73b158c76" | |
] | |
] | |
}, | |
{ | |
"id": "77f7ebc73b158c76", | |
"type": "function", | |
"z": "76106b40e1ce3c2f", | |
"name": "Process forecast", | |
"func": "var array = msg.data.attributes.forecast;\n\nvar mintemp = 10;\nvar wintertemp = 15;\nvar summertemp = 25;\n\nmsg.templow = 100;\nmsg.temphigh = -100;\narray.forEach(function(forecast) {\n if (msg.templow > forecast.templow) msg.templow = forecast.templow;\n if (msg.temphigh < forecast.temperature) msg.temphigh = forecast.temperature;\n});\n\nif (msg.temppast < mintemp || msg.templow < mintemp) msg.payload = 'fullstop';\nelse {\n if (msg.temppast < summertemp || msg.templow < summertemp) msg.payload = 'summer';\n if (msg.temphigh > summertemp) msg.payload = 'hot';\n if (msg.temppast < wintertemp || msg.templow < wintertemp) msg.payload = 'winter';\n}\nmsg.topic = msg.toadi_reference+'/set/settingsNEWTOPIC';\nreturn msg;", | |
"outputs": 1, | |
"timeout": 0, | |
"noerr": 0, | |
"initialize": "", | |
"finalize": "", | |
"libs": [], | |
"x": 300, | |
"y": 580, | |
"wires": [ | |
[ | |
"87328ae437613f23" | |
] | |
] | |
}, | |
{ | |
"id": "87328ae437613f23", | |
"type": "switch", | |
"z": "76106b40e1ce3c2f", | |
"name": "Willow setup", | |
"property": "payload", | |
"propertyType": "msg", | |
"rules": [ | |
{ | |
"t": "eq", | |
"v": "fullstop", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "winter", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "summer", | |
"vt": "str" | |
}, | |
{ | |
"t": "eq", | |
"v": "hot", | |
"vt": "str" | |
} | |
], | |
"checkall": "false", | |
"repair": false, | |
"outputs": 4, | |
"x": 160, | |
"y": 720, | |
"wires": [ | |
[ | |
"ba020eb9eb636bf6" | |
], | |
[ | |
"15eb00532b289033", | |
"2fc62a87373f400d" | |
], | |
[ | |
"7208ceb9044cb205", | |
"4896f10946506927" | |
], | |
[ | |
"15eb00532b289033", | |
"2fc62a87373f400d" | |
] | |
] | |
}, | |
{ | |
"id": "54be4014bc261c9b", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "mowingFrequency", | |
"rules": [ | |
{ | |
"t": "change", | |
"p": "topic", | |
"pt": "msg", | |
"from": "NEWTOPIC", | |
"fromt": "str", | |
"to": "/mowingPlanner/mowingFrequency", | |
"tot": "str" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 590, | |
"y": 700, | |
"wires": [ | |
[ | |
"13cb2a4ecba873be" | |
] | |
] | |
}, | |
{ | |
"id": "15eb00532b289033", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "90", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "90", | |
"tot": "num" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 380, | |
"y": 720, | |
"wires": [ | |
[ | |
"3784621d9a837e9a" | |
] | |
] | |
}, | |
{ | |
"id": "ba020eb9eb636bf6", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "STOP", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "STOP", | |
"tot": "str" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 380, | |
"y": 640, | |
"wires": [ | |
[ | |
"54be4014bc261c9b" | |
] | |
] | |
}, | |
{ | |
"id": "3784621d9a837e9a", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "mowerHeight", | |
"rules": [ | |
{ | |
"t": "change", | |
"p": "topic", | |
"pt": "msg", | |
"from": "NEWTOPIC", | |
"fromt": "str", | |
"to": "/mowActivity/mowerHeight", | |
"tot": "str" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 570, | |
"y": 660, | |
"wires": [ | |
[ | |
"c3f6b43e2358ab7c" | |
] | |
] | |
}, | |
{ | |
"id": "2fc62a87373f400d", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "LESS", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "LESS", | |
"tot": "str" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 380, | |
"y": 800, | |
"wires": [ | |
[ | |
"54be4014bc261c9b" | |
] | |
] | |
}, | |
{ | |
"id": "7208ceb9044cb205", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "NORMAL", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "NORMAL", | |
"tot": "str" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 390, | |
"y": 680, | |
"wires": [ | |
[ | |
"54be4014bc261c9b" | |
] | |
] | |
}, | |
{ | |
"id": "4896f10946506927", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "45", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "payload", | |
"pt": "msg", | |
"to": "45", | |
"tot": "num" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 380, | |
"y": 760, | |
"wires": [ | |
[ | |
"3784621d9a837e9a" | |
] | |
] | |
}, | |
{ | |
"id": "aee831fe73a74ce6", | |
"type": "join", | |
"z": "76106b40e1ce3c2f", | |
"name": "", | |
"mode": "custom", | |
"build": "object", | |
"property": "payload", | |
"propertyType": "msg", | |
"key": "join", | |
"joiner": "\\n", | |
"joinerType": "str", | |
"accumulate": false, | |
"timeout": "1", | |
"count": "", | |
"reduceRight": false, | |
"reduceExp": "", | |
"reduceInit": "", | |
"reduceInitType": "", | |
"reduceFixup": "", | |
"x": 1510, | |
"y": 900, | |
"wires": [ | |
[ | |
"cbcde0e4f6d9fae2" | |
] | |
] | |
}, | |
{ | |
"id": "cbcde0e4f6d9fae2", | |
"type": "change", | |
"z": "76106b40e1ce3c2f", | |
"name": "Willow settings payload", | |
"rules": [ | |
{ | |
"t": "set", | |
"p": "willow_settings", | |
"pt": "flow", | |
"to": "payload", | |
"tot": "msg" | |
} | |
], | |
"action": "", | |
"property": "", | |
"from": "", | |
"to": "", | |
"reg": false, | |
"x": 1690, | |
"y": 900, | |
"wires": [ | |
[] | |
] | |
}, | |
{ | |
"id": "8ac89d09b7d95248", | |
"type": "comment", | |
"z": "76106b40e1ce3c2f", | |
"name": "Settings payload", | |
"info": "{\n\t\"mowing\": {\n\t\t\"beginTimeAfterSunrise\": 180\n\t},\n\t\"mapping\": {\n\t\t\"exploringEnabled\": null,\n\t\t\"multizoneEnabled\": false\n\t},\n\t\"lineMowActivity\": {\n\t\t\"lineDirection\": 0\n\t},\n\t\"docking\": {\n\t\t\"safeDrivingToChargerEnabled\": false,\n\t\t\"fixedPole\": false,\n\t\t\"autoDockingEnabled\": true\n\t},\n\t\"mowActivity\": {\n\t\t\"mowBorderMinimumWidth\": 0,\n\t\t\"mowBorderWidth\": 0,\n\t\t\"mowerHeight\": 90\n\t},\n\t\"mowingPlanner\": {\n\t\t\"mowingFrequency\": \"STOP\",\n\t\t\"mowingPattern\": \"RANDOM\"\n\t}\n}", | |
"x": 1660, | |
"y": 860, | |
"wires": [] | |
}, | |
{ | |
"id": "13cb2a4ecba873be", | |
"type": "switch", | |
"z": "76106b40e1ce3c2f", | |
"name": "Diff?", | |
"property": "willow_settings.mowingPlanner.mowingFrequency", | |
"propertyType": "flow", | |
"rules": [ | |
{ | |
"t": "neq", | |
"v": "payload", | |
"vt": "msg" | |
} | |
], | |
"checkall": "true", | |
"repair": false, | |
"outputs": 1, | |
"x": 750, | |
"y": 700, | |
"wires": [ | |
[ | |
"32eac6dd94498aa6" | |
] | |
] | |
}, | |
{ | |
"id": "c3f6b43e2358ab7c", | |
"type": "switch", | |
"z": "76106b40e1ce3c2f", | |
"name": "Diff?", | |
"property": "willow_settings.mowActivity.mowerHeight", | |
"propertyType": "flow", | |
"rules": [ | |
{ | |
"t": "neq", | |
"v": "payload", | |
"vt": "msg" | |
} | |
], | |
"checkall": "true", | |
"repair": false, | |
"outputs": 1, | |
"x": 710, | |
"y": 660, | |
"wires": [ | |
[ | |
"32eac6dd94498aa6" | |
] | |
] | |
}, | |
{ | |
"id": "9ef8a6e271b07717", | |
"type": "comment", | |
"z": "76106b40e1ce3c2f", | |
"name": "Version 1.1", | |
"info": "1.1 \n- fixed gps reference\n- fixed switch lightning icons\n- fixed daredevil safe border mowing switch\n\n1.0\n- initial port from @rmeekers\n- rework mqtt structure and added settings", | |
"x": 510, | |
"y": 180, | |
"wires": [] | |
}, | |
{ | |
"id": "c1f9b3d52d33b78a", | |
"type": "mqtt-broker", | |
"name": "MQTT", | |
"broker": "192.168.0.10", | |
"port": "1883", | |
"clientid": "NodeRed", | |
"autoConnect": true, | |
"usetls": false, | |
"protocolVersion": "4", | |
"keepalive": "60", | |
"cleansession": true, | |
"autoUnsubscribe": true, | |
"birthTopic": "NodeRed", | |
"birthQos": "0", | |
"birthRetain": "true", | |
"birthPayload": "", | |
"birthMsg": {}, | |
"closeTopic": "", | |
"closeQos": "0", | |
"closePayload": "", | |
"closeMsg": {}, | |
"willTopic": "", | |
"willQos": "0", | |
"willPayload": "", | |
"willMsg": {}, | |
"userProps": "", | |
"sessionExpiry": "" | |
}, | |
{ | |
"id": "52a9ecc4d46bb061", | |
"type": "MySQLdatabase", | |
"name": "HomeAssistant", | |
"host": "192.168.0.10", | |
"port": "3306", | |
"db": "homeassistant", | |
"tz": "", | |
"charset": "UTF8" | |
}, | |
{ | |
"id": "23b4aaa0b0a85e41", | |
"type": "server", | |
"name": "Home Assistant", | |
"version": 5, | |
"addon": false, | |
"rejectUnauthorizedCerts": true, | |
"ha_boolean": "y|yes|true|on|home|open", | |
"connectionDelay": true, | |
"cacheJson": true, | |
"heartbeat": false, | |
"heartbeatInterval": "30", | |
"areaSelector": "friendlyName", | |
"deviceSelector": "friendlyName", | |
"entitySelector": "friendlyName", | |
"statusSeparator": "at: ", | |
"statusYear": "hidden", | |
"statusMonth": "short", | |
"statusDay": "numeric", | |
"statusHourCycle": "h23", | |
"statusTimeFormat": "h:m", | |
"enableGlobalContextStore": true | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment