Giter VIP home page Giter VIP logo

homie-server's Introduction

Homie server

warning Currently unmaintained. Don't expect updates or support ATM, I prefer to focus on homie-esp8266. Note this project is not abandoned, only on hold.

npm version Travis CI Coveralls (broken) Dependency Status devDependency Status Built with love

A Web server for Homie, an MQTT convention for the IoT. Built with Node.js. The project is currently in alpha.

Homie server screenshot

Features

  • Simple but efficient dashboard
  • OTA updates
  • Compatible starting with Node.js v0.12 (0.10 might work, but it is not CI-tested)

Installation

npm install -g homie-server

Usage

The Homie server can only be started using the CLI interface. Start Homie by calling homie. You can optionally provide a --dataDir argument that will be used to store the Homie data. By default, this directory is located at <home directory>/.homie. You can also configure the HTTP server serving the UI with --uiPort, else it defaults to 80. Finally, you can change the log level of the output with the --logLevel parameter followed by the minimum log level to show (0 for fatal, 1 for error, 2 for warning, 3 for info, 4 for debug).

Configuration

Three files define the behavior of Homie, and are all contained in the data directory:

  1. The config.yml file. It contains some configuration like your MQTT broker address.
mqtt:
  url: mqtt://127.0.0.1:1883
  clientId: optional client ID
  username: optional username
  password: optional password
  1. The infrastructure.yml file. This file contains the representation of your Homie devices. You can also group devices there.
devices:
  - id: abcd0123
    location: Marvin's room
    nodes:
      - type: shutters
        id: shutters
        name: Shutters
  - id: efab4567
    location: Mathys's room
    nodes:
      - type: light
        id: main
        name: Main light
      - type: light
        id: bed
        name: Bed light

groups:
  - id: first-floor
    name: First floor
    devices:
      - abcd0123
      - efab4567
  1. The ota/manifest.yml file. It contains a definition of the firmwares for your devices, like so:
firmwares:
  - name: light-firmware
    version: 1.0.0
    devices:
      - marvin-lights

For this example manifest, you would put the firmware binary in ota/firmwares/light-firmware.bin, otherwise, OTA won't be handled. You can update the manifest while Homie is running, it will be hot loaded.

Contribute

Contributions are very welcome!

To work/start the git Homie version, just run npm run dev. This will build the public directory, and watch for changes in the app folder. To start the server, run npm start. The GUI will be listening on port 3000.

homie-server's People

Contributors

marvinroger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homie-server's Issues

cannot load devices

i edit the infrastructure.yml

devices:
  - id: 811c09e0
    location: Olmatix House
    nodes:
      - type: light
        id: switch
        name: Lampu Kamar     
  - id: 80be27e0
    location: Olmatix House
    nodes:
      - type: light
        id: switch
        name: Lampu Teras
groups:
  - id: first-floor
    name: First floor
    devices:
      - 811c09e0
      - 80be27e0

but GUI give me empty devices, no devices at all and homie console gave me no error output log..
i have success using openhab item with this..

Switch  Light1      ""      <light> { mqtt=">[broker:devices/811c09e0/light/on/set:command:ON:true],    >[broker:devices/811c09e0/light/on/set:command:OFF:false]" }
String  Status1 "[%s]"  <network>   { mqtt="<[broker:devices/811c09e0/$online:state:Online:true],       <[broker:devices/811c09e0/$online:state:Offline:false]" }
String  IP1 "[%s]"  <network>       { mqtt="<[broker:devices/811c09e0/$localip:state:default]" }
String  Signal1 "[%s]"  <network>   { mqtt="<[broker:devices/811c09e0/$signal:state:default]" }
Switch  Light2      ""      <light> { mqtt=">[broker:devices/80be27e0/light/on/set:command:ON:true],    >[broker:devices/80be27e0/light/on/set:command:OFF:false]" }
String  Status2 "[%s]"  <network>   { mqtt="<[broker:devices/80be27e0/$online:state:Online:true],       <[broker:devices/80be27e0/$online:state:Offline:false]" }
String  IP2 "[%s]"  <network>       { mqtt="<[broker:devices/80be27e0/$localip:state:default]" }
String  Signal2 "[%s]"  <network>   { mqtt="<[broker:devices/80be27e0/$signal:state:default]" }

can you tell me what is exactly wrong in my infrastructure.yml?

Error while starting homie-server

When I try to run homie-server, it complains about "/.homie" directory
I have created .homie directory in my home directory.
System is Ubuntu 14.04 on Odroid-C1
`sasa@server:~> homie

/usr/lib/node_modules/homie-server/index.js:70
var DEFAULT_DATADIR = _path2.default.join(_os2.default.homedir(), '/.homie');
^
TypeError: Object # has no method 'homedir'
at Object. (/usr/lib/node_modules/homie-server/index.js:70:56)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/lib/node_modules/homie-server/bin/cli.js:18:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
`

Change the color of the devices

I need to add the ability to set the background color of the device in the GUI from the infrastructure.yml. Currently, colors are hard-coded per node type.

Colors might be set in a group field, a device field or a node field. A device color takes precedence over a group color, and a node color takes precedence over a group or device color.

Add i18n

config.yml should contain a language field to change the strings of the GUI.

Make it as a npm module for import into app

As I see, currently the server can be run only as cli and read the config from /.homie. I would love to be able to import it into my app and provide config as object. Is there a chance for that?

Auto-discovery of devices

Going forward, devices will be recognized automatically using mDNS. People would then access a page on the dashboard to accept or refuse devices.

Syntax of infrastructure.yml file for v0.4.9

The default infrastructure.yml file for v0.4.9 has square brackets in it:
devices: []
groups: []
Has this changed?, because the example given in the homie-server notes gives an error.
Thank you for this project.

Add support for dimmable, rgb lights

I would like to add "traits" to HomieNode.

For example, in case of a light, if it has no traits property, only "on" property is mandatory. But if I add a trait property with the value "dimmable,rgb" it will also expose the properties "brightness" and "color".

This read-only property may be added to any node type to extend its semantic.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.