Comments (14)
I will check that for you after work... there is a cron job that runs that creates the summary file.
from lightwaverf.
in the docs i could only find the cron for creating the html
/usr/local/bin/lightwaverf web 5 > /var/www/lightwaverf.html
but the lightwaverf web would generate this (although in my case is empty of data. but the html structure is added), but the summarise function exits looking for a json file. - I will dig into this a bit more - thanks
from lightwaverf.
lightwave summarise
is the job that should create the summary file. There must be an error. I must have changed the code to say "read in the old summary file first" but not handled the first running of this when there would be no summary file... I'll fix later today, thanks for reporting.
from lightwaverf.
I've checked this by deleting ~/lightwaverf-summary.json and then running
lightwaverf summarise 7
and I get no errors. I will try again running "summarise" when there is no existing data in lightwaverf.log
Do you have your energy monitor set up correctly? Is it reporting energy usage to the wifi link? Do you have a cron job in place to log the energy usage? My crontab has this
*/2 * * * * /usr/local/bin/lightwaverf energy > /tmp/energy.out 2>&1
my full crontab is
*/5 * * * * /usr/local/bin/lightwaverf summarise 7 true > /tmp/summarise.out 2>&1
59 * * * * /usr/local/bin/lightwaverf update_timers 60 1440 true > /tmp/update_timers.out 2>&1
*/5 0-5,9-17,20-23 * * * /usr/local/bin/lightwaverf timer 5 true > /tmp/timer.out 2>&1
* 6-8,18-19 * * * /usr/local/bin/lightwaverf timer 1 true > /tmp/timer.out 2>&1
*/2 * * * * /usr/local/bin/lightwaverf energy > /tmp/energy.out 2>&1
*/10 * * * * /usr/local/bin/lightwaverf-config-json > /tmp/lightwaverf-config.json 2> /tmp/lightwaverf-config.err
15 * * * * /usr/local/bin/lightwaverf web > /var/www/automation/index.html 2> /tmp/web.err
from lightwaverf.
perhaps its the gem I'm using ? 0.6.5 ? I'm on a mac by the way. So i am connected and there is energy data, lightwaverf energy does return data. The gem also works to turn on and off devices.
The issue seems to be the various json files, they don't exist and are not created.
I will try removing the gem and building it manually.
lightwaverf energy
{"usage"=>0, "max"=>5330, "today"=>4050, "error"=>"error parsing /Users/Dread/lightwaverf-daily.json; A JSON text must at least contain two octets!", "history_json"=>""}
bash-3.2$ lightwaverf summarise
/Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/json-1.7.7/lib/json/common.rb:155:in initialize': A JSON text must at least contain two octets! (JSON::ParserError) from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/json-1.7.7/lib/json/common.rb:155:in
new'
from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/json-1.7.7/lib/json/common.rb:155:in parse' from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:1090:in
summarise'
from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/bin/lightwaverf:29:in <top (required)>' from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in
load'
from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in <main>' bash-3.2$ pwd /Users/Dread bash-3.2$ /usr/local/bin/lightwaverf update_timers 60 1440 true > /tmp/update_timers.ou bash: /usr/local/bin/lightwaverf: No such file or directory bash-3.2$ lightwaverf update_timers 60 1440 true > /tmp/update_timers.out /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:631:in
update_timers': undefined method +' for nil:NilClass (NoMethodError) from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/bin/lightwaverf:19:in
<top (required)>'
from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in load' from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in
bash-3.2$ lightwaverf timer 5 true > /tmp/timer.out
/Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:631:in
update_timers': undefined method
+' for nil:NilClass (NoMethodError)from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:153:in
get_timer_cache' from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:887:in
run_timers'from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/bin/lightwaverf:21:in
<top (required)>' from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in
load'from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in
<main>' bash-3.2$ lightwaverf timer 1 true > /tmp/timer.out /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:631:in
update_timers': undefined method +' for nil:NilClass (NoMethodError) from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:153:in
get_timer_cache'from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/lib/lightwaverf.rb:887:in
run_timers' from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/gems/lightwaverf-0.6.5/bin/lightwaverf:21:in
<top (required)>'from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in
load' from /Users/Dread/.rvm/gems/ruby-1.9.3-p448/bin/lightwaverf:23:in
'bash-3.2$ lightwaverf-config-json
{"room":[{"name":"Kitchen","device":["Kitchen Plug"]},{"name":"Sitting room","device":["Tv","Lamp"]},{"name":"Bathroom","device":["Lights"]},{"name":"Bath landing","device":["Lights"]},{"name":"Office","device":["Office Front","Office Back","Deckin Light","Tv Socket","Heater","Tall Lamp"]},{"name":"Off equipmen","device":["Network Equ","Imac Equip","Air Con"]}]}
bash-3.2$ ightwaverf energy
bash: ightwaverf: command not found
bash-3.2$ lightwaverf energy
{"usage"=>0, "max"=>5330, "today"=>4070, "error"=>"error parsing /Users/Dread/lightwaverf-daily.json; A JSON text must at least contain two octets!", "history_json"=>""}
from lightwaverf.
aha it is the lightwaverf-daily.json - I'll try removing mine tonight, debug it, and then post a fix
from lightwaverf.
I've released a new version of the gem, can you update and try again?
Thanks for being patient.
from lightwaverf.
Winner :) 0.6.6 gem works like a charm. Graphing energy Data now. Now i need to port it to ARM maybe package it up for my synology NAS, fantastic work - thanks !!
from lightwaverf.
tell your friends!
from lightwaverf.
Just as an FYI I managed to get it to work on my synology Nas, (ARM processor), the gem installed failed - which is due to the gcc / dev tools on the busy box build (i will look into this), but I cluged together a manual build, so it now works in the background on my NAS updating the local web server - sweet , ill test it on my pi build also.
from lightwaverf.
if you could add the room control functions to the web page that would also be cool
from lightwaverf.
I did have the room control functions on there but moved it out to separate parts. https://github.com/pauly/robot-butler is the phone app, but is all html based so will work in any web browser. That requires https://github.com/pauly/lightwaverf-api which should be running on the box where you installed the gem...
I'll have a look later see if I can make it an option easily to put the controls back in that webpage.
from lightwaverf.
Cool thanks for following up - controlling everything from one page and the graph for me would be a great help, plus time hourly on the graph, as I use it to graph power every 5 min, ill check out the butler , as an Fyi using you gem and proximity (a free osx util that gives bluetooth status) I can now have my office wake up and shutdown when I walk in and walk away, check it out its pretty nice (https://code.google.com/p/reduxcomputing-proximity/).
from lightwaverf.
good to know about proximity I think someone suggested it before, not on iphone myself though... hmm only power up the surround sound if I am in the lounge, and keep the volume down low if I'm in bed!
from lightwaverf.
Related Issues (13)
- Configuration initialisation from web server HOT 1
- Ruby Errors HOT 20
- Calendar is going to stop working in November HOT 1
- Randomised calendar events don't work for toggled devices
- 'No implicit conversion of nil into String (Type Error)' HOT 11
- Lightwave site update breaking changes
- Smart Series support? HOT 1
- Action Required: Fix Renovate Configuration
- Dependency Dashboard
- Delay in command execution
- lightwaverf-daily.json HOT 16
- Lightwaverf UDP commands stopped working after WIFI link update to version U2.90N HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightwaverf.