John's Musings


Yeah, Me Neither

Home Automation

Well, I don't know much about Home Automation, but I'm learning, and I like it. This journey started out with one goal in mind. To turn a single solitary light online from the internet in my front window to make the house look occupied when I'm on travel.


So I started an EcoPlug project and figured out how to set up a machine to machine protocol server (Mosquitto) and then thought......"Well, since I've got this server.........".


One Ecoplug turned into four, and then I learned to control mechanical relays with ESP8266 Internet of Things (IoT) chips. Then I bought a wifi LIFX colored lamp and then I bought two Orsam Lightify wifi lamps. Then I found out that the Lightify lamps wouldn't work because they used something called Zigbee which is a mesh network that hooks devices together. Then I found out there is another standard called Z Wave. Then I found out they sell hubs that do both among other standards. One such hub that I bought is the Wink Hub 2.


Now with all this I can add motion sensors, door sensors, more lights, cameras, you name it.


So now as you can imagine, I have several devices from several companies and several different apps to control them. Once again there is a program called Home Assistant that lets you tie it all together on a single control portal. Here's mine as it stands right this moment:



As you can see I can control my plugs, My lights, my relays and even my Nest Thermostat. As an added bonus it pulls in Plex Media Server, Chromecast, and my music servers (logitechmediaserver) as well.


Then you can take your devices and set automation up. For example my outside light and living room light are set to come on 30 minutes prior to sunset and turn off just before sunrise. (I need to tweak that a little). If you group your devices, as I have done here you can turn them all on at once or individually. Home Assistant also gives you the ability to add custom icons and custom names so now I know exactly what switch I'm controlling when I flip the switch. Just by adding some automation commands I can turn on outside lights at sunset and turn them back off at sunrise. I just worked through the first night of it and I'm positively giddy that it worked.


#Automation
automation:
  alias: Turn on lights when sun sets
  initial_state: True
  hide_entity: False
  trigger:
    platform: sun
    event: sunset
    offset: "-00:05:00"
  action:
    - service: light.turn_on
      entity_id: light.front_porch
    - service: light.turn_on
      entity_id: light.living_room_lamp
automation 2:
  alias: Turn off lights when sun rises
  initial_state: True
  hide_entity: False
  trigger:
    platform: sun
    event: sunrise
    offset: "-00:30:00"
  action:
    - service: light.turn_off
      entity_id: light.front_porch
    - service: light.turn_off
      entity_id: light.living_room_lamp




Home Assistant is kind of odd in that in the days of drag and drop you have to hand code a yaml file. And while it looks like computer code, you don't really need coding skills as the Home Assistant web site provides excellent tutorials for each device you can hook up and their forums are extremely helpful. Trust me, I've been on plenty of unhelpful forums and Home Assistant is great. Even asking the newbie questions, someone will help you and help you to completion of the task.


I'm just scratching the surface here and there are some Home Assistant gurus out there who would make your head spin with their impressive feats of automation with motors, servos, switches, lights, relays, cameras, cell phones, etc. In my mind it's a bit much but remember this is coming from the guy who only wanted to control one light previously.


By the way check out the level of control you have with the LIFX lights. You can control brightness and select from one of about a billion colors or even pick themes. I love this LIFX light. I love it a lot. However for $60 it should love me back.



Here's the problem as I see it though. Lack of standardization. I have plugs that run on machine to machine protocol and are wifi. There are wifi lights. There are wifi lights that need Zigbee protocol, there are devices that use Z wave. There is bluetooth, and IR remotes. Having a hub is almost a necessity as it allows you to not lock into one particular standard which can limit you.


And while the hub allows you access to all the standards and a larger variety of hardware..........good old hooking a wifi outlet up to lamp using machine to machine protocol (MQTT) allows for the fastest operation and response from Home Assistant. Having Z Wave and a hub creates latency between the device, hub, and Home Assistant. Having the device app open also seems to introduce weirdness into the mix at times. My Zigbee Orsam Lightify lights are very slow to react through the home assistant interface. The actual light comes on quick enough but the reaction time to the proper display setting on the Home Assistant page takes a few seconds. In short the light works fine, but the latency in the software is weird. I even had one light working fine that Home Assistant told me was "Unavailable". So did it's app. So did the hub app. But it was still accepting controls fine. Weird.


Another epiphany I had was that if you have a smart bulb in a regular lamp you have to leave the lamp on and it can really only be controlled by the app, or computer. There's something to be said for rolling over in bed and just not being able to flip the light on. It's not the end of the world by any stretch but it's not optimum either. So the thing to do is to install a smart switch in the wall. Unfortunately that involves messing around with the 120 volt mains power. Not a problem for me. The smart switch acts like a regular switch and can be wifi controlled as well. You get the best of both worlds. A switch that works normally on the wall that can be controlled from wifi.


Picked up a GE Iris Wifi enabled switch today at Lowe's. This by and large is the cats meow. Works with Z Wave which of course is what my Wink Hub 2 covers. I removed my old switch, wired this on in and added the device in the Wink app on my phone. It configured perfectly. I wired it with my recessed lighting back in my den.




If there's money to be spent the smarter money is on smart outlets and switches that go in the wall.


Stay tuned for more later as this evolves. Oh, and it will evolve.

48,606