Categories
Home Assistant Home Automation Z Wave

UPDATE!! Home Assistant: Open Z Wave Add-in 0.5.0 not working

So I just ran into this issue with my Home Assistant Setup. I logged in for the first time in about a week and found that I had an update available for the Open Z Wave Add-On. Oddly enough the check box that says Auto Update does nothing.

Anyway so I updated thinking everything would be okay….. WRONG!!!

After doing the upgrade and rebooting the appliance the Open Z Wave admin console would fail to load and the service would not start. I tried several times as that is normally what I have to do. Which by the way the the start on boot up also never works.

I checked the Home Assistant forums and found this thread. It turns out that the the issue is actually with MQTT. Apparently MQTT is presenting an invalid response which is causing Open Z Wave to barf. One of the options listed was to use an MQTT Browser to delete the entry and that has worked for some people to varying levels of success.

It did not work for me, but here is what I did:

  • Back up your configurations before you do any of this.
  • Step 1: Uninstall Open Z Wave from Supervisor > Add-ons
  • Step 2: Uninstall MQTT
  • Step 3: Reboot Home Assistant hardware
  • Step 4: Install MQTT again and make sure it is configured and then Start the services.
  • Step 5: Install Open Z Wave and make sure it is pointing to the correct ZWave Antenna and start service.

I then checked the Z Wave log to make sure the error was gone (and it was!!)

UPDATE!! Within about an hour of making this post I discovered that my whole Zwave setup was not working and the service eventually crashed. This morning I ended up doing a fresh install and I was able to pull down OpenZwave 0.5.1 and that seems to be working. I will update once I have more information.

I hope you found this post helpful, and if so please share with your friends.

Smartthings to Home Assistant using MQTT

I have been away for a while, but in my absence I have been playing with a Home Automation System called Home Assistant. You can find out more about it here on their website: https://home-assistant.io/ 

One of my Father’s Day Gifts from my Wife and Kids was a SmarThing Hub with a Arrival sensor. Now Home Assistant has literally hundreds of pre-built integrations however SmartThings is not one of them. To make it work with Home Assistant you will have to use a protocol called MQTT which is very versatile and can be used to create your own Automations.  (Find out more about it here.)

Now my Home Assistant instance is running on a Rasberry Pi 3 (also a Father’s Day Gift) however it also runs on a Raspberry Pi 2. I am also running HASSbain which is a Raspian image created by Home Assistant. As for MQTT there are a few products out there that you can use, I prefer Mosquitto as there seems to be more guides out there on how to configure and manage it.

Start off by checking for and installing updates for Raspian:

sudo apt-get update

sudo apt-get upgrade

this could take a while depending on your setup.

Next you will need to setup the smarthings-mqtt-bridge via npm
sudo apt-get install npm

sudo npm install -g smartthings-mqtt-bridge

Then you will need to setup pm2 to run the processes
sudo npm install pm2 -g

Once installed you will need to create and edit smartthings-mqtt-bridge config
sudo cp /usr/local/lib/node_modules/smartthings-mqtt-bridge/_config.yml ~/config.yml

sudo nano ~/config.yml
Here is what the mqtt-bridge-configuration ~/config.yml file should look like if all is configured correctly.
mqtt:
  # Specify your MQTT Broker’s hostname or IP address here
  host: mqtt://localhost
  # Preface for the topics $PREFACE/$DEVICE_NAME/$PROPERTY
  preface: smartthings

  # Suffix for the state topics $PREFACE/$DEVICE_NAME/$PROPERTY/$STATE_SUFFIX
  # state_suffix: state
  # Suffix for the command topics $PREFACE/$DEVICE_NAME/$PROPERTY/$COMMAND_SUFFIX
  # command_suffix: cmd

  # Other optional settings from https://www.npmjs.com/package/mqtt#mqttclientstreambuilder-options
  username: pi
  password: mqttpass

  # Port number to listen on
  port: 8080

Now that all of the local configurations have been completed you need to configure the SmartThings Device handler, Device, and SmartApp using steps outlined in https://github.com/stjohnjohnson/smartthings-mqtt-bridge150

Device Settings
IP: raspberry pi IP
MAC: Raspberry pi MAC
Port: 8080

Next you will need to add mqtt to HomeAssistant config configuration.yaml
mqtt:
  broker: localhost
  port: 1883
  client_id: home-assistant-1
  username: pi
  password: mqttpass

Now you will need to add your devices to their own file, or configuration.yaml
Since I am using mine for presence detection mine looks something like this

device_tracker:
  – platform: mqtt
    name: “MQTT Presense Detection”
    devices: 
      Friendly Name: smartthings/device name/presence
      Friendly Name1: smartthings/device name/presence
     
Now you will need to start the bridge

sudo ln -s “$(which nodejs)” /usr/local/bin/node
pm2 restart smartthings-mqtt-bridge

restart Home Assistant
sudo systemctl restart home-assistant.service

That should do it. You may want to sudo reboot

In the future I may do more of these as I have learned at lot from it, including beginning to dabble with Docker.