Advertisement
Guest User

Untitled

a guest
Feb 15th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs
  2. you may have to re-install the npm package (smartthings-mqtt-bridge), but aside from that, you shouldn't have to reconfigure it.
  3.  
  4. pm2 script wizard??: https://github.com/dale3h/hassctl Install this
  5. Then run hassctl log -f
  6. this is the new config yaml file: http://pastebin.com/yrVWv9tH
  7. Create another file in the same directory as configuration.yaml, and name it secrets.yaml, and then put this in there (with your own info, of course):
  8. home_latitude: 26.1722
  9. home_longitude: -97.9812
  10.  
  11. mqtt_broker: 'localhost'
  12. mqtt_port: 1883
  13. mqtt_username: 'your_username'
  14. mqtt_password: 'your_password'
  15.  
  16. in your config yaml make sure to have:
  17. mqtt:
  18. broker: !secret mqtt_broker
  19. port: !secret mqtt_port
  20. client_id: home-assistant-1
  21. username: !secret mqtt_username
  22. password: !secret mqtt_password
  23.  
  24. check if bridge runs: pm2 list
  25.  
  26. After you reboot, go to the directory where you have your settings for the smartthings-mqtt-bridge stored, and run:
  27. pm2 start smartthings-mqtt-bridge
  28. pm2 save
  29.  
  30. if you dont have an mqtt bridge directory create it:
  31. mkdir ~/.mqtt-bridge
  32. cd ~/.mqtt-bridge
  33. nano config.yml
  34.  
  35. enter the following into the config.yml file in the bridge directory (keep as localhost in my case. make sure localhost is kept in both homeassistant and mqtt files):
  36. mqtt:
  37. host: mqtt://localhost
  38. preface: smartthings
  39. username: your_mqtt_username
  40. password: your_mqtt_password
  41.  
  42. port: 8080
  43.  
  44. in my case i was told to check pm2 logs, then pm2 list, then:
  45. cd ~/.mqtt-bridge
  46. ls -al (to look at the outputs)
  47.  
  48. on my end it didnt look well so i ran:
  49. pm2 stop smartthings-mqtt-bridge
  50. make sure its stopped: pm2 list
  51. then i had to: pm2 delete smartthings-mqtt-bridge
  52.  
  53. next i: sudo chown pi:pi config.yml
  54. then: And then, make sure you stay in that directory (~/.mqtt-bridge) and run: pm2 start smartthings-mqtt-bridge && pm2 logs smartthings-mqtt-bridge
  55.  
  56. Result: success! working
  57. In my case nodejs was a process found using htop or top that as using 100% CPU. 10 minutes and Pi would crashed.
  58. Solution: sudo apt-get purge nodejs
  59. sudo apt-get install nodejs
  60.  
  61. result: Success! nodejs is no longer running 100% CPU
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement