{"id":2863,"date":"2022-01-14T10:27:05","date_gmt":"2022-01-14T15:27:05","guid":{"rendered":"https:\/\/blogs.mathworks.com\/iot\/?p=2863"},"modified":"2022-04-11T11:23:53","modified_gmt":"2022-04-11T15:23:53","slug":"add-thingspeak-data-widgets-to-ios-using-scriptable","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/iot\/2022\/01\/14\/add-thingspeak-data-widgets-to-ios-using-scriptable\/","title":{"rendered":"Add ThingSpeak Data Widgets to iOS Using Scriptable"},"content":{"rendered":"

Starting with iOS 14, Apple introduced widgets for the iPhone and iPad. Widgets elevate information to the top of your device and offer information at a glance. They help you customize your device in new ways. Wouldn’t it be awesome to have a ThingSpeak<\/a> widget on your iPhone? Thanks to a new app called\u00a0Scriptable<\/a> you can put ThingSpeak data widgets on your iOS devices.<\/p>\n

\"\"<\/p>\n

Scriptable allows you to write your own widgets using JavaScript and run the scripts on your iOS device. Anil Patro<\/a> shared a starter template to create a ThingSpeak Graph<\/a> widget using JavaScript on GitHub. You can use Anil’s code and modify it for your ThingSpeak channel and style.<\/p>\n

Here are some steps to help you put a ThingSpeak widget on your iOS device:<\/p>\n

    \n
  1. Install\u00a0Scriptable<\/a><\/li>\n
  2. Get the starter code on your device using iCloud sharing and edit on your desktop<\/li>\n
  3. Add a new widget to your Home Screen\n
      \n
    1. From the Home Screen, touch and hold a widget or an empty area until the apps jiggle.<\/li>\n
    2. Tap the Add button\u00a0\"Gray\u00a0in the upper-left corner.<\/li>\n
    3. Select a widget, choose from three widget sizes,\u00a0then tap Add Widget.<\/li>\n
    4. Select the Scriptable app<\/li>\n<\/ol>\n<\/li>\n
    5. Customize the widget:\n
        \n
      1. Hold down on the widget and select Edit Widget.<\/li>\n
      2. Enter a new parameter for your channel:\u00a0CHANNEL_ID | FIELD_ID | results=X<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n

        \"\"<\/p>\n

        iOS widgets refresh rate is controlled by the device. The widgets will update themselves on some schedule and eventually synchronize with recent ThingSpeak channel data.<\/p>\n

        Enjoy making custom widgets for iPhone and iPad thanks to Scriptable and Anil’s work. Anil also posted some widget code for CheerLights<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

        \"\"<\/div>\n

        Starting with iOS 14, Apple introduced widgets for the iPhone and iPad. Widgets elevate information to the top of your device and offer information at a glance. They help you customize your device in… read more >><\/a><\/p>\n","protected":false},"author":148,"featured_media":2866,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[22,3,293],"tags":[49,202,35,190],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/2863"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/users\/148"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/comments?post=2863"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/2863\/revisions"}],"predecessor-version":[{"id":2875,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/2863\/revisions\/2875"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/media\/2866"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/media?parent=2863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/categories?post=2863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/tags?post=2863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}