temperature-machine icon indicating copy to clipboard operation
temperature-machine copied to clipboard

How to change sensor name?

Open BoomerBrian opened this issue 7 years ago • 30 comments

How do we change the sensor names? For example how to change garage-sensor-1 to garage-fermentation.

BoomerBrian avatar Jan 25 '17 21:01 BoomerBrian

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.

tobyweston avatar Jan 26 '17 10:01 tobyweston

Hello Toby.

Thanks for the response. I would prefer a configuration file.

BoomerBrian avatar Jan 26 '17 14:01 BoomerBrian

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.

tobyweston avatar Jan 26 '17 15:01 tobyweston

Good idea. Thanks.

BoomerBrian avatar Jan 26 '17 15:01 BoomerBrian

#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.

tobyweston avatar Feb 03 '17 20:02 tobyweston

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!

kiwamacey avatar Jul 05 '17 10:07 kiwamacey

I'll bump this to the next thing I look at... suggestions as to how welcome

tobyweston avatar Jul 05 '17 13:07 tobyweston

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 avatar Jul 06 '17 08:07 kiwamacey

@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.

tobyweston avatar Jul 06 '17 17:07 tobyweston

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.

kiwamacey avatar Jul 26 '17 11:07 kiwamacey

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.

tobyweston avatar Jul 26 '17 12:07 tobyweston

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?

kiwamacey avatar Aug 15 '18 08:08 kiwamacey

Hey @kiwamacey sorry about that! The docs should be consistent, make sure you're looking at either

  1. http://temperature-machine.com/docs/getting_started/installing.html
  2. 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:

  1. Get your changes into the main project so you can install and update via apt (my preference)
  2. 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.

tobyweston avatar Aug 15 '18 10:08 tobyweston

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

kiwamacey avatar Aug 18 '18 07:08 kiwamacey

@tobyweston Is adding an alias to a sensor (from the same server/client) still on the roadmap?

cswelin avatar Oct 03 '18 18:10 cswelin

It is yes, just haven't much time to spend on the project atm 😢

tobyweston avatar Oct 03 '18 21:10 tobyweston

@tobyweston.. Wondering if this was ever added? Thanks!

DaddyDeej avatar Jun 15 '22 01:06 DaddyDeej