diff --git a/flows.json b/flows.json index a52b69a..b651b7d 100644 --- a/flows.json +++ b/flows.json @@ -1,11 +1,4 @@ [ - { - "id": "75c53969.aa5438", - "type": "tab", - "label": "Wake up & mosquito", - "disabled": false, - "info": "" - }, { "id": "f02b32ef07b4b378", "type": "tab", @@ -1715,2581 +1708,6 @@ "x": 520, "y": 100 }, - { - "id": "ae332807.ef2fd8", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Wake up timer", - "wires": [ - [ - "6c060df4.52243c" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": true, - "tue": true, - "wed": true, - "thu": true, - "fri": true, - "sat": false, - "sun": false, - "x": 1100, - "y": 200 - }, - { - "id": "93a80007.e0738", - "type": "server-state-changed", - "z": "75c53969.aa5438", - "name": "Weekday wake up time", - "wires": [ - [ - "9bda506c.e72ec8" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.weekday_wakeup_time" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 180, - "y": 100 - }, - { - "id": "694fe4c5.685bac", - "type": "server-state-changed", - "z": "75c53969.aa5438", - "name": "Weekday fade in", - "wires": [ - [ - "22ae3c69.00a1cc" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_number.weekday_fade_duration" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 180, - "y": 300 - }, - { - "id": "6c060df4.52243c", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Do Wake Up?", - "wires": [ - [ - "dbc82e9b.f57dc8" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekday_wakeup", - "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", - "x": 1360, - "y": 200 - }, - { - "id": "e369f3d1.5a92e", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Get weekday wake up time", - "wires": [ - [ - "2ec2fea2.c760e2" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_datetime.weekday_wakeup_time", - "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", - "x": 540, - "y": 360 - }, - { - "id": "e67fe3b4.3a7a28", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Get weekday fade in", - "wires": [ - [ - "b000fa34.217b6" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_number.weekday_fade_duration", - "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", - "x": 540, - "y": 160 - }, - { - "id": "9bda506c.e72ec8", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "e67fe3b4.3a7a28", - "d8decadb.021668" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekday_wakeup_time", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 100 - }, - { - "id": "22ae3c69.00a1cc", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "e369f3d1.5a92e" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekday_wakeup_fade", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 300 - }, - { - "id": "b000fa34.217b6", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "9cb89f73.575448", - "f94ec42c.03a648", - "18eb0644ca136b1c" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekday_wakeup_fade", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 220 - }, - { - "id": "2ec2fea2.c760e2", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "9cb89f73.575448", - "f94ec42c.03a648", - "18eb0644ca136b1c" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekday_wakeup_time", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 420 - }, - { - "id": "9cb89f73.575448", - "type": "function", - "z": "75c53969.aa5438", - "name": "actual start time", - "wires": [ - [ - "ae332807.ef2fd8" - ] - ], - "func": "var wakeUpTime = flow.get('weekday_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekday_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = (wakeUpFade == 0) ? 0 : -Math.abs(wakeUpFade); \n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 880, - "y": 200 - }, - { - "id": "5bfae0ef.66185", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Wake up lights", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": true, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.bedroom_sun" - ], - "labelId": [], - "data": "payload.data", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "light", - "service": "turn_on", - "output_location": "", - "output_location_type": "none", - "x": 1660, - "y": 220 - }, - { - "id": "dbc82e9b.f57dc8", - "type": "function", - "z": "75c53969.aa5438", - "name": "Prepare transition body", - "wires": [ - [ - "5bfae0ef.66185" - ] - ], - "func": "var tmpPayload = {};\ntmpPayload.brightness_pct = 100;\ntmpPayload.transition = parseInt(flow.get('weekday_wakeup_fade'))*60;\ntmpPayload.rgb_color = [255, 212, 178];\n\nvar newMsg = {};\n// newMsg.payload = tmpPayload;\nnewMsg.payload = {};\nnewMsg.payload.data = tmpPayload;\n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1390, - "y": 260 - }, - { - "id": "f21c4ec.c39bfb", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Turn on espresso", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "switch.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "switch.espresso_kitchen" - ], - "labelId": [], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "switch", - "service": "turn_on", - "output_location": "", - "output_location_type": "none", - "x": 1670, - "y": 320 - }, - { - "id": "f94ec42c.03a648", - "type": "function", - "z": "75c53969.aa5438", - "name": "espresso start time", - "wires": [ - [ - "fc05fffe.2de45" - ] - ], - "func": "var wakeUpTime = flow.get('weekday_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekday_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -25; \n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 890, - "y": 320 - }, - { - "id": "fc05fffe.2de45", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Espresso timer", - "wires": [ - [ - "77923b2d.4a22fc" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": true, - "tue": true, - "wed": true, - "thu": true, - "fri": true, - "sat": false, - "sun": false, - "x": 1140, - "y": 320 - }, - { - "id": "77923b2d.4a22fc", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Heat up espresso machine?", - "wires": [ - [ - "f21c4ec.c39bfb" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekday_wakeup_coffee", - "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", - "x": 1400, - "y": 320 - }, - { - "id": "d8decadb.021668", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Do Wake Up?", - "wires": [ - [ - "ef8a3c3f.d62bc8" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekday_wakeup", - "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", - "x": 880, - "y": 100 - }, - { - "id": "ef8a3c3f.d62bc8", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Heat up espresso machine?", - "wires": [ - [ - "9a69ecfb.d23d78" - ], - [ - "9a69ecfb.d23d78" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekday_wakeup_coffee", - "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", - "x": 1140, - "y": 100 - }, - { - "id": "9a69ecfb.d23d78", - "type": "function", - "z": "75c53969.aa5438", - "name": "Wake up notification", - "wires": [ - [ - "2cc3b77b.1bea68" - ] - ], - "func": "var espressoMsg = '.';\n\nif (msg.payload == 'on') { \n espressoMsg = ' and warm up espresso machine.'\n}\n\nvar newMsg = {};\nnewMsg.payload = \n \"Weekday wake up at \"+\n flow.get('weekday_wakeup_time').substr(0,5)+\n espressoMsg\n ;\n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1420, - "y": 100 - }, - { - "id": "2cc3b77b.1bea68", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Notify via HA", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "notify.gotify_ha", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "notify", - "service": "gotify_ha", - "output_location": "", - "output_location_type": "none", - "x": 1650, - "y": 100 - }, - { - "id": "4dc6da74.8356dc", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Wake up timer", - "wires": [ - [ - "85381275.49e7d" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": false, - "tue": false, - "wed": false, - "thu": false, - "fri": false, - "sat": true, - "sun": true, - "x": 1140, - "y": 840 - }, - { - "id": "fc43b82c.213cb8", - "type": "server-state-changed", - "z": "75c53969.aa5438", - "name": "Weekend wake up time", - "wires": [ - [ - "c521c0a0.379578" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.weekend_wakeup_time" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 180, - "y": 740 - }, - { - "id": "76b3e57e.0f74f4", - "type": "server-state-changed", - "z": "75c53969.aa5438", - "name": "Weekend fade in", - "wires": [ - [ - "683d8f2e.895c48" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_number.weekend_fade_duration" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 160, - "y": 940 - }, - { - "id": "85381275.49e7d", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Do Wake Up?", - "wires": [ - [ - "9d13f9f6.43bf48" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekend_wakeup", - "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", - "x": 1360, - "y": 840 - }, - { - "id": "4dddf54a.ae2404", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Get weekend wake up time", - "wires": [ - [ - "10ec127f.448cbe" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_datetime.weekend_wakeup_time", - "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", - "x": 540, - "y": 1000 - }, - { - "id": "8ce67518.da9078", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Get weekend fade in", - "wires": [ - [ - "12733a41.25d2a6" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 1, - "halt_if": "", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_number.weekend_fade_duration", - "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", - "x": 540, - "y": 800 - }, - { - "id": "c521c0a0.379578", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "8ce67518.da9078", - "258551dc.78ecd6" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekend_wakeup_time", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 740 - }, - { - "id": "683d8f2e.895c48", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "4dddf54a.ae2404" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekend_wakeup_fade", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 940 - }, - { - "id": "12733a41.25d2a6", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "df53b1da.f9fb38", - "f0aedf49.47b5c", - "11ee3e0ecc62415e" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekend_wakeup_fade", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 860 - }, - { - "id": "10ec127f.448cbe", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "df53b1da.f9fb38", - "f0aedf49.47b5c", - "11ee3e0ecc62415e" - ] - ], - "rules": [ - { - "t": "set", - "p": "weekend_wakeup_time", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 570, - "y": 1060 - }, - { - "id": "df53b1da.f9fb38", - "type": "function", - "z": "75c53969.aa5438", - "name": "actual start time", - "wires": [ - [ - "4dc6da74.8356dc" - ] - ], - "func": "var wakeUpTime = flow.get('weekend_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekend_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = (wakeUpFade == 0) ? 0 : -Math.abs(wakeUpFade); \n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 880, - "y": 840 - }, - { - "id": "d415030.858b68", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Wake up lights", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "light.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "light.bedroom_sun" - ], - "labelId": [], - "data": "payload.data", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "light", - "service": "turn_on", - "output_location": "", - "output_location_type": "none", - "x": 1640, - "y": 840 - }, - { - "id": "9d13f9f6.43bf48", - "type": "function", - "z": "75c53969.aa5438", - "name": "Prepare transition body", - "wires": [ - [ - "d415030.858b68" - ] - ], - "func": "var tmpPayload = {};\ntmpPayload.brightness = 255;\ntmpPayload.transition = parseInt(flow.get('weekend_wakeup_fade'))*60;\ntmpPayload.rgb_color = [255, 207, 120];\n\nvar newMsg = {};\nnewMsg.payload = {};\nnewMsg.payload.data = tmpPayload;\n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1390, - "y": 900 - }, - { - "id": "7722c177.c69d58", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Turn on espresso", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "switch.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "switch.espresso_kitchen" - ], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "switch", - "service": "turn_on", - "output_location": "", - "output_location_type": "none", - "x": 1650, - "y": 960 - }, - { - "id": "f0aedf49.47b5c", - "type": "function", - "z": "75c53969.aa5438", - "name": "espresso start time", - "wires": [ - [ - "e1e0b6cb.85b9b" - ] - ], - "func": "var wakeUpTime = flow.get('weekend_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekend_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -25; \n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 890, - "y": 960 - }, - { - "id": "e1e0b6cb.85b9b", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Espresso timer", - "wires": [ - [ - "8d66adb4.9f362" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": false, - "tue": false, - "wed": false, - "thu": false, - "fri": false, - "sat": true, - "sun": true, - "x": 1140, - "y": 960 - }, - { - "id": "8d66adb4.9f362", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Heat up espresso machine?", - "wires": [ - [ - "7722c177.c69d58" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekend_wakeup_coffee", - "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", - "x": 1400, - "y": 960 - }, - { - "id": "258551dc.78ecd6", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Do Wake Up?", - "wires": [ - [ - "762c79e3.920548" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekend_wakeup", - "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", - "x": 880, - "y": 740 - }, - { - "id": "762c79e3.920548", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Heat up espresso machine?", - "wires": [ - [ - "81837c2f.7493" - ], - [ - "81837c2f.7493" - ] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekend_wakeup_coffee", - "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", - "x": 1120, - "y": 740 - }, - { - "id": "81837c2f.7493", - "type": "function", - "z": "75c53969.aa5438", - "name": "Wake up notification", - "wires": [ - [ - "19f56085.336bff" - ] - ], - "func": "var espressoMsg = '.';\n\nif (msg.payload == 'on') { \n espressoMsg = ' and warm up espresso machine.'\n}\n\nvar newMsg = {};\nnewMsg.payload = \n \"Weekend wake up at \"+\n flow.get('weekend_wakeup_time').substr(0,5)+\n espressoMsg\n ;\n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1380, - "y": 740 - }, - { - "id": "19f56085.336bff", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Notify via HA", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "notify.gotify_ha", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "notify", - "service": "gotify_ha", - "output_location": "", - "output_location_type": "none", - "x": 1650, - "y": 740 - }, - { - "id": "547e480223620899", - "type": "comment", - "z": "75c53969.aa5438", - "name": "Wake up weekday", - "wires": [], - "info": "", - "x": 170, - "y": 60 - }, - { - "id": "ed1e94f805a7cefc", - "type": "comment", - "z": "75c53969.aa5438", - "name": "Wake up weekend", - "wires": [], - "info": "", - "x": 170, - "y": 700 - }, - { - "id": "64e25c08b51a1c62", - "type": "comment", - "z": "75c53969.aa5438", - "name": "Mosquito repellent", - "wires": [], - "info": "", - "x": 170, - "y": 1360 - }, - { - "id": "22546de14d49ffe0", - "type": "server-state-changed", - "z": "75c53969.aa5438", - "name": "Mosquito repellent start", - "wires": [ - [ - "5ba4538297e14338" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.mosquito_repellent_start" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 180, - "y": 1480 - }, - { - "id": "9046160e1b2dcae8", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Enable Mosquito repellent?", - "wires": [ - [ - "fbabed1ad7a24ba0" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.mosquito_device", - "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", - "x": 680, - "y": 1480 - }, - { - "id": "fbabed1ad7a24ba0", - "type": "function", - "z": "75c53969.aa5438", - "name": "Mosquito repellent notification", - "wires": [ - [ - "e9a1ce2e4ff7ec96" - ] - ], - "func": "var newMsg = {};\nnewMsg.payload = \n \"Mosquito repellent will turn on at \"+\n flow.get('mosquito_start_time').substr(0,5)\n ;\n\nreturn newMsg;", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 990, - "y": 1480 - }, - { - "id": "e9a1ce2e4ff7ec96", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Notify via HA", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "notify.gotify_ha", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "notify", - "service": "gotify_ha", - "output_location": "", - "output_location_type": "none", - "x": 1410, - "y": 1440 - }, - { - "id": "5ba4538297e14338", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "9046160e1b2dcae8", - "a2a01fc407a0436d" - ] - ], - "rules": [ - { - "t": "set", - "p": "mosquito_start_time", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 200, - "y": 1540 - }, - { - "id": "59b8f49a70e4cd99", - "type": "server-state-changed", - "z": "75c53969.aa5438", - "name": "Mosquito repellent start", - "wires": [ - [ - "597bdcb50e6cb418" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_boolean.mosquito_device" - ], - "substring": [], - "regex": [] - }, - "outputInitially": false, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 180, - "y": 1400 - }, - { - "id": "597bdcb50e6cb418", - "type": "function", - "z": "75c53969.aa5438", - "name": "Mosquito repellent notification", - "wires": [ - [ - "e9a1ce2e4ff7ec96" - ] - ], - "func": "var newMsg = {};\nnewMsg.payload = \n \"Mosquito repellent turned \" + \n msg.payload + \n \".\"\n ;\n\nreturn newMsg;", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 690, - "y": 1400 - }, - { - "id": "a2a01fc407a0436d", - "type": "function", - "z": "75c53969.aa5438", - "name": "actual start time", - "wires": [ - [ - "ced1a60d7a156f31", - "03a4a0b9263bb6a5" - ] - ], - "func": "var newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = flow.get('mosquito_start_time').substr(0, 5);\n\nreturn newMsg;", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 640, - "y": 1540 - }, - { - "id": "ced1a60d7a156f31", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Mosquito repellent start timer", - "wires": [ - [ - "681c8277c5546141", - "03a4a0b9263bb6a5" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": true, - "tue": true, - "wed": true, - "thu": true, - "fri": true, - "sat": true, - "sun": true, - "x": 680, - "y": 1600 - }, - { - "id": "6f4031ab571aeae0", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Turn on mosquito repellent", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "switch.turn_on", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "switch.bedroom_mosquito_switch" - ], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "switch", - "service": "turn_on", - "output_location": "", - "output_location_type": "none", - "x": 1460, - "y": 1560 - }, - { - "id": "681c8277c5546141", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Enable Mosquito repellent?", - "wires": [ - [ - "6f4031ab571aeae0", - "03a4a0b9263bb6a5" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.mosquito_device", - "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", - "x": 980, - "y": 1540 - }, - { - "id": "8c2dd2f5682080ac", - "type": "server-state-changed", - "z": "75c53969.aa5438", - "name": "Mosquito repellent stop", - "wires": [ - [ - "392706767c38e18e" - ] - ], - "server": "657c7463.48e1e4", - "version": 6, - "outputs": 1, - "exposeAsEntityConfig": "", - "entities": { - "entity": [ - "input_datetime.mosquito_repellent_stop" - ], - "substring": [], - "regex": [] - }, - "outputInitially": true, - "stateType": "str", - "ifState": "", - "ifStateType": "str", - "ifStateOperator": "is", - "outputOnlyOnStateChange": true, - "for": "0", - "forType": "num", - "forUnits": "minutes", - "ignorePrevStateNull": false, - "ignorePrevStateUnknown": false, - "ignorePrevStateUnavailable": false, - "ignoreCurrentStateUnknown": false, - "ignoreCurrentStateUnavailable": false, - "outputProperties": [ - { - "property": "payload", - "propertyType": "msg", - "value": "", - "valueType": "entityState" - }, - { - "property": "data", - "propertyType": "msg", - "value": "", - "valueType": "eventData" - }, - { - "property": "topic", - "propertyType": "msg", - "value": "", - "valueType": "triggerId" - } - ], - "x": 180, - "y": 1620 - }, - { - "id": "392706767c38e18e", - "type": "change", - "z": "75c53969.aa5438", - "name": "", - "wires": [ - [ - "b79251d5e98f3863", - "280a9497b4700592" - ] - ], - "rules": [ - { - "t": "set", - "p": "mosquito_stop_time", - "pt": "flow", - "to": "payload", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 200, - "y": 1680 - }, - { - "id": "b79251d5e98f3863", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Enable Mosquito repellent?", - "wires": [ - [ - "4b8aaa94a2eb49c4" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.mosquito_device", - "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", - "x": 680, - "y": 1680 - }, - { - "id": "4b8aaa94a2eb49c4", - "type": "function", - "z": "75c53969.aa5438", - "name": "Mosquito repellent notification", - "wires": [ - [ - "e9a1ce2e4ff7ec96" - ] - ], - "func": "var newMsg = {};\nnewMsg.payload = \n \"Mosquito repellent will turn off at \"+\n flow.get('mosquito_stop_time').substr(0,5)\n ;\n\nreturn newMsg;", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 990, - "y": 1680 - }, - { - "id": "280a9497b4700592", - "type": "function", - "z": "75c53969.aa5438", - "name": "actual stop time", - "wires": [ - [ - "8d3c194ede95021a", - "03a4a0b9263bb6a5" - ] - ], - "func": "var newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = flow.get('mosquito_stop_time').substr(0, 5);\n\nreturn newMsg;", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 640, - "y": 1740 - }, - { - "id": "8d3c194ede95021a", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Mosquito repellent stop timer", - "wires": [ - [ - "9ba1f8f1e3d43149", - "03a4a0b9263bb6a5" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": true, - "tue": true, - "wed": true, - "thu": true, - "fri": true, - "sat": true, - "sun": true, - "x": 680, - "y": 1800 - }, - { - "id": "9ba1f8f1e3d43149", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Turn off mosquito repellent", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "switch.turn_off", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "switch.bedroom_mosquito_switch" - ], - "labelId": [], - "data": "", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "switch", - "service": "turn_off", - "output_location": "", - "output_location_type": "none", - "x": 1460, - "y": 1700 - }, - { - "id": "03a4a0b9263bb6a5", - "type": "debug", - "z": "75c53969.aa5438", - "name": "debug mosquito", - "wires": [], - "active": false, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "statusVal": "", - "statusType": "auto", - "x": 1320, - "y": 1800 - }, - { - "id": "18eb0644ca136b1c", - "type": "function", - "z": "75c53969.aa5438", - "name": "music start time", - "wires": [ - [ - "5fc7f988eeaa078a" - ] - ], - "func": "var wakeUpTime = flow.get('weekday_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekday_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -15; \n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 880, - "y": 420 - }, - { - "id": "5fc7f988eeaa078a", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Music timer", - "wires": [ - [ - "f217821d98198307" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": true, - "tue": true, - "wed": true, - "thu": true, - "fri": true, - "sat": false, - "sun": false, - "x": 1130, - "y": 420 - }, - { - "id": "f217821d98198307", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Wake up with music?", - "wires": [ - [ - "0f08977fb2d830db" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekday_music_wakeup", - "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", - "x": 1680, - "y": 420 - }, - { - "id": "a5df6ad625909fe6", - "type": "schedex", - "z": "75c53969.aa5438", - "name": "Music timer", - "wires": [ - [ - "4b05a68f256549b9" - ] - ], - "passthroughunhandled": false, - "suspended": false, - "lat": "", - "lon": "", - "ontime": "", - "ontopic": "", - "onpayload": "", - "onoffset": 0, - "onrandomoffset": 0, - "offtime": "", - "offtopic": "", - "offpayload": "", - "offoffset": 0, - "offrandomoffset": 0, - "mon": false, - "tue": false, - "wed": false, - "thu": false, - "fri": false, - "sat": true, - "sun": true, - "x": 1130, - "y": 1060 - }, - { - "id": "4b05a68f256549b9", - "type": "api-current-state", - "z": "75c53969.aa5438", - "name": "Wake up with music?", - "wires": [ - [ - "0f08977fb2d830db" - ], - [] - ], - "server": "657c7463.48e1e4", - "version": 3, - "outputs": 2, - "halt_if": "on", - "halt_if_type": "str", - "halt_if_compare": "is", - "entity_id": "input_boolean.weekend_music_wakeup", - "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", - "x": 1660, - "y": 1060 - }, - { - "id": "0f08977fb2d830db", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Select Bedroom Only Audio", - "wires": [ - [ - "5502ac50650b12cb" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "input_button.press", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "input_button.bedroom_only_audio" - ], - "labelId": [], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "input_button", - "service": "press", - "x": 2040, - "y": 640 - }, - { - "id": "5502ac50650b12cb", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Mute bedroom speaker", - "wires": [ - [ - "f463cbf3032fb2f2" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.volume_set", - "floorId": [], - "areaId": [ - "7047cdd7d50e49f980eba16f832acb57" - ], - "deviceId": [], - "entityId": [], - "labelId": [], - "data": "{\"volume_level\":0}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "volume_set", - "x": 2030, - "y": 720 - }, - { - "id": "f463cbf3032fb2f2", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Connect Spotify to Speaker", - "wires": [ - [ - "28e6f5f6f6e710a8" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.select_source", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "media_player.spotify_m038" - ], - "labelId": [], - "data": "{\"source\":\"All Speakers\"}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "select_source", - "x": 2040, - "y": 800 - }, - { - "id": "28e6f5f6f6e710a8", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Start Wakeup Playlist on speaker", - "wires": [ - [ - "231c5343ad084e80" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.play_media", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "media_player.spotify_m038" - ], - "labelId": [], - "data": "{\"media_content_id\":\"https://open.spotify.com/playlist/5w2ieYTFUc7z6GS4V5ZjLl?si=585bd153dfb94614\", \"media_content_type\":\"playlist\"}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "play_media", - "x": 2060, - "y": 880 - }, - { - "id": "231c5343ad084e80", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Enable shuffle", - "wires": [ - [ - "efc99a6dfef495c0" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.shuffle_set", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "media_player.spotify_m038" - ], - "labelId": [], - "data": "{\"shuffle\":true}", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "shuffle_set", - "x": 2380, - "y": 640 - }, - { - "id": "efc99a6dfef495c0", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Jump to next song (trigger shuffle)", - "wires": [ - [ - "868fbd6ef36820ae" - ] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.media_next_track", - "floorId": [], - "areaId": [], - "deviceId": [], - "entityId": [ - "media_player.spotify_m038" - ], - "labelId": [], - "data": "", - "dataType": "jsonata", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "media_next_track", - "x": 2440, - "y": 720 - }, - { - "id": "fb76d5441934b190", - "type": "api-call-service", - "z": "75c53969.aa5438", - "name": "Set volume", - "wires": [ - [] - ], - "server": "657c7463.48e1e4", - "version": 7, - "debugenabled": false, - "action": "media_player.volume_set", - "floorId": [], - "areaId": [ - "7047cdd7d50e49f980eba16f832acb57" - ], - "deviceId": [], - "entityId": [ - "input_button.bedroom_only_audio" - ], - "labelId": [], - "data": "{ \"volume_level\" : {{ payload }} }", - "dataType": "json", - "mergeContext": "", - "mustacheAltTags": false, - "outputProperties": [], - "queue": "none", - "blockInputOverrides": false, - "domain": "media_player", - "service": "volume_set", - "x": 2370, - "y": 1000 - }, - { - "id": "63957f6f9c0a3608", - "type": "easing", - "z": "75c53969.aa5438", - "name": "Calculate fade in volume", - "wires": [ - [ - "adaa9a5b2cc96879" - ] - ], - "easingType": "linear", - "outputType": "overTime", - "duration": "60000", - "interval": "15000", - "numberOfValues": 10, - "x": 2410, - "y": 860 - }, - { - "id": "868fbd6ef36820ae", - "type": "change", - "z": "75c53969.aa5438", - "name": "Set volume parameters", - "wires": [ - [ - "63957f6f9c0a3608" - ] - ], - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{ \"from\" : 0, \"to\" : 0.2, \"size\": 0.01 }", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2410, - "y": 800 - }, - { - "id": "adaa9a5b2cc96879", - "type": "calculator", - "z": "75c53969.aa5438", - "name": "Round to max 2 decimals", - "wires": [ - [ - "fb76d5441934b190" - ] - ], - "inputMsgField": "payload", - "outputMsgField": "payload", - "operation": "rdec", - "constant": "2", - "round": false, - "truncate": false, - "decimals": "0", - "decimals2": 0, - "x": 2410, - "y": 920 - }, - { - "id": "11ee3e0ecc62415e", - "type": "function", - "z": "75c53969.aa5438", - "name": "music start time", - "wires": [ - [ - "a5df6ad625909fe6" - ] - ], - "func": "var wakeUpTime = flow.get('weekend_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekend_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -15; \n\nreturn newMsg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 880, - "y": 1060 - }, - { - "id": "0d71ce9b2c0312fb", - "type": "comment", - "z": "75c53969.aa5438", - "name": "Wake up music sequence", - "wires": [], - "info": " - Start muted to jump awake\n - Skip to next to song to trigger shuffle mechanism, Spotify by default starts with the first song\n - Incrementally increase volume to have a nice experience", - "x": 2030, - "y": 580 - }, { "id": "bc24bd25f183a7ac", "type": "inject", @@ -22531,5 +19949,2651 @@ "output_location_type": "none", "x": 660, "y": 460 + }, + { + "type": "tab", + "label": "Wake up & mosquito", + "id": "75c53969.aa5438" + }, + { + "id": "ae332807.ef2fd8", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Wake up timer", + "wires": [ + [ + "6c060df4.52243c" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": true, + "tue": true, + "wed": true, + "thu": true, + "fri": true, + "sat": false, + "sun": false, + "x": 1100, + "y": 200 + }, + { + "id": "93a80007.e0738", + "type": "server-state-changed", + "z": "75c53969.aa5438", + "name": "Weekday wake up time", + "wires": [ + [ + "9bda506c.e72ec8" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.weekday_wakeup_time" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 180, + "y": 100 + }, + { + "id": "694fe4c5.685bac", + "type": "server-state-changed", + "z": "75c53969.aa5438", + "name": "Weekday fade in", + "wires": [ + [ + "22ae3c69.00a1cc" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_number.weekday_fade_duration" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 180, + "y": 300 + }, + { + "id": "6c060df4.52243c", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Do Wake Up?", + "wires": [ + [ + "dbc82e9b.f57dc8" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekday_wakeup", + "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", + "x": 1360, + "y": 200 + }, + { + "id": "e369f3d1.5a92e", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Get weekday wake up time", + "wires": [ + [ + "2ec2fea2.c760e2" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_datetime.weekday_wakeup_time", + "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", + "x": 540, + "y": 360 + }, + { + "id": "e67fe3b4.3a7a28", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Get weekday fade in", + "wires": [ + [ + "b000fa34.217b6" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_number.weekday_fade_duration", + "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", + "x": 540, + "y": 160 + }, + { + "id": "9bda506c.e72ec8", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "e67fe3b4.3a7a28", + "d8decadb.021668" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekday_wakeup_time", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 100 + }, + { + "id": "22ae3c69.00a1cc", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "e369f3d1.5a92e" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekday_wakeup_fade", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 300 + }, + { + "id": "b000fa34.217b6", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "9cb89f73.575448", + "f94ec42c.03a648", + "18eb0644ca136b1c" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekday_wakeup_fade", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 220 + }, + { + "id": "2ec2fea2.c760e2", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "9cb89f73.575448", + "f94ec42c.03a648", + "18eb0644ca136b1c" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekday_wakeup_time", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 420 + }, + { + "id": "9cb89f73.575448", + "type": "function", + "z": "75c53969.aa5438", + "name": "actual start time", + "wires": [ + [ + "ae332807.ef2fd8" + ] + ], + "func": "var wakeUpTime = flow.get('weekday_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekday_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = (wakeUpFade == 0) ? 0 : -Math.abs(wakeUpFade); \n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 880, + "y": 200 + }, + { + "id": "5bfae0ef.66185", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Wake up lights", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": true, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.bedroom_sun" + ], + "labelId": [], + "data": "payload.data", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "light", + "service": "turn_on", + "output_location": "", + "output_location_type": "none", + "x": 1660, + "y": 220 + }, + { + "id": "dbc82e9b.f57dc8", + "type": "function", + "z": "75c53969.aa5438", + "name": "Prepare transition body", + "wires": [ + [ + "5bfae0ef.66185" + ] + ], + "func": "var tmpPayload = {};\ntmpPayload.brightness_pct = 100;\ntmpPayload.transition = parseInt(flow.get('weekday_wakeup_fade'))*60;\ntmpPayload.rgb_color = [255, 212, 178];\n\nvar newMsg = {};\n// newMsg.payload = tmpPayload;\nnewMsg.payload = {};\nnewMsg.payload.data = tmpPayload;\n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1390, + "y": 260 + }, + { + "id": "f21c4ec.c39bfb", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Turn on espresso", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "switch.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "switch.espresso_kitchen" + ], + "labelId": [], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "switch", + "service": "turn_on", + "output_location": "", + "output_location_type": "none", + "x": 1670, + "y": 320 + }, + { + "id": "f94ec42c.03a648", + "type": "function", + "z": "75c53969.aa5438", + "name": "espresso start time", + "wires": [ + [ + "fc05fffe.2de45" + ] + ], + "func": "var wakeUpTime = flow.get('weekday_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekday_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -25; \n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 890, + "y": 320 + }, + { + "id": "fc05fffe.2de45", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Espresso timer", + "wires": [ + [ + "77923b2d.4a22fc" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": true, + "tue": true, + "wed": true, + "thu": true, + "fri": true, + "sat": false, + "sun": false, + "x": 1140, + "y": 320 + }, + { + "id": "77923b2d.4a22fc", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Heat up espresso machine?", + "wires": [ + [ + "f21c4ec.c39bfb" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekday_wakeup_coffee", + "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", + "x": 1400, + "y": 320 + }, + { + "id": "d8decadb.021668", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Do Wake Up?", + "wires": [ + [ + "ef8a3c3f.d62bc8" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekday_wakeup", + "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", + "x": 880, + "y": 100 + }, + { + "id": "ef8a3c3f.d62bc8", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Heat up espresso machine?", + "wires": [ + [ + "9a69ecfb.d23d78" + ], + [ + "9a69ecfb.d23d78" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekday_wakeup_coffee", + "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", + "x": 1140, + "y": 100 + }, + { + "id": "9a69ecfb.d23d78", + "type": "function", + "z": "75c53969.aa5438", + "name": "Wake up notification", + "wires": [ + [ + "2cc3b77b.1bea68" + ] + ], + "func": "var espressoMsg = '.';\n\nif (msg.payload == 'on') { \n espressoMsg = ' and warm up espresso machine.'\n}\n\nvar newMsg = {};\nnewMsg.payload = \n \"Weekday wake up at \"+\n flow.get('weekday_wakeup_time').substr(0,5)+\n espressoMsg\n ;\n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1420, + "y": 100 + }, + { + "id": "2cc3b77b.1bea68", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Notify via HA", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 1650, + "y": 100 + }, + { + "id": "4dc6da74.8356dc", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Wake up timer", + "wires": [ + [ + "85381275.49e7d" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": false, + "tue": false, + "wed": false, + "thu": false, + "fri": false, + "sat": true, + "sun": true, + "x": 1140, + "y": 840 + }, + { + "id": "fc43b82c.213cb8", + "type": "server-state-changed", + "z": "75c53969.aa5438", + "name": "Weekend wake up time", + "wires": [ + [ + "c521c0a0.379578" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.weekend_wakeup_time" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 180, + "y": 740 + }, + { + "id": "76b3e57e.0f74f4", + "type": "server-state-changed", + "z": "75c53969.aa5438", + "name": "Weekend fade in", + "wires": [ + [ + "683d8f2e.895c48" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_number.weekend_fade_duration" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 160, + "y": 940 + }, + { + "id": "85381275.49e7d", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Do Wake Up?", + "wires": [ + [ + "9d13f9f6.43bf48" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekend_wakeup", + "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", + "x": 1360, + "y": 840 + }, + { + "id": "4dddf54a.ae2404", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Get weekend wake up time", + "wires": [ + [ + "10ec127f.448cbe" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_datetime.weekend_wakeup_time", + "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", + "x": 540, + "y": 1000 + }, + { + "id": "8ce67518.da9078", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Get weekend fade in", + "wires": [ + [ + "12733a41.25d2a6" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 1, + "halt_if": "", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_number.weekend_fade_duration", + "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", + "x": 540, + "y": 800 + }, + { + "id": "c521c0a0.379578", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "8ce67518.da9078", + "258551dc.78ecd6" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekend_wakeup_time", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 740 + }, + { + "id": "683d8f2e.895c48", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "4dddf54a.ae2404" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekend_wakeup_fade", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 940 + }, + { + "id": "12733a41.25d2a6", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "df53b1da.f9fb38", + "f0aedf49.47b5c", + "11ee3e0ecc62415e" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekend_wakeup_fade", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 860 + }, + { + "id": "10ec127f.448cbe", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "df53b1da.f9fb38", + "f0aedf49.47b5c", + "11ee3e0ecc62415e" + ] + ], + "rules": [ + { + "t": "set", + "p": "weekend_wakeup_time", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 570, + "y": 1060 + }, + { + "id": "df53b1da.f9fb38", + "type": "function", + "z": "75c53969.aa5438", + "name": "actual start time", + "wires": [ + [ + "4dc6da74.8356dc" + ] + ], + "func": "var wakeUpTime = flow.get('weekend_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekend_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = (wakeUpFade == 0) ? 0 : -Math.abs(wakeUpFade); \n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 880, + "y": 840 + }, + { + "id": "d415030.858b68", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Wake up lights", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "light.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "light.bedroom_sun" + ], + "labelId": [], + "data": "payload.data", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "light", + "service": "turn_on", + "output_location": "", + "output_location_type": "none", + "x": 1640, + "y": 840 + }, + { + "id": "9d13f9f6.43bf48", + "type": "function", + "z": "75c53969.aa5438", + "name": "Prepare transition body", + "wires": [ + [ + "d415030.858b68" + ] + ], + "func": "var tmpPayload = {};\ntmpPayload.brightness = 255;\ntmpPayload.transition = parseInt(flow.get('weekend_wakeup_fade'))*60;\ntmpPayload.rgb_color = [255, 207, 120];\n\nvar newMsg = {};\nnewMsg.payload = {};\nnewMsg.payload.data = tmpPayload;\n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1390, + "y": 900 + }, + { + "id": "7722c177.c69d58", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Turn on espresso", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "switch.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "switch.espresso_kitchen" + ], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "switch", + "service": "turn_on", + "output_location": "", + "output_location_type": "none", + "x": 1650, + "y": 960 + }, + { + "id": "f0aedf49.47b5c", + "type": "function", + "z": "75c53969.aa5438", + "name": "espresso start time", + "wires": [ + [ + "e1e0b6cb.85b9b" + ] + ], + "func": "var wakeUpTime = flow.get('weekend_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekend_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -25; \n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 890, + "y": 960 + }, + { + "id": "e1e0b6cb.85b9b", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Espresso timer", + "wires": [ + [ + "8d66adb4.9f362" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": false, + "tue": false, + "wed": false, + "thu": false, + "fri": false, + "sat": true, + "sun": true, + "x": 1140, + "y": 960 + }, + { + "id": "8d66adb4.9f362", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Heat up espresso machine?", + "wires": [ + [ + "7722c177.c69d58" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekend_wakeup_coffee", + "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", + "x": 1400, + "y": 960 + }, + { + "id": "258551dc.78ecd6", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Do Wake Up?", + "wires": [ + [ + "762c79e3.920548" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekend_wakeup", + "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", + "x": 880, + "y": 740 + }, + { + "id": "762c79e3.920548", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Heat up espresso machine?", + "wires": [ + [ + "81837c2f.7493" + ], + [ + "81837c2f.7493" + ] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekend_wakeup_coffee", + "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", + "x": 1120, + "y": 740 + }, + { + "id": "81837c2f.7493", + "type": "function", + "z": "75c53969.aa5438", + "name": "Wake up notification", + "wires": [ + [ + "19f56085.336bff" + ] + ], + "func": "var espressoMsg = '.';\n\nif (msg.payload == 'on') { \n espressoMsg = ' and warm up espresso machine.'\n}\n\nvar newMsg = {};\nnewMsg.payload = \n \"Weekend wake up at \"+\n flow.get('weekend_wakeup_time').substr(0,5)+\n espressoMsg\n ;\n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1380, + "y": 740 + }, + { + "id": "19f56085.336bff", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Notify via HA", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 1650, + "y": 740 + }, + { + "id": "547e480223620899", + "type": "comment", + "z": "75c53969.aa5438", + "name": "Wake up weekday", + "wires": [], + "info": "", + "x": 170, + "y": 60 + }, + { + "id": "ed1e94f805a7cefc", + "type": "comment", + "z": "75c53969.aa5438", + "name": "Wake up weekend", + "wires": [], + "info": "", + "x": 170, + "y": 700 + }, + { + "id": "64e25c08b51a1c62", + "type": "comment", + "z": "75c53969.aa5438", + "name": "Mosquito repellent", + "wires": [], + "info": "", + "x": 170, + "y": 1360 + }, + { + "id": "22546de14d49ffe0", + "type": "server-state-changed", + "z": "75c53969.aa5438", + "name": "Mosquito repellent start", + "wires": [ + [ + "5ba4538297e14338" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.mosquito_repellent_start" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 180, + "y": 1480 + }, + { + "id": "9046160e1b2dcae8", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Enable Mosquito repellent?", + "wires": [ + [ + "fbabed1ad7a24ba0" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.mosquito_device", + "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", + "x": 680, + "y": 1480 + }, + { + "id": "fbabed1ad7a24ba0", + "type": "function", + "z": "75c53969.aa5438", + "name": "Mosquito repellent notification", + "wires": [ + [ + "e9a1ce2e4ff7ec96" + ] + ], + "func": "var newMsg = {};\nnewMsg.payload = \n \"Mosquito repellent will turn on at \"+\n flow.get('mosquito_start_time').substr(0,5)\n ;\n\nreturn newMsg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 990, + "y": 1480 + }, + { + "id": "e9a1ce2e4ff7ec96", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Notify via HA", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"title\":\"Info\",\"message\":\"{{{payload}}}\"}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 1410, + "y": 1440 + }, + { + "id": "5ba4538297e14338", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "9046160e1b2dcae8", + "a2a01fc407a0436d" + ] + ], + "rules": [ + { + "t": "set", + "p": "mosquito_start_time", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 200, + "y": 1540 + }, + { + "id": "59b8f49a70e4cd99", + "type": "server-state-changed", + "z": "75c53969.aa5438", + "name": "Mosquito repellent start", + "wires": [ + [ + "597bdcb50e6cb418" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_boolean.mosquito_device" + ], + "substring": [], + "regex": [] + }, + "outputInitially": false, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 180, + "y": 1400 + }, + { + "id": "597bdcb50e6cb418", + "type": "function", + "z": "75c53969.aa5438", + "name": "Mosquito repellent notification", + "wires": [ + [ + "e9a1ce2e4ff7ec96" + ] + ], + "func": "var newMsg = {};\nnewMsg.payload = \n \"Mosquito repellent turned \" + \n msg.payload + \n \".\"\n ;\n\nreturn newMsg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 690, + "y": 1400 + }, + { + "id": "a2a01fc407a0436d", + "type": "function", + "z": "75c53969.aa5438", + "name": "actual start time", + "wires": [ + [ + "ced1a60d7a156f31", + "03a4a0b9263bb6a5" + ] + ], + "func": "var newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = flow.get('mosquito_start_time').substr(0, 5);\n\nreturn newMsg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 640, + "y": 1540 + }, + { + "id": "ced1a60d7a156f31", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Mosquito repellent start timer", + "wires": [ + [ + "681c8277c5546141", + "03a4a0b9263bb6a5" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": true, + "tue": true, + "wed": true, + "thu": true, + "fri": true, + "sat": true, + "sun": true, + "x": 680, + "y": 1600 + }, + { + "id": "6f4031ab571aeae0", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Turn on mosquito repellent", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "switch.turn_on", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "switch.bedroom_mosquito_switch" + ], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "switch", + "service": "turn_on", + "output_location": "", + "output_location_type": "none", + "x": 1460, + "y": 1560 + }, + { + "id": "681c8277c5546141", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Enable Mosquito repellent?", + "wires": [ + [ + "6f4031ab571aeae0", + "03a4a0b9263bb6a5" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.mosquito_device", + "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", + "x": 980, + "y": 1540 + }, + { + "id": "8c2dd2f5682080ac", + "type": "server-state-changed", + "z": "75c53969.aa5438", + "name": "Mosquito repellent stop", + "wires": [ + [ + "392706767c38e18e" + ] + ], + "server": "657c7463.48e1e4", + "version": 6, + "outputs": 1, + "exposeAsEntityConfig": "", + "entities": { + "entity": [ + "input_datetime.mosquito_repellent_stop" + ], + "substring": [], + "regex": [] + }, + "outputInitially": true, + "stateType": "str", + "ifState": "", + "ifStateType": "str", + "ifStateOperator": "is", + "outputOnlyOnStateChange": true, + "for": "0", + "forType": "num", + "forUnits": "minutes", + "ignorePrevStateNull": false, + "ignorePrevStateUnknown": false, + "ignorePrevStateUnavailable": false, + "ignoreCurrentStateUnknown": false, + "ignoreCurrentStateUnavailable": false, + "outputProperties": [ + { + "property": "payload", + "propertyType": "msg", + "value": "", + "valueType": "entityState" + }, + { + "property": "data", + "propertyType": "msg", + "value": "", + "valueType": "eventData" + }, + { + "property": "topic", + "propertyType": "msg", + "value": "", + "valueType": "triggerId" + } + ], + "x": 180, + "y": 1620 + }, + { + "id": "392706767c38e18e", + "type": "change", + "z": "75c53969.aa5438", + "name": "", + "wires": [ + [ + "b79251d5e98f3863", + "280a9497b4700592" + ] + ], + "rules": [ + { + "t": "set", + "p": "mosquito_stop_time", + "pt": "flow", + "to": "payload", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 200, + "y": 1680 + }, + { + "id": "b79251d5e98f3863", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Enable Mosquito repellent?", + "wires": [ + [ + "4b8aaa94a2eb49c4" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.mosquito_device", + "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", + "x": 680, + "y": 1680 + }, + { + "id": "4b8aaa94a2eb49c4", + "type": "function", + "z": "75c53969.aa5438", + "name": "Mosquito repellent notification", + "wires": [ + [ + "e9a1ce2e4ff7ec96" + ] + ], + "func": "var newMsg = {};\nnewMsg.payload = \n \"Mosquito repellent will turn off at \"+\n flow.get('mosquito_stop_time').substr(0,5)\n ;\n\nreturn newMsg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 990, + "y": 1680 + }, + { + "id": "280a9497b4700592", + "type": "function", + "z": "75c53969.aa5438", + "name": "actual stop time", + "wires": [ + [ + "8d3c194ede95021a", + "03a4a0b9263bb6a5" + ] + ], + "func": "var newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = flow.get('mosquito_stop_time').substr(0, 5);\n\nreturn newMsg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 640, + "y": 1740 + }, + { + "id": "8d3c194ede95021a", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Mosquito repellent stop timer", + "wires": [ + [ + "9ba1f8f1e3d43149", + "03a4a0b9263bb6a5" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": true, + "tue": true, + "wed": true, + "thu": true, + "fri": true, + "sat": true, + "sun": true, + "x": 680, + "y": 1800 + }, + { + "id": "9ba1f8f1e3d43149", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Turn off mosquito repellent", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "switch.turn_off", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "switch.bedroom_mosquito_switch" + ], + "labelId": [], + "data": "", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "switch", + "service": "turn_off", + "output_location": "", + "output_location_type": "none", + "x": 1460, + "y": 1700 + }, + { + "id": "03a4a0b9263bb6a5", + "type": "debug", + "z": "75c53969.aa5438", + "name": "debug mosquito", + "wires": [], + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 1320, + "y": 1800 + }, + { + "id": "18eb0644ca136b1c", + "type": "function", + "z": "75c53969.aa5438", + "name": "music start time", + "wires": [ + [ + "5fc7f988eeaa078a" + ] + ], + "func": "var wakeUpTime = flow.get('weekday_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekday_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -15; \n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 880, + "y": 420 + }, + { + "id": "5fc7f988eeaa078a", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Music timer", + "wires": [ + [ + "f217821d98198307" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": true, + "tue": true, + "wed": true, + "thu": true, + "fri": true, + "sat": false, + "sun": false, + "x": 1130, + "y": 420 + }, + { + "id": "f217821d98198307", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Wake up with music?", + "wires": [ + [ + "0f08977fb2d830db" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekday_music_wakeup", + "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", + "x": 1680, + "y": 420 + }, + { + "id": "a5df6ad625909fe6", + "type": "schedex", + "z": "75c53969.aa5438", + "name": "Music timer", + "wires": [ + [ + "4b05a68f256549b9" + ] + ], + "passthroughunhandled": false, + "suspended": false, + "lat": "", + "lon": "", + "ontime": "", + "ontopic": "", + "onpayload": "", + "onoffset": 0, + "onrandomoffset": 0, + "offtime": "", + "offtopic": "", + "offpayload": "", + "offoffset": 0, + "offrandomoffset": 0, + "mon": false, + "tue": false, + "wed": false, + "thu": false, + "fri": false, + "sat": true, + "sun": true, + "x": 1130, + "y": 1060 + }, + { + "id": "4b05a68f256549b9", + "type": "api-current-state", + "z": "75c53969.aa5438", + "name": "Wake up with music?", + "wires": [ + [ + "0f08977fb2d830db" + ], + [] + ], + "server": "657c7463.48e1e4", + "version": 3, + "outputs": 2, + "halt_if": "on", + "halt_if_type": "str", + "halt_if_compare": "is", + "entity_id": "input_boolean.weekend_music_wakeup", + "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", + "x": 1660, + "y": 1060 + }, + { + "id": "0f08977fb2d830db", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Select Bedroom Only Audio", + "wires": [ + [ + "5502ac50650b12cb" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "input_button.press", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "input_button.bedroom_only_audio" + ], + "labelId": [], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "input_button", + "service": "press", + "x": 2040, + "y": 640 + }, + { + "id": "5502ac50650b12cb", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Mute bedroom speaker", + "wires": [ + [ + "f463cbf3032fb2f2" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.volume_set", + "floorId": [], + "areaId": [ + "7047cdd7d50e49f980eba16f832acb57" + ], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{\"volume_level\":0}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "volume_set", + "x": 2030, + "y": 720 + }, + { + "id": "f463cbf3032fb2f2", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Connect Spotify to Speaker", + "wires": [ + [ + "28e6f5f6f6e710a8" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.select_source", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "media_player.spotify_m038" + ], + "labelId": [], + "data": "{\"source\":\"All Speakers\"}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "select_source", + "x": 2040, + "y": 800 + }, + { + "id": "28e6f5f6f6e710a8", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Start Wakeup Playlist on speaker", + "wires": [ + [ + "231c5343ad084e80" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.play_media", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "media_player.spotify_m038" + ], + "labelId": [], + "data": "{\"media_content_id\":\"https://open.spotify.com/playlist/5w2ieYTFUc7z6GS4V5ZjLl?si=585bd153dfb94614\", \"media_content_type\":\"playlist\"}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "play_media", + "x": 2060, + "y": 880 + }, + { + "id": "231c5343ad084e80", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Enable shuffle", + "wires": [ + [ + "efc99a6dfef495c0" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.shuffle_set", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "media_player.spotify_m038" + ], + "labelId": [], + "data": "{\"shuffle\":true}", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "shuffle_set", + "x": 2380, + "y": 640 + }, + { + "id": "efc99a6dfef495c0", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Jump to next song (trigger shuffle)", + "wires": [ + [ + "868fbd6ef36820ae" + ] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.media_next_track", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [ + "media_player.spotify_m038" + ], + "labelId": [], + "data": "", + "dataType": "jsonata", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "media_next_track", + "x": 2440, + "y": 720 + }, + { + "id": "fb76d5441934b190", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Set volume", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "media_player.volume_set", + "floorId": [], + "areaId": [ + "7047cdd7d50e49f980eba16f832acb57" + ], + "deviceId": [], + "entityId": [ + "input_button.bedroom_only_audio" + ], + "labelId": [], + "data": "{ \"volume_level\" : {{ payload }} }", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "media_player", + "service": "volume_set", + "x": 2370, + "y": 1000 + }, + { + "id": "63957f6f9c0a3608", + "type": "easing", + "z": "75c53969.aa5438", + "name": "Calculate fade in volume", + "wires": [ + [ + "adaa9a5b2cc96879" + ] + ], + "easingType": "linear", + "outputType": "overTime", + "duration": "60000", + "interval": "15000", + "numberOfValues": 10, + "x": 2410, + "y": 860 + }, + { + "id": "868fbd6ef36820ae", + "type": "change", + "z": "75c53969.aa5438", + "name": "Set volume parameters", + "wires": [ + [ + "63957f6f9c0a3608" + ] + ], + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{ \"from\" : 0, \"to\" : 0.2, \"size\": 0.01 }", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 2410, + "y": 800 + }, + { + "id": "adaa9a5b2cc96879", + "type": "calculator", + "z": "75c53969.aa5438", + "name": "Round to max 2 decimals", + "wires": [ + [ + "fb76d5441934b190" + ] + ], + "inputMsgField": "payload", + "outputMsgField": "payload", + "operation": "rdec", + "constant": "2", + "round": false, + "truncate": false, + "decimals": "0", + "decimals2": 0, + "x": 2410, + "y": 920 + }, + { + "id": "11ee3e0ecc62415e", + "type": "function", + "z": "75c53969.aa5438", + "name": "music start time", + "wires": [ + [ + "a5df6ad625909fe6" + ] + ], + "func": "var wakeUpTime = flow.get('weekend_wakeup_time').substr(0,5);\nvar wakeUpFade = parseInt(flow.get('weekend_wakeup_fade'));\n\nvar newMsg = {};\nnewMsg.payload = {}\nnewMsg.payload.ontime = wakeUpTime;\nnewMsg.payload.onoffset = -15; \n\nreturn newMsg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 880, + "y": 1060 + }, + { + "id": "0d71ce9b2c0312fb", + "type": "comment", + "z": "75c53969.aa5438", + "name": "Wake up music sequence", + "wires": [], + "info": " - Start muted to jump awake\n - Skip to next to song to trigger shuffle mechanism, Spotify by default starts with the first song\n - Incrementally increase volume to have a nice experience", + "x": 2030, + "y": 580 + }, + { + "id": "p2catch_wku", + "type": "catch", + "z": "75c53969.aa5438", + "name": "Catch all errors", + "wires": [ + [ + "p2fmt_wku" + ] + ], + "scope": null, + "uncaught": false, + "x": 160, + "y": 2000 + }, + { + "id": "p2fmt_wku", + "type": "function", + "z": "75c53969.aa5438", + "name": "Format error", + "wires": [ + [ + "p2ntfy_wku" + ] + ], + "func": "const err = (msg.error && msg.error.message) ? msg.error.message : String(msg.payload || 'Unknown error');\nconst src = (msg.error && msg.error.source) ? (msg.error.source.name || msg.error.source.id || '') : '';\nmsg.payload = JSON.stringify({\n title: 'Node-RED Error: Wake up & mosquito',\n message: err + (src ? '\\n\\nNode: ' + src : '')\n});\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "timeout": "", + "x": 400, + "y": 2000 + }, + { + "id": "p2ntfy_wku", + "type": "api-call-service", + "z": "75c53969.aa5438", + "name": "Notify error", + "wires": [ + [] + ], + "server": "657c7463.48e1e4", + "version": 7, + "debugenabled": false, + "action": "notify.gotify_ha", + "floorId": [], + "areaId": [], + "deviceId": [], + "entityId": [], + "labelId": [], + "data": "{{{payload}}}", + "dataType": "json", + "mergeContext": "", + "mustacheAltTags": false, + "outputProperties": [], + "queue": "none", + "blockInputOverrides": false, + "domain": "notify", + "service": "gotify_ha", + "output_location": "", + "output_location_type": "none", + "x": 660, + "y": 2000 } ] \ No newline at end of file