Smart Home Automation

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
So I made a small post about if this was a valid topic in the musing thread but finally got it mostly done setup (there is no done) so figured I'd make a post.

So to start these are the definitions that I use

Smart Device = any device that allows remote control of any type including voice via Alexa/Google Home, This is what most people think when someone says smart home.
Smart House = uses sensors & automation to control Smart Devices
WAF = Wife Approval Factor = How Non-techies approve of the smart home ;)

Also my current devices make use of the following protocols Wifi / Z-wave / Zigbee / MQTT

Some history I got started on the smart home thing last christmas (2017) when my wife bought me a Smartthings hub and 4 sengled white light bulbs. I expanded this to a couple motion sensors to control the lights and then quickly realized that while Smartthings is good for simple things if you want to do more complex things or use multiple conditions to trigger things you need to use their webcore platform which shifts all the logic to the cloud and honestly I'd rather have my house controlled from my house. So this recent August (2018) I built an actual server for various things (plex / nextcloud / NAS) and bought a zwave & zigbee usb stick so I could eventually replace the Smartthings hub. The server is running Unraid for the base OS and everything runs in docker containers so it should be runnable anywhere.

Anyways I decided to use Home Assistant (HA from now on) as the brains for my house. It is an open sourced python software that uses Yaml files (text files with formatting requirements) to configure everything and has components to interface with pretty much any product you could want. Bonus points every single thing runs locally on the server (There is a cloud component but the logic still runs locally). Since everything runs on text files I can use Github to store my config in.

So to get into my full set up this is the hardware I currently have

Smart Plugs
3 Wemo mini plugs (wifi)
3 Gosund (wifi) (not in use yet)

Lights
4 Sengled Light bulbs (Zigbee)

Switches
2 Zooz dimmer switches (Z-wave)

Sensors
2 Bosch Motion sensors (Zigbee),
2 Zooz 4-in-1 sensors (Z-wave),
2 smartthings door sensor (Zigbee)

Speakers
Sonos speakers (wifi)

Media Players
3 Chromecast (wifi),
Samsung Smart TV (wifi)

Other
Xiaomi Smart Cube (Zigbee),
SmartThings Hub (Wired),
Tomato Router (Wired),
3 Pixel Phones (Wifi),
1 Amazon Echo Dot (Wifi)

On top of the hardware I have a few notable software pieces in use. I'm using Owntracks which sends gps from the pixel phones back to a secured MQTT broker running on my server which then sends to an unsecured internal only MQTT server (the smartthings bridge doesn't support authentication) which HA then reads. I use MariaDB to store all the data from HA (purging at 5 days old) I also have a few other software tied into HA that I don't do anything with (I'm still in get all the data setup mode ;) ) Plex, Tautulli (plex monitor), qBittorrent, Transmission.

Also have a bunch of components not currently being used (same logic not sure what I'll end up wanting), ISS (let me know when ISS is overhead), Space Launch (Lets me know when the next launch is), Moon/Sun/Season (Moon Phase/Sun rise&set/Season), YR (Weather from Norwegian Meteorological Institute), Darksky (weather from darksky)

So I do still use the Smartthing Hub but I found a piece of software that takes events from Smartthings and sends it via MQTT to HA and then sends things from HA back to Smartthings. This is due to the fact that zigbee IMO sucks as a protocol since it is open for anyone to modify you end up with each developer making a slightly different version so getting them to talk to each other isn't the easiest and while the light bulbs should in theory work directly from what I've been able to find online the motion sensors don't currently so I just left them all on the Smartthings hub for now.



Since they are somewhat odd these are the setups for my living room lights coming from smart things
Code:
---
#
# MQTT virtual light from smartthings
#
platform: mqtt
name: "Living Room"
unique_id: "Living Room"
state_topic: "smartthings/Living Room/switch/state"
command_topic: "smartthings/Living Room/switch/cmd"
brightness_state_topic: "smartthings/Living Room/level/state"
brightness_command_topic: "smartthings/Living Room/level/cmd"
brightness_scale: 100
payload_on: "on"
payload_off: "off"
retain: true

So smartthings post on the state topics and then HA posts on the command topics, HA uses a brightness scale of 0-255 while Smartthings uses 0-100 so need to set that

When I was just starting to set this up I luckily found someone else who had set up the files in a way that make sense and split them up so each file does 1 thing, since the standard way of doing the config for HA is to just use 1 or possible 2 files. Since I didn't have many files done yet I converted and it is so much neater. HA does have a nice way of storing "secrets" in a separate file that you can then reference which is useful when posting them online or getting debugging help so there are several times in the files where I have !secret X that means it will go to the file and get that key and replace it.

Anyways I'm not going to post all of my setup files here but I'll post some of my automations.

Code:
---
#
# Code to dim the living room lights when I start playing a video
#
id: Wacth the Movies
alias: "Media player playing"
initial_state: 'off'
trigger:
  - platform: state
    entity_id: media_player.living_room_tv
    to: 'playing'
    from: 'off'
  - platform: state
    entity_id: media_player.living_room_tv
    to: 'playing'
    from: 'paused'
  - platform: state
    entity_id: media_player.living_room_tv
    to: 'playing'
    from: 'idle'
action:
  service: scene.turn_on
  entity_id: scene.movie_mode_on

---
#
# Code to return the living room lights to normal after playing a video
#
id: The player Stopped
alias: "Media player paused/stopped"
initial_state: 'off'
trigger:
  - platform: state
    entity_id: media_player.living_room_tv
    from: 'playing'
    to: 'idle'
  - platform: state
    entity_id: media_player.living_room_tv
    from: 'playing'
    to: 'paused'
  - platform: state
    entity_id: media_player.living_room_tv
    from: 'playing'
    to: 'off'
action:
    service: scene.turn_on
    entity_id: scene.movie_mode_off
Code:
---
#
# Scene to dim the lights when watching movies
#
name: Movie Mode On
entities:
  light.living_room:
    state: on
    brightness_pct: 35

---
#
# Scene to return the lights to normal
#
name: Movie Mode Off
entities:
  light.living_room:
    state: on
    brightness_pct: 100
So these two automations work together (and I need to tweak since they currently have a low WAF hence initial_state: 'off') with the two scenes to when we start playing something on the chromecast in the living room it will dim the lights to 35% and then when we stop it will put them back on at 100% This is something that was not possible with smartthings.

Another automation I have slowly fades in bedroom (and my kids bedrooms) lights on over 30 mins (for me and 5 for the kids) using a python script (its not natively supported by the lights I have)

This makes use of a condition and the Workday sensor which takes into account holidays and weekends to know when it is a normal work day (it doesn't account for vacations) and I need to actually wake up
Code:
---
#
# Fade in the master bedroom lights over 15 mins
#
id: Master Bedroom Wake up
alias: Master Bedroom Light Fade In
trigger:
  - platform: time
    at: "05:30:00"
condition:
  condition: state
  entity_id: 'binary_sensor.workday_sensor'
  state: 'On'
action:
  - service: python_script.fade_in_light
    data:
      entity_id: light.master_bedroom
      delay_in_sec: 18
      start_level_pct: 5
      end_level_pct: 100
      step_in_level_pct: 1

And the actual python script
Code:
entity_id  = data.get('entity_id')
sleep_delay = int(data.get('delay_in_sec'))
start_level_pct = int(data.get('start_level_pct'))
end_level_pct = int(data.get('end_level_pct'))
step_pct  = int(data.get('step_in_level_pct'))

start_level = int(255*start_level_pct/100)
end_level = int(255*end_level_pct/100)
step = int(255*step_pct/100)

new_level = start_level
while new_level < end_level :
	states = hass.states.get(entity_id)
	current_level = states.attributes.get('brightness') or 0
	if (current_level > new_level) :
		logger.info('Exiting Fade In')
		break;
	else :
		logger.info('Setting brightness of ' + str(entity_id) + ' from ' + str(current_level) + ' to ' + str(new_level))
		data = { "entity_id" : entity_id, "state" : on, "brightness" : new_level }
		hass.services.call('light', 'turn_on', data)
		new_level = new_level + step
		time.sleep(sleep_delay)

So it takes as input the entity_id (all devices in HA have an entity_id to define them) (light.master_bedroom in this case), a start / end % (5/100), how much to increase each time (1 % in this case), and how often to increase (18 for this one)

So that is the basic config / automations done and at this point I've replicated everything that Smartthings was doing (and then some extra) so I still need to do the UI aspect (again via text files, I've been the only one looking at it the others in the house just want it to work) but HA lets you have multiple UIs and I've seen a few examples I'll probably be going over again to get ideas.

Along with HA I also have plans to go making some arduino sensors which talk over radio (nrf24L01) and to a controller and then over MQTT so I can get more data about my house and whats going on in it. I also want to get some raspberry pi zeros and use those for room presence detection. This is all in addition to buying more lights and motions sensors to go along with them.

Anyways this is getting long enough already so I'll end it here but if anyone has any questions or comments I'd gladly answer them the best I can.
 

bombcar

Ars Legatus Legionis
32,602
Tell me more about Home Assistant.

Currently I have an absolutely ungodly amount of Hue bulbs (seriously, these things rock), countless Caseta switches, a Homekit-compatible fan, and two door locks. One lock is Homekit (a Kwikset) which works but I don't really like it; and a Schlage (bought before I decided to go Homekit, so it's only Z-wave compatible; I bought it just to avoid having to use a key), and some Best Buy homekit switches from Ebay (they cancelled them but they seem to work decently for me for things like basements, etc). I have other random items that I've not yet setup or only partially setup - a Z-wave flood sensor, some Tuyo (I think) switches with a silly "Smart Home" app (super cheap compared to Homekit ones; I'm hoping to bridge somehow).

I have a Raspberry Pi with a Razberry Z-wave board running Homebridge, and I'm trying to decide if I want to make the jump to Home Assistant in full - or continue to use Homebridge to get more controls. The automation programming capabilities of Homekit itself are ... limited (you can't have two conditions for an automation beyond X + time of day, for example).
 
  • Like
Reactions: ChelseaHahn

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
Tell me more about Home Assistant.

Currently I have an absolutely ungodly amount of Hue bulbs (seriously, these things rock), countless Caseta switches, a Homekit-compatible fan, and two door locks. One lock is Homekit (a Kwikset) which works but I don't really like it; and a Schlage (bought before I decided to go Homekit, so it's only Z-wave compatible; I bought it just to avoid having to use a key), and some Best Buy homekit switches from Ebay (they cancelled them but they seem to work decently for me for things like basements, etc). I have other random items that I've not yet setup or only partially setup - a Z-wave flood sensor, some Tuyo (I think) switches with a silly "Smart Home" app (super cheap compared to Homekit ones; I'm hoping to bridge somehow).

I have a Raspberry Pi with a Razberry Z-wave board running Homebridge, and I'm trying to decide if I want to make the jump to Home Assistant in full - or continue to use Homebridge to get more controls. The automation programming capabilities of Homekit itself are ... limited (you can't have two conditions for an automation beyond X + time of day, for example).

So Home Assistant really can interface with pretty much anything, and there is a Raspberry Pi image to run it in (Hassio) which has addons (which are different from components) that run in dockers.

It looks like there two HomeKit components one that lets you control HA things in HomeKit and the other that lets you Control HomeKit things in HA. There is also a component that will interface with the Hue hub to allow you to control the bulbs direct from HA. I already touched on Z-wave but those should interface easily with HA. As for the Tuya switches there is a component for them as well (I just got some for xmas but haven't opened them yet)

So all of those devices should integrate well with HA and then you can do lots of automations (and can interface with Node-Red for even easier automations)

Going to touch on the Bulb vs Switch debate. I'm strongly on the Switch side with the exception being colored bulbs. The reasoning behind it is simple everyone already knows how to use a light switch. If you have bulbs (like I said I have several) your at the mercy of the power switch. If someone flips the switch because they don't remember or don't know your fancy smart devices no longer have power so you can't do anything with them. Now my house has overhead lighting everywhere so that could be another factor since most of my lights are 2 bulbs.
 

bombcar

Ars Legatus Legionis
32,602
The bulb/switch is currently my biggest "regret" I have - as the Caseta switches are pricey but wonderful - however, they won't let me do things like color-change the bulbs and I'm really getting a kick out of daylight white during the day and yellow/orange white at night.

What I've found for the Hue bulbs is that you can buy things like this really help - I just "hardwire" the light on and put the dimmer control over it, most people can figure that one out.

Some have made a shim so you can install the Phillips Hue dimmer thing over a normal decora switch, which is pretty nice.

I'd really like a "hardwired" switch with a smart bulb that talked to the switch, but such is life in the first world with its problems. A switch that could alternate between on-daylight, on-amber, off would be just about perfect for me.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
The bulb/switch is currently my biggest "regret" I have - as the Caseta switches are pricey but wonderful - however, they won't let me do things like color-change the bulbs and I'm really getting a kick out of daylight white during the day and yellow/orange white at night.

What I've found for the Hue bulbs is that you can buy things like this really help - I just "hardwire" the light on and put the dimmer control over it, most people can figure that one out.

Some have made a shim so you can install the Phillips Hue dimmer thing over a normal decora switch, which is pretty nice.

I'd really like a "hardwired" switch with a smart bulb that talked to the switch, but such is life in the first world with its problems. A switch that could alternate between on-daylight, on-amber, off would be just about perfect for me.

Yeah like I said with the exception of colored bulbs I'd prefer switches any day. Currently the 4 bulbs I have 2 are in the master bedroom closet with a motion sensor (where the switch still gets flicked off on occasion) and 2 are in the living room with a motion sensor and alexa near by that can shut turn them on/off via voice.

I am tempted to get a few colored bulbs for the living room so I can say have them be blue in the morning if its going to rain so I know to grab the umbrella.
 

Amos

Ars Tribunus Militum
2,201
Subscriptor++
My condo is 95% smart now - most bulbs and switches are WiFI although there are couple of light switches that don't have neutral wires and the lights themselves use odd bulbs that don't come in WiFi. Got an August smart door lock for Christmas.
I'm running Homeassistant with HADashboard as the front end on a Nexus 7 tablet.

My biggest accomplishment to date was writing automations that will turn off the Wyze camera (connected to a TP Link wifi plug) when we get home and vice versa. I looked into Owntracks for presence detection but so far NMAP + Bluetooth detection is working great.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
My condo is 95% smart now - most bulbs and switches are WiFI although there are couple of light switches that don't have neutral wires and the lights themselves use odd bulbs that don't come in WiFi. Got an August smart door lock for Christmas.
I'm running Homeassistant with HADashboard as the front end on a Nexus 7 tablet.

My biggest accomplishment to date was writing automations that will turn off the Wyze camera (connected to a TP Link wifi plug) when we get home and vice versa. I looked into Owntracks for presence detection but so far NMAP + Bluetooth detection is working great.

Yeah I've been working on the UI now that I've got all the automations moved out of smartthings.

I've also moved all the zwave things out of smartthings and they are not connected directly to HA. I had them coming through the MQTT bridge for a little while but it was causing issues when my kids were supposed to be sleeping and it would just keep turning the lights on. My 7yr old and my wife were not happy about that.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
So onto the UI aspect Here is the UI for my first floor
Code:
---
id: First Floor
title: First Floor
icon: mdi:sofa
cards:
  - type: vertical-stack
    cards:
      - type: entities
        title: Lights
        entities:
          - type: custom:slider-entity-row
            entity: light.living_room
            toggle: true
  - type: vertical-stack
    cards:
      - type: entities
        title: Media
        entities:
          - type: custom:mini-media-player
            entity: media_player.living_room_tv
            show_tts: false
            show_source: true
            show_progress: false
            hide_controls: false
            power_color: true
            more_info: false
            volume_stateless: true
          - type: custom:mini-media-player
            entity: media_player.livingroom_sonos
            show_tts: true
            show_source: true
            show_progress: false
            hide_controls: false
            power_color: true
            more_info: false
            volume_stateless: true

and this is what it looks like
QLQJ8Xk.jpg


Little too simplified for how I want it to be but it works for now.
 

MarkLT1

Ars Tribunus Militum
1,602
Subscriptor
HA is great. For quite a while I was using openHAB, but it is all written in Java, and me and Java.. well we dont get along. I've been programming in Python for over a decade, and when I discovered a python based home automation package, I was thrilled.

We have all of our lights (a mix of Insteon switches, Philips HUE bulbs, some Z-Wave stuff, and a custom bridge using an ESP32 to some MiLight stuff), our home theater (I had to write a module to integrate my projector's serial communication with HA, and our Denon receiver was already supported), Nest thermostat, and some custom blind motors. It is all running from a raspberry pi that lives in a server closet. I really need to dive back into it and see what is new (haven't messed with it for a year now).
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
HA is great. For quite a while I was using openHAB, but it is all written in Java, and me and Java.. well we dont get along. I've been programming in Python for over a decade, and when I discovered a python based home automation package, I was thrilled.

We have all of our lights (a mix of Insteon switches, Philips HUE bulbs, some Z-Wave stuff, and a custom bridge using an ESP32 to some MiLight stuff), our home theater (I had to write a module to integrate my projector's serial communication with HA, and our Denon receiver was already supported), Nest thermostat, and some custom blind motors. It is all running from a raspberry pi that lives in a server closet. I really need to dive back into it and see what is new (haven't messed with it for a year now).

Quite a bit new. They just released a new version today (or last night) they are on a 2 week update cycle so new things are always being added.

In my own house I finally got around to adding an extra wire to my thermostat and installing the zwave one that I bought so I can now control my thermostat automatically and have some simple automations to set the heat/AC (they are separate entities in HA) based on time of day/occupancy/season (winter for heat, summer for AC). I might try my hand at writing some more complex ones that take into account the external temperature since I had been dropping the heat to 50F at night (11pm-5:30am) but the wife complained the house was too cold at night when it was 4F outside at night.

I'm still on the search for some time to get a mysensors gateway up and running so I can add even more sensors to my house and then I'm thinking of getting some sonoff/shelly 1 wifi relays to connect to the rest of my dumb switches since I don't need dimming everywhere.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
Minor update.

So the wemo switches had been pissing me off recently and I got these (3 pack not 4 but same plugs) for christmas but they phone home to china all the time (someone claimed every 10 secs) but thankfully they just use a ESP8266 so they can be flashed to internal only.

It seems that Tuya has a site where you can design the switches/plugs and then sell them so there are lots of devices that work with this flash.

So I just flashed 3 of them and have replaced the 2 wemos that were in use (the 3rd was for a xmas tree). So now that they have been flashed they talk over MQTT to HA and work flawlessly (it was a 50/50 if the Wemo showed up).

Github to the flashing code Then just need a linux device with wifi and a second network connection (I used a raspberry pi 3), another device with wifi, and the plug.



The only thing I had to do after flashing was track down what the wiring is inside the plug (google for the plug and tasmota it was on the first page.) and then I had to flash the sonoff firmware since the OTA flasher flashes the sonoff_basic which doesn't suppport MQTT Discovery and I was feeling lazy :)

I really wish I had a use case for more plugs because they are so cheap. In theory the same firmware / flashing tool should work on light switches but I haven't gone and tracked those down yet.

I found this whole thing when this video showed up in my feed and I already had the plugs.
 

Captain Riker

Ars Praefectus
5,805
Subscriptor
I’m boring and just use SmartThings (ST) to connect Z-wave and Zigbee devices. I favor switches over bulbs to keep the family happy. Accent lights and bulbs are Hue based, which ties into ST as does my Nest, Sonos, and Echos. The Samsung smart buttons make lamps with bulbs easier to control rather than relying on a smartphone or voice control. We also have a few Sylvania outdoor lights that work really well with the system.

We’ve gotten some good use out of water sensors in our sump and under a few sinks and I currently have my garage doors tied into the system with contact/motion sensors so I can see if they’re open or not.

I know cloud services are not preferred over local control, but I didn’t want the system to rely on me or any shared hardware. I might change in the future as I play with Raspberry PI but for now we’re pretty happy with the system.
 

w00key

Ars Praefectus
5,909
Subscriptor
Oranging.

My first purchase of smart whatever are 6 Ikea Trådfri GU10 bulbs for outside - 4 in the garden, 2 in the front, as I wanted them to be programmable to run between 6pm and midnight.

At €7 a piece, it beats buying 3 or 4 z-wave dimmers or relays. These are even RA>90, light from it is way nicer than the old pinkish tinted ones they sold before.

So far so good, the app is limited, no scheduled dimming, but once I have some spare time I'll install HA, have it talk to the Trädfri hub and control it from there.


Pro: value for money, bulbs and relays are super cheap.
Con: hub doesn't accept other devices like a Jung zigbee dimmer. Workaround is to use the Hue bridge.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
I’m boring and just use SmartThings (ST) to connect Z-wave and Zigbee devices. I favor switches over bulbs to keep the family happy. Accent lights and bulbs are Hue based, which ties into ST as does my Nest, Sonos, and Echos. The Samsung smart buttons make lamps with bulbs easier to control rather than relying on a smartphone or voice control. We also have a few Sylvania outdoor lights that work really well with the system.

We’ve gotten some good use out of water sensors in our sump and under a few sinks and I currently have my garage doors tied into the system with contact/motion sensors so I can see if they’re open or not.

I know cloud services are not preferred over local control, but I didn’t want the system to rely on me or any shared hardware. I might change in the future as I play with Raspberry PI but for now we’re pretty happy with the system.

So the thing that pushed me away from Smartthings and cloud based control was a string of ST outages and of course it happened after finally training the wife that the living room lights would just come on when you walked in the room (motion sensors controlling smart bulbs) and then complaining to me that its not working.

As it stands now that I've moved (almost) everything to run on HA locally (I have 2 motion sensors still on smartthings cause they aren't supported yet) if something isn't working it is something I'm responsible for and could go fix. So far the only times the lights haven't worked either we didn't have power to the house (or had lost power and my server hadn't restarted) or I was activatilly adding more features to HA (changing things requires a restart for lots of things so if the timing just right it can cause automations to not work)
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
So new updates.

Got TTS working with my sonos had to play around with the settings on my nginx proxy and change the ssl_ecdh_curve because it seems sonos doesn't support the most secure possible one.

Found a nice script that saves the state of the sonos, unjoins it from any group it happens to be in (I don't really group mine since they are on different floors), plays the messages (calculates the length of the message), and then restores the state from before. So I've now gone and updated a few automations that had been using pushbullet to notify me (mostly door open for too long) to also announce to the living room speaker. I'm also working on getting it to read out the weather for the day so I can have it tell me what to expect in the morning.

I've also find Picroft and ordered the USB mic needed to play around with that. Not sure if I'll end up building or even keeping it around but seems like a fun project to play with.
 

swipes

Seniorius Lurkius
5
So new updates.

Got TTS working with my sonos had to play around with the settings on my nginx proxy and change the ssl_ecdh_curve because it seems sonos doesn't support the most secure possible one.

Found a nice script that saves the state of the sonos, unjoins it from any group it happens to be in (I don't really group mine since they are on different floors), plays the messages (calculates the length of the message), and then restores the state from before. So I've now gone and updated a few automations that had been using pushbullet to notify me (mostly door open for too long) to also announce to the living room speaker. I'm also working on getting it to read out the weather for the day so I can have it tell me what to expect in the morning.

I've also find Picroft and ordered the USB mic needed to play around with that. Not sure if I'll end up building or even keeping it around but seems like a fun project to play with.

As if this whole topic didn't grab my attention, this post definitely did. Interested to see how you get this integrated.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
Just want to see if I'm following this correctly this basically allows you to interrupt whatever Sonos is playing, play the message and then go back to what it is doing? Kinda like how the GPS direction will do when I'm listening to music? That is really nice. Can't wait for my home to be finished.

Yes I did notice that when listening to pandora (what I was testing with) that the song will change but I think that is more of an issue with the fact you're playing the pandora station and not any specific song
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
So new updates.

Got TTS working with my sonos had to play around with the settings on my nginx proxy and change the ssl_ecdh_curve because it seems sonos doesn't support the most secure possible one.

Found a nice script that saves the state of the sonos, unjoins it from any group it happens to be in (I don't really group mine since they are on different floors), plays the messages (calculates the length of the message), and then restores the state from before. So I've now gone and updated a few automations that had been using pushbullet to notify me (mostly door open for too long) to also announce to the living room speaker. I'm also working on getting it to read out the weather for the day so I can have it tell me what to expect in the morning.

I've also find Picroft and ordered the USB mic needed to play around with that. Not sure if I'll end up building or even keeping it around but seems like a fun project to play with.

As if this whole topic didn't grab my attention, this post definitely did. Interested to see how you get this integrated.

I'll be sure to post once I get something working. Was an easy choice for me to play around with at least since it only required a 7$ USB mic (PS3eye) since I already had a pi and speakers (which I need to find but worst case I can play around with headphones)
 

swipes

Seniorius Lurkius
5
So new updates.

Got TTS working with my sonos had to play around with the settings on my nginx proxy and change the ssl_ecdh_curve because it seems sonos doesn't support the most secure possible one.

Found a nice script that saves the state of the sonos, unjoins it from any group it happens to be in (I don't really group mine since they are on different floors), plays the messages (calculates the length of the message), and then restores the state from before. So I've now gone and updated a few automations that had been using pushbullet to notify me (mostly door open for too long) to also announce to the living room speaker. I'm also working on getting it to read out the weather for the day so I can have it tell me what to expect in the morning.

I've also find Picroft and ordered the USB mic needed to play around with that. Not sure if I'll end up building or even keeping it around but seems like a fun project to play with.

As if this whole topic didn't grab my attention, this post definitely did. Interested to see how you get this integrated.

I'll be sure to post once I get something working. Was an easy choice for me to play around with at least since it only required a 7$ USB mic (PS3eye) since I already had a pi and speakers (which I need to find but worst case I can play around with headphones)

Good stuff. I have a lot of Sonos zones (Sonos 1, 3, 5, Amps etc...) throughout the main living areas of my house. I've been meaning to try something like this for years but never really drummed up the courage to jump in. I was pretty close when I saw https://jasperproject.github.io/ but, as the saying goes, life got in the way.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
More updates.

So I recently started running a minecraft server for some friends however they keep crashing it, it is heavily modded. Since I'm running it in a docker I was able to installed HA-Dockermon which exposes the status of my dockers to a rest API that I'm then able to use in Home assistant. So now all of my dockers are switches in HA and I can stop/start them from the UI and automation. So I was able to write a simple automation that restarts some dockers if they are off for more than 5 mins. Most of my dockers are fairly stable so I don't feel I'll actually need to keep track of most of them and they tend to only stop working if I lose power/internet (Or I'm breaking something)

I finished writing automation for a bunch of TTS things with my doors (when they are open for more than 5 mins it yells at you to close them), and then have one that will tell me the weather but still need to figure out the best way to trigger that so it doesn't upset the wife (she can sleep in more than I can).

I was finally able to play with picroft and set up was simple enough (after determining the microsd card I was trying to use was corrupt but I had another one that worked fine) I am currently having issues getting it to work with Home Assistant (I had it working once but then it stopped). It seems to not want to save the ip address of HA (and the docs aren't that good on if it should be my external address or my internal one). I still haven't found my small speakers (I may have got rid of them in a cleaning purge) but I've been testing with headphones for right now. Not sure if I'm going to keep picroft around honestly. The cost of making one is about the same (if not slightly more) than the cost of an amazon echo/google home mini so while its a cool concept and if I wanted to 100% remove every cloud device I'd be all over it. Still I'll probably keep playing with it for a little while longer since I have all the parts already.
 

Morrie20

Ars Tribunus Militum
1,774
I started to think about a Smartthings + Arlo Pro cam setup for security and home automation, but was enticed to the darkside from the OP over in Agora.

I'm going to post my plan and want you guys to share your experiencesor suggestions

replacing ArloPro+3 cams + Smartthings hub $458 + all kinds of sensors - probably $800-$1500 + Im constrained in ways i wouldn't be if i did below

Replacement with Homeassist + either Zoneminder/BlueIris
I'm thinking of running all of this on a dual purpose DVR/Home storage/media center system 8gb ram and an i3 processor with 4-8TB HD + TPLink AV600 power adapters to lighten the load on my Wifi


Attach a GoControl CECOMINOD016164 HUSBZB-1 USB Hub so I have all the Zigbee/Zwave that i need - this system will go on my top floor to get the zwave/zigbee mesh away from my wifi router on my bottom floor.

Echo show for my wife in the kitchen <<<< I like the 10.1 inch screen, but I feel like I can probably build something for less than 230 and get all of the same functionality, potentially even alexa through an andriod emulator or something. I want to be able to see the security cams on this device in the kitchen.

Security Cams - I'm seeing a lot of recommendations for foscam, wyze, or amcrest depending on the application. I want atleast 2-3 outdoor cams that can handle nightvision. PTZ isn't a must. I just want crisp pictures available and to be able to remote in, so if I need motion sensors versus relying on the motion inherent to the outdoor camera, I'm open to your guys' suggestions. If I can trigger notifications that someone is in a zone so I can see it on either my kitchen display or wireless phones, that's all i care.

Smart lock - This is less necessary but a nice have. Schlage seems to be the go-to here, but i'm open to your guys suggestions for a main door smart lock

Mesh of smart bulbs and switches. I'll get this setup regardless. I'm going to need to run a driveway gate so probably the best thing to utilize with that is zwave.

Chicken coop automation - this is phase 4 but I'd like to be able to ensure my chickens get the protection/food/water they need if we want to travel

Driveway gate. Mighty mule powered... this is last phase but I'd like to intercom and camera this driveway gate.
 

S2pidiT

Ars Scholae Palatinae
1,444
Oranging!

I have a high interest in doing some home automation... I've got Home Assistant installed on my Raspberry Pi 2 B+ with a Z-Wave controller. I bought a smart outlet switch and a door/window sensor to try it out. I'm trying to keep everything local; this is partly lack of trust in third parties and partly the engineer in me. :D

I'll be watching this thread with interest, and I'll likely ask questions as I start to work more on my system.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
So I'm at the point where I'm just giving up on zigbee and looking for deals to replace all my zigbee devices. I had been having an issue where when HA was updated it would lose my zigbee bulbs but I got that fixed.

Now they are just dropping off randomly and not repairing at all. Thankfully I only have 4 bulbs (2 in my closet and 2 outside) but I now have price alerts on some wifi bulbs that can be flashed to local control only because this is bothering me this much. (And of course I get to here from the Wife about how "My dumb lights don't work" right after I finally got her used to the lights in the closet turning on/off by themselves. The 2 wifi bulbs that I've flashed (and the switches) have been rock solid with the only annoyance (and I could probably script it) is if my entire server goes down the states (and discovery) get lost due to the MQTT being down. But that takes all of 5 seconds to fix and they go back to working like flawlessly.

Honestly the reliability of the wifi things I have is making me rethink using them over Z-wave devices (which have also been rock solid but cost more)

Beyond troubleshooting this zigbee issue I haven't done much with my HA system since we are in the get the house ready to sell phase so I don't want to be putting new switches in the walls.
 

w00key

Ars Praefectus
5,909
Subscriptor
Hmm, quality really fluctuate between makes and models on zigbee. The IKEA bulbs were a PITA to pair due to like ~5cm range, you need to press them on the hub, and even after that, hop limits of ~10m line of sight. Philips ones are said to be much better, but they are like 3x the price... Home automation is still very wild west...

But once the IKEA stuff work, they work well. I never had any issues running my timers to turn all the garden light on and off in months.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
Hmm, quality really fluctuate between makes and models on zigbee. The IKEA bulbs were a PITA to pair due to like ~5cm range, you need to press them on the hub, and even after that, hop limits of ~10m line of sight. Philips ones are said to be much better, but they are like 3x the price... Home automation is still very wild west...

But once the IKEA stuff work, they work well. I never had any issues running my timers to turn all the garden light on and off in months.

Yeah Zigbee is an open "Standard" so each manufacturer makes them slightly differently.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
Minor update.

So the wemo switches had been pissing me off recently and I got these (3 pack not 4 but same plugs) for christmas but they phone home to china all the time (someone claimed every 10 secs) but thankfully they just use a ESP8266 so they can be flashed to internal only.

It seems that Tuya has a site where you can design the switches/plugs and then sell them so there are lots of devices that work with this flash.

So I just flashed 3 of them and have replaced the 2 wemos that were in use (the 3rd was for a xmas tree). So now that they have been flashed they talk over MQTT to HA and work flawlessly (it was a 50/50 if the Wemo showed up).

Github to the flashing code Then just need a linux device with wifi and a second network connection (I used a raspberry pi 3), another device with wifi, and the plug.

The only thing I had to do after flashing was track down what the wiring is inside the plug (google for the plug and tasmota it was on the first page.) and then I had to flash the sonoff firmware since the OTA flasher flashes the sonoff_basic which doesn't suppport MQTT Discovery and I was feeling lazy :)

I really wish I had a use case for more plugs because they are so cheap. In theory the same firmware / flashing tool should work on light switches but I haven't gone and tracked those down yet.

I found this whole thing when this video showed up in my feed and I already had the plugs.




So minor non-update. Had need for more smart plugs and bought some more of these and it seems they have updated the stock firmware so you can no longer use the OTA flash as of right now.

So now I have 4 smart plugs I don't really want since they require connecting to some chinese companies cloud.

So if you were planning on going that route I'd double check before buying.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
So finally found time to make some things and found a ~11$ camera online and cameras are useful for home automation things.

images spoilered for hugeness
Please ignore my cluttered desk and shitty solder joints it's been awhile
file.php

file.php

file.php

file.php

It is an ESP32 board that I got off amazon (2 pack for 22$) It is pretty plug in play (there are examples on the esphome site for all the types of ESP32Cams out there). I soldered on a usb plug to power it and stuck it in a project box that I had with some sugru to hold it in place. I did have to buy an FTDI adapter to flash it since it doesn't have USB built in but it is useful for other things.

Anyways the actual code is espHome which lets you create it via a yaml file and it creates all the actual code for you. I have the docker image running which lets me easily get logs and do OTA updates to it.

From the HA side of things, esphome hooks into Home Assistant via an API (that was created just for that) so it pulls in all the abilities of the unit (camera/flash/status led in this instance (through the flash/status aren't useable in the box)). I then just put a picture card on one of my lovelace interfaces and it just works.

I might play with the code on the camera a bit more since others have reported it has issues overheating but I haven't run into that yet.

I have another camera to build still and then 2 more modules I'm planning on setting up as sensors (need a new freezer temp sensor) so I'll hopefully find time to make that sooner rather than later.
 

jgtg32a

Ars Tribunus Militum
2,950
So I'm on version 2.0 of my build, got away from a RPi and nuked my Win10 "server" and am having fun with that.

I don't really have it doing anything useful so far mainly just have a lot of things visible, no real automation. I've got my garage door (MyQ), 3 wayze cameras, contact sensors on all doors and windows on the first floor, 2x motion sensors, a random light switch, and an Ecobee. I also have 2 wyze plugs but they do not appear to be supported by Hassio yet.

The only automation I have is the light switch controls the back patio light and that light kicks on an hour after sunset and turns off 2 hours before sunrise.

We have a fire hazard mini-kitchen it's a fuckin fire hazard in the garage (but the other option is to fry fish in the house) and a lot of people hang out in the garage (smoke) during get-togethers. So the next automation I'm working on is to close the garage. The logic I'm trying to implement is garage is open for 5 minutes then I check motion sensor (wyze) and it makes sure there hasn't been movement for 5 minutes then it closes the garage.

I will say that the Wyze sensors are fantastic and can be made to be 100% local and they respond fast. The cameras less so, although I have heard people mention that some of the delay is actually hassio and not so much the cameras.


Oh on another note some of the older ecobee (3) don't push the full 24 volts on the W1 heating wire, mine only pushes 15 which isn't enough to pull the system online. I'm using a work around and telling the system I have a two stage system, it works well enough. They're supposed to send me a coupon and I'll see how we're looking at black Friday.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
Fun fact I just had brought to my attention because of my smart home. Astronomical winter doesn't start for another month and according to my wife that is too damn long to wait for the heat to turn on.

So I've gone and rewritten my thermostat automations to trigger off the expected high/low temp (AC/Heat) instead of the season. After rewriting them I posted on the HA forums about a better way to handle the set points (both when to turn on and what to turn it to) so might rewrite them all over again to make use of the suggestions I got but right now I have 10 different automations (5AC/5Heat) and I think I'll be able to consolidate that down at least a little bit.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
Wait - you had your heat based on the SEASON and not the outside temp?

I'm intrigued but simply cannot comprehend that - it's already hit NEGATIVE ZERO here.

For some reason in my head "winter" started next week and not in ~5 weeks. And we have good insulation and blankets and normally don't turn the heat on till after Thanksgiving anyways (it's a NE thing) but we have got a massive cold front recently that has dropped the temps in the house too low for the wife.

And when I wrote the automations it was like 70 daily so heat wasn't that high on my list.

Now have it set to turn the heat on when it is expected to have a low below 50 and the ac comes on when the high is expected to be above 85, which I wouldn't be too surprised to have them both trigger on the same day at some point in the future (NE weather 🤣)
 

jsfetzik

Ars Tribunus Militum
2,605
Subscriptor++
I am just getting started with some home automation stuff. I am starting out with some wifi/mqtt devices such as Sonoff Mini, Shelly 1, and Wemos D1's controlling some outdoor LEDs. In playing with this stuff I realized the same control stuff could solve an annoying problem I have elsewhere in the house.

We have a room that was added on to the house three owners ago that has three doorways into the room. When they added this room they were cheap and only put a light switch next to one of the doors. It would of course be very useful to have switches by the other two doors. Obviously this can be taken care of by home automation.

So my question is does anyone have any recommendations for remote, wireless switches to use for this? Ideally they would be wifi, because I can then easily control this room lighting with something like Home Assistant.
 

ChaoticUnreal

Ars Tribunus Angusticlavius
7,409
Subscriptor++
I am just getting started with some home automation stuff. I am starting out with some wifi/mqtt devices such as Sonoff Mini, Shelly 1, and Wemos D1's controlling some outdoor LEDs. In playing with this stuff I realized the same control stuff could solve an annoying problem I have elsewhere in the house.

We have a room that was added on to the house three owners ago that has three doorways into the room. When they added this room they were cheap and only put a light switch next to one of the doors. It would of course be very useful to have switches by the other two doors. Obviously this can be taken care of by home automation.

So my question is does anyone have any recommendations for remote, wireless switches to use for this? Ideally they would be wifi, because I can then easily control this room lighting with something like Home Assistant.


Honestly I'd ignore the switch (or put in a smart one) and motion sensor so the light comes on when you enter