Coder Social home page Coder Social logo

e-home's People

Contributors

anton-johansson avatar

Stargazers

 avatar

Watchers

 avatar

e-home's Issues

Unit testing configService.modify

We're just asserting that this method is called. But since it's accepting a Consumer<Config>, we don't really verify what is actually happening in the consumer...

NPE when reading device update

If we are monitoring a value and we receive a device's first update, the device might not yet have any metric. That means, the currentValue might be null.

Stacktrace:

2018-02-22 18:57:53,005 ERROR com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler:81 - An exception occurred
java.lang.NullPointerException
	at com.anton.ehome.zwave.Controller$Listener.onZWaveNodeUpdated(Controller.java:166)
	at com.whizzosoftware.wzwave.controller.netty.NettyZWaveController.onZWaveNodeUpdated(NettyZWaveController.java:271)
	at com.whizzosoftware.wzwave.controller.netty.NettyZWaveController.onApplicationCommand(NettyZWaveController.java:396)
	at com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler.channelRead(ZWaveChannelInboundHandler.java:56)
	at com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler.userEventTriggered(ZWaveChannelInboundHandler.java:94)
	at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:304)
	at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:290)
	at com.whizzosoftware.wzwave.channel.TransactionInboundHandler$NettyZWaveChannelContext.process(TransactionInboundHandler.java:171)
	at com.whizzosoftware.wzwave.channel.TransactionInboundHandler.channelRead(TransactionInboundHandler.java:66)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at com.whizzosoftware.wzwave.channel.FrameQueueHandler.channelRead(FrameQueueHandler.java:239)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at com.whizzosoftware.wzwave.channel.ACKInboundHandler.channelRead(ACKInboundHandler.java:33)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
	at io.netty.channel.oio.AbstractOioByteChannel.doRead(AbstractOioByteChannel.java:147)
	at io.netty.channel.oio.AbstractOioChannel$1.run(AbstractOioChannel.java:45)
	at io.netty.channel.ThreadPerChannelEventLoop.run(ThreadPerChannelEventLoop.java:53)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
	at java.lang.Thread.run(Thread.java:748)

Clean up EHomeShell

This class is pretty messy. As this is the first time I'm writing a raw SSH shell, the focus is more on getting things to work.

  • Clean it up, separate it into separate classes, different handlers, etc.
  • Write unit tests that cover the functionality of the shell.

Allow monitoring values from devices

Some devices can be monitored, for example energy consumption. These values should be able to be stored in the database, for future usages:

  • Data visualizations using graphs
  • Notifications when data changes

Consider OSGi

We're starting to get a few different set of libraries, and more will come, for example Zigbee and Sonos. I've already noticed issues with Java dependency hell. We should consider OSGi after all.

Pros:

  • Isolate dependencies, allow using the same libraries with different versions, etc.
  • If we use a container like Karaf, we have built in support for commands, that are easy to expose as services. We wouldn't have to maintain code for a SSH shell.

Commands that exit

CanExit interface is used to provide commands the possibility to exit the shell. Feels a bit overkill. Maybe use a specific exception for instead? That way, the ExitCallback interface never really leaves the EHomeShell class.

More stable metrics interval

When a device' metrics change, it sends an update to the controller. If there is no change (for example if the value is zero, and keeps being zero), no update will be sent. This means we won't send any metrics to the database. This will seem incorrect, for example if devices are turned off.

Instead, we should poll the devices at fixed, configurable intervals.

Scroll through command history

Add support for using Up and Down arrows for scrolling through SSH command history. Would be nice if it was persisted through SSH sessions. Maybe per user name? Where to store it? In InfluxDB? If so, can we store them forever or do we need to clean up?

Introduce voice control

Mess around with different voice control libraries. Try with basic functionality, such as enable and disable devices.

NPE while shutting down

2018-01-04 20:41:29,649 INFO  com.anton.ehome.Daemon:72 - Stopping daemons...
2018-01-04 20:41:29,659 INFO  com.anton.ehome.zwave.Controller:80 - Stopping Z-Wave controller 'default'
2018-01-04 20:41:29,662 INFO  com.anton.ehome.Daemon:74 - All daemons successfully stopped
2018-01-04 20:41:29,662 INFO  com.anton.ehome.EntryPoint:61 - Exiting...
2018-01-04 20:41:30,186 ERROR com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler:81 - An exception occurred
java.lang.NullPointerException
	at com.whizzosoftware.wzwave.controller.netty.NettyZWaveController.onTransactionFailed(NettyZWaveController.java:457)
	at com.whizzosoftware.wzwave.channel.ZWaveChannelInboundHandler.userEventTriggered(ZWaveChannelInboundHandler.java:97)
	at io.netty.channel.AbstractChannelHandlerContext.invokeUserEventTriggered(AbstractChannelHandlerContext.java:304)
	at io.netty.channel.AbstractChannelHandlerContext.fireUserEventTriggered(AbstractChannelHandlerContext.java:290)
	at com.whizzosoftware.wzwave.channel.TransactionInboundHandler$NettyZWaveChannelContext.process(TransactionInboundHandler.java:184)
	at com.whizzosoftware.wzwave.channel.TransactionInboundHandler.processEvent(TransactionInboundHandler.java:135)
	at com.whizzosoftware.wzwave.channel.TransactionInboundHandler.userEventTriggered(TransactionInboundHandler.java:101)
	at com.whizzosoftware.wzwave.channel.TransactionTimeoutHandler.run(TransactionTimeoutHandler.java:44)
	at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38)
	at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:123)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:341)
	at io.netty.util.concurrent.SingleThreadEventExecutor.confirmShutdown(SingleThreadEventExecutor.java:640)
	at io.netty.channel.ThreadPerChannelEventLoop.run(ThreadPerChannelEventLoop.java:62)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
	at java.lang.Thread.run(Thread.java:748)

Philips HUE

Mess around with Philips HUE. Investigate what is needed and how the protocol works (I assume it's over WiFi, and no controller is needed, but this needs to be checked). What device(s) do I need to try it out?

There seems to be an OK Java SDK available:

Increase retention of SSH history

It expires after one hour. It should be much longer. Maybe a year? Could maybe go forever, the storage probably won't be an issue...

Unresolvable dependencies

Travis is disabled because there are two unresolvable dependencies:

  • RXTXComm: Should probably wait for WZWave to replace RXTX with jSerialComm.
  • WZWave: We use a snapshot here. Either check if the snapshots are deployed, and if so use them from there. Otherwise, just wait for the next release.

See this build for details.

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.