-
Notifications
You must be signed in to change notification settings - Fork 79
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
请教多台M1设备连接HA的方法。 #51
Comments
请贴错误提示,正常不会有重复的提示 |
感谢你的回复,已经发现问题了。有同样问题的朋友可以参考下面的代码。 第一台代码:
|
问题已经解决,多个light
|
这里小横杠打不出来,变成点了。。。。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
发现以一下代码添加多台后,有错误提示。MAC地址已经修改,但还是一直提示名字冲突。
第一台代码:
light:
name: zm1_b0f89326ff10_brightness
unique_id: zm1_b0f89326ff10_brightness
schema: template
command_topic: "device/zm1/b0f89326ff10/set"
state_topic: "device/zm1/b0f89326ff10/state"
command_on_template: >
{"mac": "b0f89326ff10"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "b0f89326ff10", "brightness": 0}'
state_template: >
{%- if value_json.brightness == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: >
{%- if value_json.brightness is defined -%}
{{ ( value_json.brightness *64 )|int }}
{%- endif -%}
第二台代码:
light:
name: zm1_b0f89323adaa_brightness
unique_id: zm1_b0f89323adaa_brightness
schema: template
command_topic: "device/zm1/b0f89323adaa/set"
state_topic: "device/zm1/b0f89323adaa/state"
command_on_template: >
{"mac": "b0f89323adaa"
{%- if brightness is defined -%}
, "brightness": {{ ((brightness-1) / 64 )|int +1 }}
{%- else -%}
, "brightness": 4
{%- endif -%}
}
command_off_template: '{"mac": "b0f89323adaa", "brightness": 0}'
state_template: >
{%- if value_json.brightness == 0 -%}
off
{%- else -%}
on
{%- endif -%}
brightness_template: >
{%- if value_json.brightness is defined -%}
{{ ( value_json.brightness *64 )|int }}
{%- endif -%}
请教还需要修改哪里?
The text was updated successfully, but these errors were encountered: