-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HOSTNAME with serial number as decimal and without MQTT_TOPIC #5991
Comments
Hi,
It is already available the console command |
No. Not working if the "MQTT_TOPIC" is changed. |
Sorry, I could not reproduce the problem. I have just tested |
Ok please try this: Add this in your user_config_override.h
Then it isn't possible to change the HOSTNAME back to "sonoff-1234" via the user_config_override.h. PS: You can manual rename the hostname. But this is very uncomfortable. |
Is the problem that you have a space in the definition of your MQTT_TOPIC? Topics cannot have any whitespace. |
No there isn't any space. My MQTT_TOPIC is absolutely fine with "sonoff_A1B2C3". But the hostname is generated by my MQTT_TOPIC. And so I have this hostname: "sonoff_A1B2C3-1234". It's impossible to remove the unecessary "_A1B2C3" via the user_config_override.h. PS: No issue. Just a missing configuration option for HOSTNAME in user_config_override.h. |
This confused me a bit at first. I wanted to change my mqtt topics to match the hostname I was currently seeing, so I changed the mqtt_topic to sonoff-%04d Now my hostname is actually sonoff-%04d-%04d (sonoff-8001-8001). What I was expecting is to have the mqtt topic and the hostname match exactly. In @0n3-70uch's case, I think he wants to have his hostname be the default "sonoff-8001" and his MQTT topic be "sonoff_E92J29". I've even tried setting my hostname to "sonoff-%04d" and I STILL get "sonoff-8001-8001" as my actual hostname. I would suggest a mode or some other feature to have your hostname and MQTT name match exactly and as well have the hostname NOT contain the %04d automatically as is the case currently. |
I already try that as my previous comment, and the command You want your hostname to be equal to your mqtt_topic, right? If you want to define a MQTT_TOPIC and make your HOSTNAME equals to your MQTT_TOPIC, and you want to make it configurable from user_config_override.h or my_user_config.h file, just: 1- Comment or delete line 78 of sonoff.h This might not be added to the actual repository due to #36 |
Hi, thanks for your very helpful answere. I changed my sonoff.h to this:
The HOSTNAME is someting like this now: sonoff-1073680949 Greetings Fabian |
Which esp8266 core version are you using? |
I use 2.5.2 (platformio). |
Please try with core 2.3.0 so as to test. I tested on 2.3.0 and %04d gives me the last 4 digits of the mac correctly |
Ok I will try it later. I get a compiler error with 2.3.0 at the moment. |
Hi, I compiled it with core 2.3.0. Still the same problem. |
Hi, Sorry for the late reply. I have missed your comment. Please, erase the flash before flashing (or do a |
Hi, no problem. Thanks for your help. I erased the devices several times with |
I'm having the same problem. I'm building tasmota.bin using 8.1 with only changes in my_user_config. The resolving of "%04d" does not seem to show the result in the ui. I'm using it for the friendly name, mqtt-topic also. The UI shows it without resolving. Any update / workaround? I would like to use this binary for all my S20s. |
same problem here, %04d" doesn't works...any workaround? |
It works as documented. Did you took the time to read the docs?
So having % in the name does the same 'hostname 1' |
Have you look for this feature in other issues and in the wiki?
Yes. Wiki and Discord.
Is your feature request related to a problem? Please describe.
No. Only bad charactes in the hostname (like: "_").
Describe the solution you'd like
Change the MQTT_TOPIC to "PROJECT "_%06X"" in user_config_override.h. Now the Hostname is like "sonoff_E92J29-2383". Please add an option to set the hostname back to normal. Example:
The text was updated successfully, but these errors were encountered: