Open pskowronek opened 10 months ago
When I leave {hostname} in configuration. Still I don't know if it should be replaced automatically, or I should edit that.
In the config.ini you create.
This
Should be left as is with the # to have it ignored in the program and send the hostname the Pi itself has been given by you.
You only un-comment that and alter the hostname to give it something different to the default or if it is not working. Change rpi-{hostname} to whatever you want, this is the sensor name not the actual hostname you are changing. It is there as some people wanted deb-{hostname} or ubuntu-{hostname} or even Sillysensoratrpi{hostname}devicething
On Sun, 28 Jan 2024, 3:45 pm Piotr Skowronek, @.***> wrote:
obraz.png (view on web) https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/assets/360665/d6515fac-b445-4a4c-929f-7c830dddcb71
When I leave {hostname} in configuration. Still I don't know if it should be replaced automatically, or I should edit that.
— Reply to this email directly, view it on GitHub https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/131#issuecomment-1913639184, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXN2F4YKAG46NPAVE2P3YQZXADAVCNFSM6AAAAABCNY2UECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGYZTSMJYGQ . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>
Are you using RaspberryPi OS from RaspberryPi.com / Pi Imager or some other version of it?
PiOS '11' is Bullseye so should just work.
Hostname it retrieved from /bin/hostname -f If that doesn't work, try fix that.
If you cannot then you change _# default domain to use when hostname -f doesn't return a proper fqdn
Remove the # and change home to whatever you want.
Are you using RaspberryPi OS from RaspberryPi.com / Pi Imager or some other version of it?
I have bullseye RaspberryPi OS.
PiOS '11' is Bullseye so should just work.
Hostname it retrieved from /bin/hostname -f If that doesn't work, try fix that.
I've already mentioned that I've fixed the problem with hostname -f
.
If you cannot then you change _# default domain to use when hostname -f doesn't return a proper fqdn #fallbackdomain = home
The comment in config.ini.dist
above sensor_name
should better state this:
"Should be left as is with the # to have it ignored in the program and send
the hostname the Pi itself has been given by you. "
Otherwise one may think that sensor_name = rpi-{hostname}
must be un-commented, and {hostname} will be replaced in runtime either by hostname or fallback_domain
.
Remove the # and change home to whatever you want.
Thanks. But what I aim here is to make this behavior more obvious - both in README.md (installation part) and in config.ini.dist
.
You'll see some other topics/pulls that are open that do just this or talk about it, I have just commented to a few just now so you can see some. #122
Feel free to edit and make a pull request, though there are a few good ones waiting already, #126 #106 @ironsheep seems to be busy, away, working things out.
Remember this is his project for something he wanted, everything else is a bonus and tagged on for others :)
Given that change is not talked about in the normal setup, it's really an advanced setup. Maybe an advanced setup/wiki page needs creating for the other options. and linked to from ironsheep/RPi-Reporter-MQTT2HA-Daemon: Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring) (github.com) https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon?tab=readme-ov-file#configuration ?
I was unsure if you had fixed the hostname on the one not working, hence you were editing the config.ini to try fix it, just the wrong bit.
On Sun, 28 Jan 2024 at 17:37, Piotr Skowronek @.***> wrote:
Are you using RaspberryPi OS from RaspberryPi.com / Pi Imager or some other version of it?
I have bullseye RaspberryPi OS.
PiOS '11' is Bullseye so should just work.
Hostname it retrieved from /bin/hostname -f If that doesn't work, try fix that.
I've already mentioned that I've fixed the problem with hostname -f.
If you cannot then you change # default domain to use when hostname -f doesn't return a proper fqdn #fallback_domain = home
The comment in config.ini.dist above sensor_name should better state this: "Should be left as is with the # to have it ignored in the program and send the hostname the Pi itself has been given by you. "
Otherwise one may think that sensor_name = rpi-{hostname} must be un-commented, and {hostname} will be replaced in runtime either by hostname or fallback_domain.
Remove the # and change home to whatever you want.
Thanks. But what I aim here is to make this behavior more obvious - both in README.md (installation part) and in config.ini.dist .
— Reply to this email directly, view it on GitHub https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/131#issuecomment-1913670391, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACYAXNYT52DTPX5XRIMMGL3YQ2EHJAVCNFSM6AAAAABCNY2UECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTGY3TAMZZGE . You are receiving this because you commented.Message ID: @.***>
Remember this is his project for something he wanted, everything else is a bonus and tagged on for others :)
Yup, and this is very great project! I've already submitted 2 PR to it to make it more easier to use :)
First I wanted to see whether {hostname} should be dereferenced or not. I see those PR you have mentioned @bsimmo - Let's wait for PR review. Personally I would add better comments to config.ini.dist
to explain the behavior and what's the default.
Maybe let's keep this "bug" open so it could be discussed how to make it more obvious how to use it.
Checklist:
Release with the issue:
2024.01.28 master
Last working release (if known): N/A
Hardware, Operating System, Python version:
RPi zeros, Raspbian 11
Description of problem:
I've tried to setup this project on 3 RPi I got - 2 had no problem displaying their name (
hostname -f
), 1 had such a problem. However, to be sure inconfig.ini
I set fallback to their names. When runningsystemctl status
I see for all of them the following:In Status line I see "rpi-{hostname}" - is this correct? I mean, since this is my first setup with this project, I had the following doubts:
Expectations:
config.ini.dist
should have additional explanation abovetopic
that {hostname} will be replaced with a proper hostname (using fallback if required)no_address_associated_with_hostname
, but something likefqdn-unknown
orfqdn-unknown-IP
(where IP is the IP :) ). The sensor name looks like this (even if I fixed the problem hostname resolution /I guess I need to reset sth and re-add it to HA):sensor.rpi_my_raspberrypi_rpi_monitor_hostname_no_address_associated_with_hostname
. And btw, why hostname is present in two times in entity name (on the beginning and at the end)?