DEV Community

Cover image for Home Assistant: Overview about Smart Light and Smart Power Protocols
Sebastian
Sebastian

Posted on

Home Assistant: Overview about Smart Light and Smart Power Protocols

It started with a ESP8266 board and DHT11 temperature sensor to store data in a timeseries DB. And it evolved to a Home Assistant based environment with air quality, temperature, movement sensors and more than 5 boards. In my journey to extend the home automation systems and further learn about the fascinating and rich Home Assistant ecosystem, I want to add smart lights and smart power switches too. But which protocols do these (proprietary) devices use? Can they be integrated with home assistant?

This article investigates these questions. You will learn about the protocols of the devices, the integrations that Home Assistant provides, and my own recommendation what to choose and how I will proceed with acquiring light and smart power switches.

This article originally appeared at my blog admantium.com.

Hardware Principles

Smart lights and smart power switches become controllable with an integrated controller, usually a micro controller board or integrated circuit. The controller communicates with a base station or is a passive receiver for commands. Commands are typically received wireless with a specific protocol. The functions offered by each device depend on the hardware as well as the software: At its simplest form, the device can only be turned on or off. For lights, fine-granular adjustments of the luminosity can be made, or in case of an RGB light, the color can be set. Smart Power switches also enable the measurement of used electricity. And finally, all devices can be programmed to only operate at certain hours.

Protocols

  • Generic Bluetooth
  • Bluetooth Low Energy: standardized and open protocol, but must be licensed by the manufacturer. 100m transmission radius in optimal conditions.
  • Generic WIFI
  • Thread: Wireless protocol developed by Nest, Samsung and Qualcom
  • ZigBee: IEEE Standard, wireless mesh, energy efficient, used by WeMo, Philips Hue,
  • Z-Wave: Open-Source Wireless Mesh network, used by different well-known companies such as Cisco, Motorola or Nokia

The more specific protocols often need a dedicated base station to work, while the generic devices can be controlled with apps from your smart phone without further hardware. Device interoperability is a difficult topic. At best, you can find a dedicated bridge that will translate from one protocol to another. On the other hand, because smart lights become an ubiquitous home appliance, integration with end user commands like Amazon Echo or Google Home become more widespread, and with this, integration into Home Assistant becomes possible as an alternative to directly speaking the target protocol.

Home Assistant Integration

Smart Light

Smart Power Switch

Choices and Progress

In the beginning of my home automation project, I was not familiar with any of the technologies involved. To be precise, I bought a set of smart power switches and LED bulb with the goal to integrate them, and only having the vague idea "if there is an app to control it, I can find a way around that". Turns out that is true, but it forces you to accept several compromises. First of all, each brand provides their own apps, which you need to install and create an account with. If you use the very same brand, then this might be ok. Second, getting from this app to another home automation system usually involves one more hop to Alexa, Siri or Google Home and then back to your system. Therefore, you are double dependent: On the capability of the API between your Smart Device and a Cloud Service, and then again on the compatibility of your home automation system to this cloud service. As things move fast in this territory, solutions might not work over very long timespans.

If you do not follow this way, then you need to find a direct connection between your home automation system and the smart device. As shown above, several very specific integrations for Home Assistant exist. But while reading and researching I found several articles pointing towards true do-it-yourself solution: Flash the smart device with a custom firmware based on Tasmota, and then use the Tasmota Integration for controlling and reading the devices. Depending on the brand, you can either use the Tasmotizer app with compatible items from the Tasmota device list, or use other conversation tools like Tuya convert that will make your device Tasmota compatible. The initial flashing seems like a daunting task at first, with lots of step to do, but there are several through and up-to-data articles and GitHub pages that provide all the information’s painful lessons learned while trying it.

I want a simple approach, at least for now1. Home Assistant should be my central integration platform to which all sensor information flows and from which all devices can be controlled. In addition, ESPHome and the then new Tasmota will be used for keeping boards, devices and sensor updated. And therefore, distilling what I learned with this research, I will obtain Sonoff power switches, which typically have an ESP8255 or ESP8266 board, and a Hama Smart Light.

Conclusion

This brief article provided an overview to recent smart power switches and smart light protocols and devices. Overall, the protocols are either very vendor specific, or use a generic Bluetooth/WIFI connection and usually an app to be operated. The article also listed several Home Assistant integrations. In essence, to make smart power and smart lights integrating with Home Assistant, you have three options: First, integrate the device with a cloud provider, and then this cloud provider to HA. Second, use a direct HA integration library. Third, flash the device with a custom community provided firmware. After considering the various option, I prefer to have one integration library for all these devices. my choice goes to Tasmota, and I will try to flash the custom firmware to specifically selected devices. Read more about those adventures in the future.

Footnotes


  1. If I still want a real challenge, I could buy a not supported Wi-Fi device, check the network traffic, try to decrypt the protocol, and write a custom handler. A cool inspiration is this GO network debugger for Tuya devices

Top comments (0)