Dashes are not supported in IDs, please use underscores instead.
Closed this issue · 2 comments
Lieta2 commented
git log -1 --oneline
5dc9cbe (HEAD -> master, origin/master, origin/HEAD) Merge pull request #78 from hmmbob/restart-button
With
deviceid: "mhi_ac_ctr_bedroom"
in lr_mhi_ac_ctrl.yaml
$ esphome compile lr_mhi_ac_ctrl.yaml
INFO ESPHome 2024.2.2
INFO Reading configuration lr_mhi_ac_ctrl.yaml...
WARNING 'mhi_ac_ctr_bedroom': Using the '_' (underscore) character in the hostname is discouraged as it can cause problems with some DHCP and local name services. For more information, see https://esphome.io/guides/faq.html#why-shouldn-t-i-use-underscores-in-my-device-name
but it compiles.
With
deviceid: "mhi-ac-ctr-bedroom"
lr_mhi_ac_ctrl.yaml
$ esphome compile lr_mhi_ac_ctrl.yaml
INFO ESPHome 2024.2.2
INFO Reading configuration lr_mhi_ac_ctrl.yaml...
Failed config
climate.custom: [source lr_mhi_ac_ctrl.yaml:48]
platform: custom
lambda: |-
auto mhi_ac_ctrl = new MhiAcCtrl();
App.register_component(mhi_ac_ctrl);
return {mhi_ac_ctrl};
climates:
- name: none
Dashes are not supported in IDs, please use underscores instead.
id: mhi-ac-ctr-bedroom
doesn't compile.
arpiecodes commented
You cannot use dashes (-) in your device ID's. So change those deviceid: "mhi-ac-ctr-bedroom"
to device: "mhi_ac_ctr_bedroom"
and you should be good to go.
RobertJansen1 commented
This is fixed in a future yaml file, as the example has a clear - and _ usage