1 of 38

Home Assistant Dialogue

W3C TPAC 2023 Breakout Session

Ege Korkan, Josh Cohen,

Michael McCool, Cristiano Aguzzi

2 of 38

Before we start!

  • This sessions is part of W3C TPAC 2023
  • These meetings follow the Positive Work Environment at W3C: Code of Ethics and Professional Conduct to ensure a healthy environment. Read more here.
  • We follow COVID regulations set by the organizers. More in the next slide or here.
  • Automatic Captions should be enabled

2

3 of 38

3

4 of 38

Agenda

  • Logistics
  • Goal
  • Short Intro to WoT
  • Short Intro to Home Assistant
    • Example HA/ESPhome Device
    • Home Assistant Dashboard
  • Previous Experience
  • Discussion
    • Integration Scenarios
    • Outreach
  • Q&A

5 of 38

Logistics

Who can scribe?

Please join IRC and then type present+

https://irc.w3.org/?channels=%23wot-home-assistant

Use q+ when you want to speak

The minutes will be public

Event Details: https://www.w3.org/events/meetings/c13a3ae8-979c-4157-9c74-b28aba314878/

6 of 38

Introduce Yourself

After talking, please put your name in IRC, together with your affiliation

7 of 38

Goal

Discuss how WoT can work with Home Assistant (and similar) smart home gateways/ecosystems

8 of 38

Short Introduction to Web of Things

9 of 38

Short Introduction to Home Assistant

10 of 38

What is “Home Assistant”

  • An open source smart home gateway solution with almost 2000 integrations for different ecosystems and protocols.
  • 5 years old next Sunday 🎂
  • https://www.home-assistant.io/
  • It has a REST API (https://developers.home-assistant.io/docs/api/rest/ )
  • Installs on Windows, Linux, SBC, container or bare metal
  • Auto Discovers many vendor products

  • ESPHome Integration for ESP32/ESP8266 Microcontrollers
  • Good solution for DIY. ESPs are used in Arduino IDE, platformio, VsCode etc
  • Low Code YAML definitions or C API

11 of 38

Home Assistant Integrations

12 of 38

Home Assistant Dashboard

LIFX Bulbs

ESP32 DHT11 Temp Sensor

WeMo Plugs

Scenes

ESP Scene Selector

13 of 38

Example

DIY ESPHome Scene Selector

14 of 38

Build: HA/ESPhome Scene Button

ID: widget2

Ready for Bed: Short press = RED scene

Ready to Sleep: Long Press =LIGHTS OUT

Binary Sensor: Push button

ESP32 Microcontroller

3D Printed Case

15 of 38

Home Assistant ESPHome Panel

After Creating device, click edit to config

16 of 38

Line

Comment

53

Switch on MCU GPIO Pin 5

57

Debounce!

58

On_click handler

59-68

Short press

69-78

Long Press

17 of 38

Previous Relevant Experience

18 of 38

TDs for Northbound REST API of Home Assistant

19 of 38

Integration Scenarios

20 of 38

Integration not

A full rewrite of the architecture is pretty unlikely, no matter how amazing WoT is or can be. What can be easy paths forward for such platforms in general? What can be our strategy?

21 of 38

List of Scenarios

  1. Southbound/HA Backend/Integration
    1. Self describing
    2. Externally describing
  2. Northbound TDs for the REST API of HA (Add-on as by HA terminology)
  3. ESP Home Integration

22 of 38

Integration Scenarios

W3C WoT

Home Assistant

ESPhome

Temp sensor

Scene button

W3C WoT

LifX

Couch light

Desk light

WeMo

AC switch

Xbox switch

W3C WoT

WoT Siren

WoT dashboard

23 of 38

Southbound Integration

WoT works well for cases where there is manual configuration overhead due to lack of standardized data model

HTTP (e.g. Philips Hue, other gateways)

MQTT (NCD sensors)

Modbus devices

and more

24 of 38

Different Ways of Southbound

  1. IoT devices come with TDs, i.e. self-describe
    1. In the future: Commercial devices expose a TD after onboarding
    2. DIY/Maker Space where makers build and program Things that expose TDs

This can also support directories and introduction mechanisms defined in WoT Discovery

  • External description of TDs
    • Manually generate/write TDs
    • Identify Thing from a set of TMs (catalogue), instantiate TD by filling the blanks/placeholders

Note: There are different levels of maturity for a HA integration

25 of 38

Annotating Events

ktk: Filtering based on events and annotating the events

26 of 38

Northbound Integration

McCool’s work

We can generate TDs for the northbound REST API. This implies that TDs need to be to flexible enough to describe such APIs

https://github.com/w3c/wot-testing/blob/main/data/input_2022/TD/intel-wot-ha/TDs/sensor.ncd1_temperature_1.td.jsonld

27 of 38

Event Annotation

It can be done on top of the northbound integration where the annotated TDs can be consumed by a triple store

28 of 38

ESPHome Integration

ESPHome uses a YAML file to configure the device and this results in e.g. MQTT topics. We can predict those topics and generate a TD accordingly.

Once we generate those TDs, the southbound integration can happen

29 of 38

Business Case

30 of 38

For manufacturers

Instead of multiple integrations to different platforms, they need to write a TM themselves and the gateways consume them

31 of 38

What is Next?

32 of 38

To discuss offline

The discussion will continue in WoT CG meetings (office hours, internal meetings)

Please join or give us your contact information

33 of 38

Outreach

  • Community developers, leaders, influencers
  • YouTubers
  • Home assistant founder
  • Home assistant GitHub contributors
  • GitHub issue
  • Discord server

Any other inputs?

34 of 38

Meeting Minutes

35 of 38

Participants Consolidation

36 of 38

Notes

Triplestore integration: https://www.youtube.com/watch?v=VqSf-z30x-M

“Web of Things is not a protocol” is not well understood. It is not a protocol, it is a data model

Use Cases document is not well advertised

37 of 38

Backup

38 of 38