MHI-AC-Ctrl-ESPHome icon indicating copy to clipboard operation
MHI-AC-Ctrl-ESPHome copied to clipboard

Dashes are not supported in IDs, please use underscores instead.

Open Lieta2 opened this issue 11 months ago • 1 comments

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.

Lieta2 avatar Mar 14 '24 08:03 Lieta2

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.

arpiecodes avatar Mar 30 '24 09:03 arpiecodes

This is fixed in a future yaml file, as the example has a clear - and _ usage

RobertJansen1 avatar Aug 30 '24 12:08 RobertJansen1