temperature-machine
temperature-machine copied to clipboard
How to change sensor name?
How do we change the sensor names? For example how to change garage-sensor-1 to garage-fermentation.
This isn't configurable at the moment. It's based on the 'host' name, so you'll get garage-sensor-1
and garage-sensor-2
for now.
However, as part of issue #1 I'm thinking about implementing some sort of configuraiton to map individual sensor names (like 28-xxxx
) to whatever you like.
How would you like to see that mapping? A file? an environment variable? something else? Not supplying one would likely default to existing behaviour.
Hello Toby.
Thanks for the response. I would prefer a configuration file.
If you have just one sensor, you can use your hostname. Not sure if that was clear, but if you change your host name to "fermentation" it'll be the default for all the sensor names and show up on the UI.
Good idea. Thanks.
#1 has had some love so (on a branch) the sensor names are now available.
All we'd need to do is add a mapping layer from sensor name to friendly name and plumb it all in.
I'll chip away but welcome PRs.
I would also find being able to change the sensor names useful. Have installed 5 sensors on one Pi3 in different rooms to monitor how well the HRV is working. This project seems to be the easiest and best option I have found, Great work!
I'll bump this to the next thing I look at... suggestions as to how welcome
some kind of config file file would be my suggestion, something like 28-000009824226 = Bedroom1 28-000009824227 = Kitchen 28-000009824228 = Outside space, comma, tab separation what ever is easiest I guess. My other question would be how can i change the colors on the graph? I am a bit colour blind and the defaults I have for sensors 1,4 and 5 (particularly 1 and 4) are much the same to me. if you can point me to the settings i don't mind rebuilding it.
@kiwamacey you can tweak Graph.scala
for the PNGs at the bottom on the UI and the colours for the JavaScript main chart are actually in the companion / UI project https://github.com/tobyweston/temperature-machine-ui.
It's a little more involved changes these are that project has it's own build process which copies minified JavaScript into the resources
folder of this project. Where as this project uses sbt
for building, the UI project uses npm
. If those things mean nothing to you, I'd avoid it. If they do, happy hacking.
Look for the following in JsonChar.js
.
const colors = ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE', '#DB843D', '#92A8CD', '#A47D7C', '#B5CA92'];
Failing that, you could try looking for the colours in the pre-built resources
folder, in main-xxx.js
but it's minified and horrible to look at. You could try search and replace with 4572A7
for example. The current main-xxx.js
file is called main.b14fff8a.js
under src/main/resources/static/js (it's name changes with each UI build).
I'll have a think about adding configurable colours, or if you wanted to send over some more contrasting colours, I'd be happy to replace what's there.
Thanks for that, I have replaced the purplish colour for sensor 4 with an orangish colour (#db843d) and it works well for me.I did as you suggested and found the colours, replaced the fourth one and rebuilt with the original sbt command.
Great, if you want to do a pull request, I'll roll it in. Otherwise, I'll make the same change when I get to it. Cheers
On 26 Jul 2017, at 12:34, kiwamacey [email protected] wrote:
Thanks for that, I have replaced the purplish colour for sensor 4 with an orangish colour (#db843d) and it works well for me.I did as you suggested and found the colours, replaced the fourth one and rebuilt with the original sbt command.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Hi Again, I hope you can help again. I have just upgraded the source on my b+ server. The new changes in the doccy's don't line up with the build from source docs. I compile the souce as th pi user which does not install the temperature-machine file to the executable path. I could not find it with the find command under the code directory. the start.sh script does not start program correctly either. I am using the source up as I have edited the old Graph.scala and main***.js for my colour blindness with colours I can make out better. I was going to finally upgrade and see if you wanted to include them in working release.does the new version have the start-server and start-client .sh files, the git pull version i did does nt?
Hey @kiwamacey sorry about that! The docs should be consistent, make sure you're looking at either
- http://temperature-machine.com/docs/getting_started/installing.html
- http://baddotrobot.com/blog/2016/03/23/homebrew-temperature-logger/
We recently change the recommended installation method from building from source to install via apt
. It's quicker for you and now runs a service that restarts automatically and other good stuff. However, any changes you've made will be lost.
We can do a couple of things:
- Get your changes into the main project so you can install and update via
apt
(my preference) - Get you going building and deploying from source
For the first one: did you fork my repo and make your changes? That's the easiest way for me to see what you changed and potentially work it into the app.
The second one should be doable and the instructions online should be accurate - we prob just have to figure out what's wrong.
Thanks for the reply,
I have just forked and replaced the two files Mentioned previously. main.4b***.js and Graph.scala. I hope the colours aren;t to gaudy for every one, they work for me but may not work for someone with the different or a worse case of colour blindness. I have used Black at the beginning of the string in main*.js and at the end of Graph.scala as I have just added a last detector on a annother pi for my garage ( this seems to give a better reading than ones install on the sofette of my house). The garagepi/detector is first on the main html page but last on the daily, weekly and mothly graphs.
still had issues build from source. I thingk the only thing I havent changed is the SD card. my last attempt was under home/pi/fork/temperature-machine, failed with the error mentioned at the bottom of the instructions
(/usr/local/bin/sbt: line 3: 6014 Killed java $SBT_OPTS -jar dirname $0
/sbt-launch.jar "$@" or different PID)
Did this build while the old version was still live and noticed wome weird things - temperatures on the webpage later, temps went up to 110 Deg C at about the time I ran the build??!!
Chat Soon, Thanks
@tobyweston Is adding an alias
to a sensor (from the same server/client) still on the roadmap?
It is yes, just haven't much time to spend on the project atm 😢
@tobyweston.. Wondering if this was ever added? Thanks!