Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting this working as a addon for the new hassio homeassistant #83

Open
CTLS opened this issue May 14, 2017 · 16 comments
Open

Getting this working as a addon for the new hassio homeassistant #83

CTLS opened this issue May 14, 2017 · 16 comments

Comments

@CTLS
Copy link

CTLS commented May 14, 2017

I think once hass.io becomes more finalized, this will make setup of smartthings-mqtt-bridge on home assistant a lot easier. Hassio runs all addons in docker files and allows setup of the addons through the frontend.
There is some more info on how to set up hassio addons at- https://home-assistant.io/hassio/addon_config/

@rogersmj
Copy link

100% agree! I just started playing with Hass.io and I love it, everything's so plug and play...but I can't use it yet because I completely depend on this great SmartThings MQTT bridge.

I have pretty much zero experience with docker, but if no one tackles this in the next few weeks I may try to make some time to hack away at it.

@rogersmj
Copy link

@AJax2012
Copy link

AJax2012 commented Sep 4, 2017

@rogersmj have you gotten this working? I'm working with it and can't figure out how to connect it to SmartThings API...

@mth3r
Copy link

mth3r commented Sep 28, 2017

I'm looking for help too. Just a description of what each configuration item is would be helpful...something to the effect that the MQTT host Ip is the raspberrypi ip. I think it is pretty simple, but I'm obviously missing something

@Darksabre
Copy link

Definitely would like to get this working. I tried pasting the repo link into HASSIO, but it doesnt seem to do anything. Any help would be great!

@jamescw
Copy link

jamescw commented Oct 13, 2017

I got this working and it's a great solution for running the whole stack on an Rpi 3!

Firstly the addon linked above was missing a small piece of config that allows the addon to expose the port of the smartthings-bridge server. I created a small patch and submitted to the authors repo, hopefully that will get merged soon: vkorn/hassio-addons#12

Then I used the following steps:

  1. I installed the hass.io Mosquitto broker addon with all the default settings.
  2. Installed the SmartThings addon with all the default settings but set the username and password fields to empty strings as the default config for the Mosquitto broker does not set these.
  3. Then followed all the steps here to connect SmartThings to Hass.io: https://github.com/stjohnjohnson/smartthings-mqtt-bridge#usage

Add the following config to Hass:

mqtt:
  broker: localhost
  port: 1883
  client_id: hassio
  keepalive: 60

Then define a light or sensor etc:

light:
  platform: mqtt
  name: "Lamp"
  state_topic: "smartthings/Lamp/switch/state"
  command_topic: "smartthings/Lamp/switch/cmd"
  payload_on: "on"
  payload_off: "off"

sensor:
  - platform: mqtt
    state_topic: "smartthings/Motion Sensor/temperature/state"

@tielur
Copy link

tielur commented Oct 20, 2017

@jamescw You said you used all the default settings when setting up the SmartThings addon, it looks like it defaults to: "broker_host": "172.17.0.1". I assume you changed that to 127.0.0.1?

I'm having trouble getting this working following your directions.

Also is there an easy way to see messages in the queue to confirm something is working?

My Mosquitto broker logs are showing:

1508485059: New connection from 192.168.86.41 on port 1883.
1508485059: Socket error on client <unknown>, disconnecting.

Where 192.168.86.41 is my SmartThings hub

@jamescw
Copy link

jamescw commented Oct 20, 2017

@tielur no you don't want to change the broker host IP in the smart things bridge config.

172.17.0.1 is a special IP address that allows you to communicate with the docker daemon and another container running on same docker host, so assuming you have the Mosquitto container running on the same host (which it should if you are using the add-on), it should be able to connect to it at 172.17.0.1:1883 from the smartthings bridge container.

If you want to connect to the broker from another machine use something like MQTT.fx and use the IP or hostname of your RPi and the MQTT port to connect: hassio.local:1883

If all is well you should see messages from smartthings on the broker

@tielur
Copy link

tielur commented Oct 20, 2017

@jamescw awww that address makes more sense now, I switched that back and it looks like it's working now. Thanks!

@jaxbucsfan
Copy link

Thank you guys for this full write up. I think I'm missing something, and i'm sure it something small at this point.

Any help or insight would be much appreciated. Clearly a Noob to Hass.io

On Hass I have two Add-Ons
Mosquitto broker - Default Options
SmartThingsBridge - Default Options (minus empty UN/PW)
{
"broker_host": "172.17.0.1",
"broker_port": 8888,
"preface": "smartthings",
"state_suffix": "state",
"command_suffix": "cmd",
"login": "",
"password": "",
"bridge_port": 2080
}

In ST my device preferences are:
MQTT Bridge IP Address: "local IP Address of Rpi" or <172.17.0.1> ???
Bridge Port: <2080> to match SmartThingsBridge info ???
MAC:

My configuration.yaml contains:
mqtt:
broker: localhost
port: 1883
client_id: hassio
keepalive: 60

My Log File outputs are as follows:
Mosquito Broker:
1511909661: New connection from 172.30.32.1 on port 1883.
1511909661: New client connected from 172.30.32.1 as hassio (c1, k60)

SmartThingsBridge:
info: Connecting to MQTT at mqtt://172.17.0.1:8888

@cmlittle
Copy link

cmlittle commented Dec 1, 2017

@jaxbucsfan Try changing broker host to "localhost", your broker port to "1883" and your bridge port to "8080" in the smartthings-mqtt-bridge add-on.

@cmlittle
Copy link

cmlittle commented Dec 1, 2017

I was able to get the the bridge working in hass.io - all switches seem to work, however, I can't get any of my temperature sensors to display correctly. A typical temperature sensor in my configuration looks like this:

  • platform: mqtt
    state_topic: "smartthings/Garage Motion/temperature"
    name: "Garage Temp"
    unit_of_measurement: "°F"

I removed "state" and "cmd" from the bridge configuration, so I don't think that I need to add this at the end of "temperature" (i.e. smartthings/Garage Motion/Temperature/State). The above configuration worked just fine in my standard HomeAssistant installation, but they're not showing up now. Should "temperature" now be something else? I am able to see a power sensor, but none of my temperature or battery sensors. Anyone have any ideas?

@partytimeexcellent
Copy link

@cmlittle Did you ever get your ST sensors working? I'm noticing the same behavior.

@vaderj
Copy link

vaderj commented May 15, 2018

Did anyone ever get this working?

@tielur
Copy link

tielur commented May 15, 2018

@vaderj I've been using it for months

@vaderj
Copy link

vaderj commented May 16, 2018

I just got it working. The value_templates was the last piece that I was missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests