Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
日曜HackでHomeKitと戯れた話
Search
Tatsuya Tanaka
October 30, 2016
Technology
2.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
日曜HackでHomeKitと戯れた話
API非公開の学習リモコンをHomeKit対応させた話と、HomeKitについて。
@iOS_LT #23
Tatsuya Tanaka
October 30, 2016
More Decks by Tatsuya Tanaka
See All by Tatsuya Tanaka
iPhoneのセンサー情報をmacOSアプリでリアルタイム活用するための技術
tattn
1
800
Better use of SwiftUI
tattn
0
510
Swift Concurrencyによる安全で快適な非同期処理
tattn
2
1.5k
iOSアプリの技術選択2022
tattn
7
4k
Widget Suggestions 対応と ヤフーの新OS対応
tattn
1
1.4k
WidgetKitで良い体験を作るには / Good experience with WidgetKit
tattn
2
2k
既存アプリにSwiftUIをどう組み込んでいくか
tattn
8
2.6k
iOS 14からのアプリ内課金
tattn
5
3.2k
iOS 14の位置情報系アップデート
tattn
0
23k
Other Decks in Technology
See All in Technology
Swap and Memory Reclaim - Squeezing Out More RAM
ennael
PRO
1
1.4k
AI臭い文章とは何なのか
nasuvitz
36
75k
雪かき部 #7 もう怖くない!SELECT文!
foursue
0
220
「今盗んで、後で解く」に備える ― AWSのポスト量子暗号入門
yama3133
2
280
20260915deck.gl-raster を使ってみた
rena1208
0
170
Kiro Meetup #8 Kiro アップデート (2026/3/21〜2026/9/24)
katzueno
1
310
AWS DevOps Agent スキルをつかいこなそう / Master AWS DevOps Agent Skills
kinunori
2
640
Making AI Agents Safe and Fast- Jev, Obsidian, and the Meta-Harness
x5gtrn
PRO
0
170
Mastering Agentic Development: Harness Engineering for Effective Coding Agents
konippi
3
660
The seven pitfalls of AI (revised version)
ufried
0
140
HolmesGPTで始めるSREエージェント入門!プラットフォームの障害調査はAIにお任せ 〜
leveragestech
PRO
0
120
PQC移行の今 -- IETF からみた現在地
satokan
4
690
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Faster Mobile Websites
deanohume
310
32k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
The Curious Case for Waylosing
cassininazir
1
550
How to Talk to Developers About Accessibility
jct
2
560
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
410
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
YesSQL, Process and Tooling at Scale
rocio
174
15k
So, you think you're a good person
axbom
PRO
2
2.2k
Google's AI Overviews - The New Search
badams
0
1.6k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
The Curse of the Amulet
leimatthew05
3
15k
Transcript
ాத ୡ (tattn) Github: https://github.com/tattn Qiita: http://qiita.com/tattn Twitter: https://twitter.com/tanakasan2525 ༵HackͰ
HomeKitͱٔΕͨ
HomeKit iOS 8 ͔Β͑ΔΑ͏ʹͳͬͨ iOSͱՈి Λܨ͙Ս͚ڮ
ઌिͷ༵ʹ͜Ε͕ಧ͖·ͨ͠ (ܹ҆ʂ2500ԁ) ֶशϦϞίϯϢχοτ
͔͠͠ɻɻɻ ͱ͍ͬͯ҆ͷͰ͕͢ APIެ։͞Εͯͳ͍ HomeKitʹରԠͯ͠ͳ͍
Demo
ಈըஏ͔͍ͣ͠ͷͰΧοτ
γεςϜߏ • RM mini 3 (ࠇ౾) • Node.js • homebridge
• iPhone 6s (iOS10) ࠇ౾ HomeKit API UDP ֎ઢ TV
ࠇ౾Λૢ࡞͢ΔͨΊʹ WireSharkͰެࣜΞϓϦͱࠇ౾ͷ௨৴Λݟͯɺ Node.jsͰͦΕΛਅࣅΔ͜ͱͰૢ࡞Մೳʹɻɻɻ
ࠇ౾Λૢ࡞͢ΔͨΊʹ ͪͳΈʹɺQUIC (ΫΠοΫ) ͱ͍͏ Google͕։ൃͨ͠৽͠ΊͷϓϩτίϧΛར༻͠ɺ UDPͷίωΫγϣϯΛு໋ͬͯྩΛग़ͯ͠·ͨ͠ɻɻɻʂ
Homebridge Node.jsͰHomeKitAPIͷΤϛϡϨʔτ͕Ͱ͖Δπʔϧ homebridge-***ͱ͍͏npmύοέʔδΛ࡞֦ͬͯு͢ΔΈɻ ࠇ౾༻ͷύοέʔδΛ࡞ɻ https://github.com/nfarina/homebridge https://github.com/tattn/homebridge-rm-mini3
iOS10ͰೖͬͨHomeΞϓϦ
ίʔυΛಡΈऔͬͯՈిΛઃఆ
͜Ε͚ͩͰɺHomeΞϓϦ & Siri ͔ΒϦϞίϯૢ࡞͕ՄೳʹͳΓ·ͨ͠ɻ
ୈࡾͷϖʔδ͕૿͑·ͨ͠
ͦ͏͍͑iOSͷLTͰͨ͠ɻɻɻ HomeKitͷAPIΛͬͯΈ·ͨ͠ https://github.com/tattn/HomeKit-Playground
HomeKitΛ͏ͨΊʹ CapabilityͰHomeKitΛOnʹ͢Δ
HomeKitͷઃఆͷΞΫηε plistʹ NSHomeKitUsageDescription ͷՃ͕ඞཁ iOS10͔ΒϢʔβʔσʔλͷΞΫηεͷ తͷهड़͕ඞਢʹ
ͱΓ͋͑ͣͷUI AppleͷΨΠυϥΠϯʹେମԊͬͨ ૉΒ͍͠UIΛ࡞ • ߇͑ΊͰ͋Δ͜ͱ • ໌ྎͰ͋Δ͜ͱ • Ԟߦ͖Λ༩͑Δ͜ͱ
Demo
ಈըஏ͔͍ͣ͠ͷͰΧοτ
HomeKit https://developer.apple.com/jp/documentation/HomeKitDeveloperGuide.pdf
Accessoryͷத (ྫ) https://developer.apple.com/jp/documentation/HomeKitDeveloperGuide.pdf TV Accessory Service • TV • εΠον
Characteristic • ిݯ • ϛϡʔτ • …
Primary Homeͷऔಘ // 管理クラスの取得 let homeManager = HMHomeManager() homeManager.delegate =
self // MARK: - HMHomeManagerDelegate func homeManagerDidUpdateHomes(_ manager: HMHomeManager) { // Primary Homeの取得 let home = manager.primaryHome } ↓͜ΕΛऔಘ
Room / Accessoryͷऔಘ let home = manager.primaryHome let room =
home?.rooms[0] let accessory = room?.accessories[0] // これでも可 let accessory = home?.accessories[0]
Characteristicͷऔಘ for service in accessory.services { switch service.serviceType { case
HMServiceTypeSwitch: for chara in service.characteristics { switch chara.characteristicType { case HMCharacteristicTypePowerState: // 電源スイッチの取得 chara default: () } } default: () } } Accessory Service • TV • Ϙλϯ Characteristic • ిݯ • ϛϡʔτ • …
ͷऔಘ Accessory Service • TV • Ϙλϯ Characteristic switch chara.characteristicType
{ case HMCharacteristicTypePowerState: // 値の取得 chara.readValue { error in let isOn = chara.value as? Bool } // 値の設定 chara.writeValue(true) { error in print(error) } default: () } • ిݯ • ϛϡʔτ • …
Έͳ͞Μͥͻ࡞Γ·͠ΐ͏ʂ APIͷ͜ͱΛΔͨΊʹ ۙʹͦͷٕज़Λײ͡Δͷ͕खͬऔΓૣ͍Ͱ͢ʂ ←ֶशϦϞίϯϢχοτ ɹ͓͢͢ΊͰ͢ʂ