tobyweston / temperature-machine

Data logger for multiple DS18B20 temperature sensors on one or more machines
Apache License 2.0
67 stars 22 forks source link

How to change sensor name? #2

Open BoomerBrian opened 7 years ago

BoomerBrian commented 7 years ago

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

tobyweston commented 7 years ago

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.

BoomerBrian commented 7 years ago

Hello Toby.

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

tobyweston commented 7 years ago

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.

BoomerBrian commented 7 years ago

Good idea. Thanks.

tobyweston commented 7 years ago

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.

kiwamacey commented 7 years ago

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!

tobyweston commented 7 years ago

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

kiwamacey commented 7 years ago

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.

tobyweston commented 7 years ago

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

kiwamacey commented 7 years ago

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.

tobyweston commented 7 years ago

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 notifications@github.com 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.

kiwamacey commented 6 years ago

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?

tobyweston commented 6 years ago

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.

kiwamacey commented 6 years ago

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

cswelin commented 6 years ago

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

tobyweston commented 6 years ago

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

DaddyDeej commented 2 years ago

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

Aupirat commented 1 year ago

I would be very interessed in that feature as well. I am running 5 sensors on a PI-Zero with my zentral heating unit. It's running great. But the above discussed name mapping feature would be very helpfull so that my other family members can read the data as well. Is there a known way to manipulate the names in the meantime? Thank you! grafik

DemBones78 commented 1 year ago

Hey, This is a dead project. You will get no help and no updates.

Please take me advice and look in to home assistant. Hass.io

With a espd1 mini a 2$ part your probes will be ruining great on home assistant your can have stunning graphs via grafona. And do all sorts of automation with that sensor data

Watch a few videos about home assistant

Then watch a video about esphome The party that let's you build cheap esp devices

On Wed, Jan 11, 2023, 2:59 AM Aupirat @.***> wrote:

I would be very interessed in that feature as well. I am running 5 sensors on a PI-Zero with my zentral heating unit. It's running great. But the above discussed name mapping feature would be very helpfull so that my other family members can read the data as well. Is there a known way to manipulate the names in the meantime? Thank you! [image: grafik] https://user-images.githubusercontent.com/122438131/211762405-d195fc81-0401-46e5-aaa6-e99132798902.png

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1378426482, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DFWABDKZRXJJA726VTWRZY6VANCNFSM4C5YF3ZA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DemBones78 commented 1 year ago

here is some more information

[image: wemos-mini-and-ds18b20_bb-1.webp]

http://www.esp8266learning.com/wemos-mini-ds18b20-temperature-sensor-example.php the one wire temp probs hook up the same way

this is what grafana looks like, this is from my greenhouse. it has many probs

[image: Capture.JPG]

this is how it can look in a very basic dashboard [image: Capture.JPG]

this is what the webpage of the esp look like , its setup automatically via the esphome config all you do is say webpage yes this is the default

[image: Capture.JPG]

this stuff is really easy to set up there is lots of support, the Homeassistant board is really good, plus there is discord and lots of videos and web tutorials

this is a great thing to learn about because with this project you can do damn near anything. not just a few temp probs and no automation.

that and you can get esp chips in all sorts of devices and replace the software to esphome or tasmota so it runs on your cloud and some internet company

On Wed, Jan 11, 2023 at 10:22 AM Clayton Ross @.***> wrote:

Hey, This is a dead project. You will get no help and no updates.

Please take me advice and look in to home assistant. Hass.io

With a espd1 mini a 2$ part your probes will be ruining great on home assistant your can have stunning graphs via grafona. And do all sorts of automation with that sensor data

Watch a few videos about home assistant

Then watch a video about esphome The party that let's you build cheap esp devices

On Wed, Jan 11, 2023, 2:59 AM Aupirat @.***> wrote:

I would be very interessed in that feature as well. I am running 5 sensors on a PI-Zero with my zentral heating unit. It's running great. But the above discussed name mapping feature would be very helpfull so that my other family members can read the data as well. Is there a known way to manipulate the names in the meantime? Thank you! [image: grafik] https://user-images.githubusercontent.com/122438131/211762405-d195fc81-0401-46e5-aaa6-e99132798902.png

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1378426482, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DFWABDKZRXJJA726VTWRZY6VANCNFSM4C5YF3ZA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DemBones78 commented 1 year ago

oh and by the way changing names in home assistant is very easy

on the devices, they look like this

dallas sensors

dallas: pin: GPIO5 update_interval: 10s

Individual sensors

sensor:

just edit the name, in-home assistant you can use aliases for devices that may change function over time. For example, i have some smart switches that get moved around from controlling Christmas lights to fans to pumps to lamps ect. i just change the aliases

On Wed, Jan 11, 2023 at 10:22 AM Clayton Ross @.***> wrote:

Hey, This is a dead project. You will get no help and no updates.

Please take me advice and look in to home assistant. Hass.io

With a espd1 mini a 2$ part your probes will be ruining great on home assistant your can have stunning graphs via grafona. And do all sorts of automation with that sensor data

Watch a few videos about home assistant

Then watch a video about esphome The party that let's you build cheap esp devices

On Wed, Jan 11, 2023, 2:59 AM Aupirat @.***> wrote:

I would be very interessed in that feature as well. I am running 5 sensors on a PI-Zero with my zentral heating unit. It's running great. But the above discussed name mapping feature would be very helpfull so that my other family members can read the data as well. Is there a known way to manipulate the names in the meantime? Thank you! [image: grafik] https://user-images.githubusercontent.com/122438131/211762405-d195fc81-0401-46e5-aaa6-e99132798902.png

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1378426482, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DFWABDKZRXJJA726VTWRZY6VANCNFSM4C5YF3ZA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

HenrysCat commented 1 year ago

oh and by the way changing names in home assistant is very easy on the devices, they look like this # dallas sensors dallas: pin: GPIO5 update_interval: 10s # Individual sensors sensor: - platform: dallas address: 0x17000004FD7F2A28 name: "6 Temp-OnBoard" - platform: dallas address: 0x12000004FBD82828 name: "2 Temp-High" - platform: dallas address: 0xD33C01D6074F0428 name: "0 Temp-low" - platform: dallas address: 0x42000005DCB47628 name: "4 Temp-Outside" - platform: dallas address: 0x6B3C01D607A0EB28 name: "5 Temp-Rad" - platform: dallas address: 0x963C01D607FE4228 name: "1 Temp-Water" - platform: dallas address: 0x57000005B4B0E728 name: "3 Temp-Mid" - platform: dallas address: 0xcb3c01f096287128 name: "7 Chimmey" just edit the name, in-home assistant you can use aliases for devices that may change function over time. For example, i have some smart switches that get moved around from controlling Christmas lights to fans to pumps to lamps ect. i just change the aliases On Wed, Jan 11, 2023 at 10:22 AM Clayton Ross @.> wrote: Hey, This is a dead project. You will get no help and no updates. Please take me advice and look in to home assistant. Hass.io With a espd1 mini a 2$ part your probes will be ruining great on home assistant your can have stunning graphs via grafona. And do all sorts of automation with that sensor data Watch a few videos about home assistant Then watch a video about esphome The party that let's you build cheap esp devices On Wed, Jan 11, 2023, 2:59 AM Aupirat @.> wrote: > I would be very interessed in that feature as well. > I am running 5 sensors on a PI-Zero with my zentral heating unit. It's > running great. But the above discussed name mapping feature would be very > helpfull so that my other family members can read the data as well. Is > there a known way to manipulate the names in the meantime? Thank you! > [image: grafik] > https://user-images.githubusercontent.com/122438131/211762405-d195fc81-0401-46e5-aaa6-e99132798902.png > > — > Reply to this email directly, view it on GitHub > <#2 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/ALFB6DFWABDKZRXJJA726VTWRZY6VANCNFSM4C5YF3ZA > . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

And that all looks soooooo easy to set up, I bet anyone could do it in a few minutes with no previous knowledge at all.

DemBones78 commented 1 year ago

Exactly!

On Wed, Jan 11, 2023 at 11:16 AM HenrysCat @.***> wrote:

oh and by the way changing names in home assistant is very easy on the devices, they look like this # dallas sensors dallas: pin: GPIO5 update_interval: 10s # Individual sensors sensor: - platform: dallas address: 0x17000004FD7F2A28 name: "6 Temp-OnBoard" - platform: dallas address: 0x12000004FBD82828 name: "2 Temp-High" - platform: dallas address: 0xD33C01D6074F0428 name: "0 Temp-low" - platform: dallas address: 0x42000005DCB47628 name: "4 Temp-Outside" - platform: dallas address: 0x6B3C01D607A0EB28 name: "5 Temp-Rad" - platform: dallas address: 0x963C01D607FE4228 name: "1 Temp-Water" - platform: dallas address: 0x57000005B4B0E728 name: "3 Temp-Mid" - platform: dallas address: 0xcb3c01f096287128 name: "7 Chimmey" just edit the name, in-home assistant you can use aliases for devices that may change function over time. For example, i have some smart switches that get moved around from controlling Christmas lights to fans to pumps to lamps ect. i just change the aliases On Wed, Jan 11, 2023 at 10:22 AM Clayton Ross @.

> wrote: … <#m-5614471405709120642> Hey, This is a dead project. You will get no help and no updates. Please take me advice and look in to home assistant. Hass.io With a espd1 mini a 2$ part your probes will be ruining great on home assistant your can have stunning graphs via grafona. And do all sorts of automation with that sensor data Watch a few videos about home assistant Then watch a video about esphome The party that let's you build cheap esp devices On Wed, Jan 11, 2023, 2:59 AM Aupirat @.> wrote: > I would be very interessed in that feature as well. > I am running 5 sensors on a PI-Zero with my zentral heating unit. It's > running great. But the above discussed name mapping feature would be very > helpfull so that my other family members can read the data as well. Is > there a known way to manipulate the names in the meantime? Thank you! > [image: grafik] > https://user-images.githubusercontent.com/122438131/211762405-d195fc81-0401-46e5-aaa6-e99132798902.png

— > Reply to this email directly, view it on GitHub > <#2 (comment) https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1378426482>, or unsubscribe > https://github.com/notifications/unsubscribe-auth/ALFB6DFWABDKZRXJJA726VTWRZY6VANCNFSM4C5YF3ZA . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

And that all looks soooooo easy to set up, I bet anyone could do it in a few minutes with no previous knowledge at all.

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1379211126, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DCDGCX66RI3NJCKKBDWR3TH5ANCNFSM4C5YF3ZA . You are receiving this because you commented.Message ID: @.***>

DemBones78 commented 1 year ago

https://esphome.io/components/sensor/dallas.html

oh look tons of support on an active project. its all temples you really just edit the small parts , its easy and I cant code any thing

On Wed, Jan 11, 2023 at 11:18 AM Clayton Ross @.***> wrote:

Exactly!

On Wed, Jan 11, 2023 at 11:16 AM HenrysCat @.***> wrote:

oh and by the way changing names in home assistant is very easy on the devices, they look like this # dallas sensors dallas: pin: GPIO5 update_interval: 10s # Individual sensors sensor: - platform: dallas address: 0x17000004FD7F2A28 name: "6 Temp-OnBoard" - platform: dallas address: 0x12000004FBD82828 name: "2 Temp-High" - platform: dallas address: 0xD33C01D6074F0428 name: "0 Temp-low" - platform: dallas address: 0x42000005DCB47628 name: "4 Temp-Outside" - platform: dallas address: 0x6B3C01D607A0EB28 name: "5 Temp-Rad" - platform: dallas address: 0x963C01D607FE4228 name: "1 Temp-Water" - platform: dallas address: 0x57000005B4B0E728 name: "3 Temp-Mid" - platform: dallas address: 0xcb3c01f096287128 name: "7 Chimmey" just edit the name, in-home assistant you can use aliases for devices that may change function over time. For example, i have some smart switches that get moved around from controlling Christmas lights to fans to pumps to lamps ect. i just change the aliases On Wed, Jan 11, 2023 at 10:22 AM Clayton Ross @.

> wrote: … <#m_-6838763300229207842m-5614471405709120642_> Hey, This is a dead project. You will get no help and no updates. Please take me advice and look in to home assistant. Hass.io With a espd1 mini a 2$ part your probes will be ruining great on home assistant your can have stunning graphs via grafona. And do all sorts of automation with that sensor data Watch a few videos about home assistant Then watch a video about esphome The party that let's you build cheap esp devices On Wed, Jan 11, 2023, 2:59 AM Aupirat @.> wrote: > I would be very interessed in that feature as well. > I am running 5 sensors on a PI-Zero with my zentral heating unit. It's > running great. But the above discussed name mapping feature would be very > helpfull so that my other family members can read the data as well. Is > there a known way to manipulate the names in the meantime? Thank you!

[image: grafik] > https://user-images.githubusercontent.com/122438131/211762405-d195fc81-0401-46e5-aaa6-e99132798902.png

— > Reply to this email directly, view it on GitHub > <#2 (comment) https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1378426482>, or unsubscribe > https://github.com/notifications/unsubscribe-auth/ALFB6DFWABDKZRXJJA726VTWRZY6VANCNFSM4C5YF3ZA . > You are receiving this because you are subscribed to this thread.Message > ID: @.***> >

And that all looks soooooo easy to set up, I bet anyone could do it in a few minutes with no previous knowledge at all.

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1379211126, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DCDGCX66RI3NJCKKBDWR3TH5ANCNFSM4C5YF3ZA . You are receiving this because you commented.Message ID: @.***>

Aupirat commented 1 year ago

Ok, thank you for the information. But I was specifically looking for a temperature logger solution that uses the PI-Zero and the DSB1820 locally and this here works great. I was hopping that somebody had found a simple workaround or tweak to solve the naming issue.

Thank you for the hint to "home assistant" that looks like a thing I will try. Unfortunately they kicked out the direct GPIO support in 06-2022 and now you have to look for addons that allow you to get the data from 1-wire sensors. Still, i am going to try that on a separate SD card with my Pi-Zero....

Thanks agin for the quick response!

DemBones78 commented 1 year ago

you don't need an add on you just use ESP devices for the sensors. like this https://www.amazon.com/Organizer-ESP8266-Internet-Development-Compatible/dp/B081PX9YFV/ref=sr_1_5?keywords=esp8266&qid=1673531889&sr=8-5

that reports to your homeassiatant

On Thu, Jan 12, 2023 at 3:04 AM Aupirat @.***> wrote:

Ok, thank you for the information. But I was specifically looking for a temperature logger solution that uses the PI-Zero and the DSB1820 locally and this here works great. I was hopping that somebody had found a simple workaround or tweak to solve the naming issue.

Thank you for the hint to "home assistant" that looks like a thing I will try. Unfortunately they kicked out the direct GPIO support in 06-2022 and now you have to look for addons that allow you to get the data from 1-wire sensors. Still, i am going to try that on a separate SD card with my Pi-Zero....

Thanks agin for the quick response!

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1380008891, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DEWK5PFN43OMGZMDGDWR7CIHANCNFSM4C5YF3ZA . You are receiving this because you commented.Message ID: @.***>

HenrysCat commented 1 year ago

Lots of vague useless inforfmation there, how does one connect to the ESP device to add the code? how do you connect it wifi network? are they assigned an IP like a R-Pi?

DemBones78 commented 1 year ago

so step one is to load home assistant on a raspberry pi , or intel nuc or via a docker or via a virtual machine. just how ever you want too depending on what you have available and your automation goals , personally mine is a virtual machine running on my nas. https://www.home-assistant.io/blog/2022/04/16/device-to-run-home-assistant/

after homeassistant is up and running , you open the addon ESPHOME from there you select make a new device . and tell it the type of esp 8266 vs esp32 that will open a basic configuration with blanks for wifi info complete the config and upload to the esp it will have a usb port on the side that is how you push the config there is an open right in esphome for web based or you can use a utility like espflasher after that its on the wifi and managed by esphome / homeassistant and all config changed happen via wifi https://peyanski.com/complete-esphome-installation-guide/

I know it seems like a lot but its really not that bad , 1 step at a time. there are lots of great how videos

On Fri, Jan 13, 2023 at 2:07 AM HenrysCat @.***> wrote:

Lots of vague useless inforfmation there, how does one connect to the ESP device to add the code? how do you connect it wifi network? are they assigned an IP like a R-Pi?

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1381453108, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DA2X7EOTCF5KXQ6S3LWSEEM7ANCNFSM4C5YF3ZA . You are receiving this because you commented.Message ID: @.***>

HenrysCat commented 1 year ago

Finally did it, thanks for pointing me in the right direction DemBones78, I used this guide https://microcontrollerslab.com/esp32-esp8266-dht11-dht22-influxdb/ and now have my readings in Grafana. Does seem daunting at first, and it did take me 3 days to figure it all out lol

DemBones78 commented 1 year ago

Glad to hear it!

On Tue, Jan 24, 2023, 1:18 PM HenrysCat @.***> wrote:

Finally did it, thanks for pointing me in the right direction DemBones78, I used this guide https://microcontrollerslab.com/esp32-esp8266-dht11-dht22-influxdb/ and now have my readings in Grafana. Does seem daunting at first, and it did take me 3 days to figure it all out lol

— Reply to this email directly, view it on GitHub https://github.com/tobyweston/temperature-machine/issues/2#issuecomment-1402465253, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFB6DDL3JCQHMXIWNNJH2TWUATILANCNFSM4C5YF3ZA . You are receiving this because you commented.Message ID: @.***>