-
Notifications
You must be signed in to change notification settings - Fork 0
/
present_data
1 lines (1 loc) · 5.45 KB
/
present_data
1
[{"id":"57761133.b87f9","type":"ui_text","z":"8b2a50a5.d4fcc8","group":"50994895.0cd758","order":2,"width":"6","height":"2","name":"","label":"Workout Duration","format":"<font size=+8>{{msg.payload}}","layout":"col-center","x":270,"y":280,"wires":[]},{"id":"6f610707.537b6","type":"link in","z":"8b2a50a5.d4fcc8","name":"Zeit","links":["a3e73115.c4c388"],"x":75,"y":280,"wires":[["57761133.b87f9"]]},{"id":"3aa8596a.4a973e","type":"ui_button","z":"8b2a50a5.d4fcc8","name":"","group":"50994895.0cd758","order":1,"width":"0","height":"0","passthru":false,"label":"Reset Waterrower","color":"","bgcolor":"","icon":"","payload":"RESET","payloadType":"str","topic":"","x":270,"y":240,"wires":[["f195388f.31713"]]},{"id":"f195388f.31713","type":"link out","z":"8b2a50a5.d4fcc8","name":"","links":["8126ba9c.9688a8"],"x":435,"y":240,"wires":[]},{"id":"a17e454b.11c5d","type":"ui_text","z":"8b2a50a5.d4fcc8","group":"50994895.0cd758","order":4,"width":0,"height":0,"name":"","label":"Stroke Count","format":"{{msg.payload}}","layout":"col-center","x":250,"y":360,"wires":[]},{"id":"3e0fea50.59b07e","type":"link in","z":"8b2a50a5.d4fcc8","name":"Stroke Count","links":["9c91fae6.27593"],"x":75,"y":360,"wires":[["a17e454b.11c5d"]]},{"id":"3d54fcf0.f99084","type":"ui_text","z":"8b2a50a5.d4fcc8","group":"50994895.0cd758","order":5,"width":0,"height":0,"name":"","label":"Stroke Rate","format":"{{msg.payload}}","layout":"col-center","x":250,"y":400,"wires":[]},{"id":"3d1cff8f.09a448","type":"link in","z":"8b2a50a5.d4fcc8","name":"Stroke Rate","links":["790df88c.52ed28"],"x":75,"y":400,"wires":[["3d54fcf0.f99084"]]},{"id":"7ca11172.e6a038","type":"ui_text","z":"8b2a50a5.d4fcc8","group":"50994895.0cd758","order":3,"width":"6","height":"2","name":"","label":"Distance","format":"<font size=+8>{{msg.payload}} m","layout":"col-center","x":240,"y":320,"wires":[]},{"id":"d343ed14.3aff6","type":"link in","z":"8b2a50a5.d4fcc8","name":"Distance","links":["f5b0880d.63082"],"x":75,"y":320,"wires":[["7ca11172.e6a038"]]},{"id":"4e5db7ac.d3e0d8","type":"ui_button","z":"8b2a50a5.d4fcc8","name":"","group":"50994895.0cd758","order":6,"width":0,"height":0,"passthru":false,"label":"Save and Upload","color":"","bgcolor":"","icon":"publish","payload":"","payloadType":"str","topic":"","x":270,"y":500,"wires":[["1f835960.3b714f","8b5f1e98.55801"]]},{"id":"89cb335d.4053","type":"sqlite","z":"8b2a50a5.d4fcc8","mydb":"e8776c25.3961b","name":"","x":680,"y":480,"wires":[[]]},{"id":"1f835960.3b714f","type":"function","z":"8b2a50a5.d4fcc8","name":"write data","func":"var msg = {\n \"topic\": \"INSERT INTO workout VALUES (CURRENT_TIMESTAMP,\"\n + \"'rowing\" \n + \"',\"\n + context.global.distance\n + \",'\"\n + context.global.duration\n + \"','\"\n + \"see my last rowing execise\"\n + \"','\"\n + context.global.w_comment\n + \"')\"};\nreturn msg;\n","outputs":1,"noerr":0,"x":460,"y":500,"wires":[["89cb335d.4053","c66a7051.6c7b8"]]},{"id":"c66a7051.6c7b8","type":"debug","z":"8b2a50a5.d4fcc8","name":"","active":true,"console":"false","complete":"false","x":630,"y":520,"wires":[]},{"id":"500f8685.ce6748","type":"ui_text_input","z":"8b2a50a5.d4fcc8","name":"","label":"Kommentar","group":"50994895.0cd758","order":8,"width":0,"height":0,"passthru":false,"mode":"text","delay":300,"topic":"","x":250,"y":440,"wires":[["388d593e.b0b5ce"]]},{"id":"388d593e.b0b5ce","type":"change","z":"8b2a50a5.d4fcc8","name":"","rules":[{"t":"set","p":"w_comment","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":440,"wires":[[]]},{"id":"285fa3f0.c2d0dc","type":"debug","z":"8b2a50a5.d4fcc8","name":"Feedback from Strava","active":true,"console":"false","complete":"payload","x":880,"y":560,"wires":[]},{"id":"926614f5.d6e148","type":"https-node","z":"8b2a50a5.d4fcc8","name":"","method":"POST","ret":"obj","url":"https://www.strava.com/api/v3/activities","authorized":false,"agent":false,"x":670,"y":580,"wires":[["285fa3f0.c2d0dc","743ad20.00354b"]]},{"id":"e127eb29.9c8868","type":"inject","z":"8b2a50a5.d4fcc8","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":310,"y":580,"wires":[["8b5f1e98.55801"]]},{"id":"8b5f1e98.55801","type":"function","z":"8b2a50a5.d4fcc8","name":"compile request","func":"msg.payload =\n { name: 'see my latest rowing exercise with Waterrower',\n type: 'Rowing',\n start_date_local: context.global.startdate,\n elapsed_time: context.global.duration,\n distance: context.global.distance,\n description: context.global.w_comment};\nmsg.headers = { Authorization: 'Bearer YOUR STRAVA AUTHENTIFICATION TOKEN'};\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":580,"wires":[["926614f5.d6e148"]]},{"id":"98f13805.cb188","type":"comment","z":"8b2a50a5.d4fcc8","name":"Upload to Strava","info":"","x":120,"y":580,"wires":[]},{"id":"743ad20.00354b","type":"function","z":"8b2a50a5.d4fcc8","name":"get activity id","func":"msg.payload=\"https://www.strava.com/activities/\"+msg.payload.id;\nreturn msg;","outputs":1,"noerr":0,"x":850,"y":600,"wires":[["2d28ee24.65329a"]]},{"id":"2d28ee24.65329a","type":"debug","z":"8b2a50a5.d4fcc8","name":"activity id","active":true,"console":"false","complete":"payload","x":1010,"y":600,"wires":[]},{"id":"50994895.0cd758","type":"ui_group","z":"","name":"Workout","tab":"e7e07068.74633","disp":true,"width":"6"},{"id":"e8776c25.3961b","type":"sqlitedb","z":"","db":"/media/Intenso/workouts.db"},{"id":"e7e07068.74633","type":"ui_tab","z":"","name":"Waterrower","icon":"dashboard"}]