a2633063
发表于 2020-4-13 09:30:47
余歌唱晚 发表于 2020-4-12 20:03
用上了,就是M1的亮度是不是还有优化的空间 wifi图标特别亮
M1的版本才更新优化此问题app上点版本号更新
ghostist
发表于 2020-4-13 09:35:05
余歌唱晚 发表于 2020-4-12 20:03
用上了,就是M1的亮度是不是还有优化的空间 wifi图标特别亮
最新版本作者修复了这个问题欢迎加群测试~
oosee
发表于 2020-4-13 23:41:42
zM1已更新0.8,WIFI亮度一致了,接入homeassistan后用light方式自动化很容易实现定时亮屏息屏。再次感谢。
# ----------------------------------
- id: '1999666935551'
alias: 自动开
description: ''
trigger:
- at: '08:00:00'#早上8点开
platform: time
condition: []
action:
- entity_id: light.zm1_MAC_brightness
service: light.turn_on
- id: '1999666681661'
alias: 自动关
description: ''
trigger:
- at: '00:00:00'#晚上12点关
platform: time
condition: []
action:
- entity_id: light.zm1_MAC_brightness
service: light.turn_off
# ----------------------------------
cooltigers
发表于 2020-4-18 19:00:58
TC1接入HASS ,且用GOOGLE 声控,现在想问一下,2个TC1怎么接入HASS
cooltigers
发表于 2020-4-18 19:04:04
大神,你真的是太伟大了,按你的贴子,成功把TC1接入HASS,现在又入手一个,你能给个多TC1接入HASS的模板吗?
oosee
发表于 2020-4-18 19:44:53
cooltigers 发表于 2020-4-18 19:00
TC1接入HASS ,且用GOOGLE 声控,现在想问一下,2个TC1怎么接入HASS
保证以下 name字段唯一性!!
比如你的配置文件是ztc1.yaml:
switch:
#TC1A
- platform: mqtt
name: 'ztc1_1_TC1A-MAC'
state_topic: 'device/ztc1/TC1A-MAC/state'
command_topic: 'device/ztc1/TC1A-MAC/set'
payload_on: '{"mac":"TC1A-MAC","plug_0":{"on":1}}'
payload_off: '{"mac":"TC1A-MAC","plug_0":{"on":0}}'
value_template: '{{ value_json.plug_0.on }}'
state_on: '1'
state_off: '0'
................................省略一万字
#TC1B
- platform: mqtt
name: 'ztc1_1_TC1B-MAC'
state_topic: 'device/ztc1/TC1B-MAC/state'
command_topic: 'device/ztc1/TC1B-MAC/set'
payload_on: '{"mac":"TC1B-MAC","plug_0":{"on":1}}'
payload_off: '{"mac":"TC1B-MAC","plug_0":{"on":0}}'
value_template: '{{ value_json.plug_0.on }}'
state_on: '1'
state_off: '0'
................................省略一万字
sensor:
#TC1A
- platform: mqtt
name: 'ztc1_time_TC1A-MAC'
state_topic: 'device/ztc1/TC1A-MAC/sensor'
icon: 'mdi:av-timer'
................................省略一万字
#TC1B
- platform: mqtt
name: 'ztc1_time_TC1B-MAC'
state_topic: 'device/ztc1/TC1B-MAC/sensor'
icon: 'mdi:av-timer'
................................省略一万字
homeassistant:
customize:
#TC1A
sensor.ztc1_time_TC1A-MAC:
friendly_name: 运行时间
................................省略一万字
#TC1B
sensor.ztc1_time_TC1B-MAC:
friendly_name: 运行时间
................................省略一万字
cooltigers
发表于 2020-4-18 23:27:38
本帖最后由 cooltigers 于 2020-4-18 23:28 编辑
oosee 发表于 2020-4-18 19:44
保证以下 name字段唯一性!!
比如你的配置文件是ztc1.yaml:
我写到configuration .yaml 这个文件里行不行?
内容如不,如行说,2行,和76行有错
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switch:
#TC1A
- platform: mqtt
name: 'ztc1_1_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_0":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_0":{"on":0}}'
value_template: '{{ value_json.plug_0.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_2_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_1":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_1":{"on":0}}'
value_template: '{{ value_json.plug_1.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_3_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_2":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_2":{"on":0}}'
value_template: '{{ value_json.plug_2.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_4_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_3":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_3":{"on":0}}'
value_template: '{{ value_json.plug_3.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_5_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_4":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_4":{"on":0}}'
value_template: '{{ value_json.plug_4.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_6_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_5":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_5":{"on":0}}'
value_template: '{{ value_json.plug_5.on }}'
state_on: '1'
state_off: '0'
#TC1B
- platform: mqtt
name: 'ztc1_1_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_0":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_0":{"on":0}}'
value_template: '{{ value_json.plug_0.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_2_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_1":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_1":{"on":0}}'
value_template: '{{ value_json.plug_1.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_3_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_2":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_2":{"on":0}}'
value_template: '{{ value_json.plug_2.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_4_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_3":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_3":{"on":0}}'
value_template: '{{ value_json.plug_3.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_5_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_4":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_4":{"on":0}}'
value_template: '{{ value_json.plug_4.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_6_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_5":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_5":{"on":0}}'
value_template: '{{ value_json.plug_5.on }}'
state_on: '1'
state_off: '0'
sensor:
#TC1A
- platform: mqtt
name: 'ztc1_power_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/sensor'
unit_of_measurement: 'W'
icon: 'mdi:gauge'
value_template: '{{ value_json.power }}'
- platform: mqtt
name: 'ztc1_time_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/sensor'
#unit_of_measurement: '秒'
icon: 'mdi:gauge'
#value_template: '{{ value_json.total_time }}'
value_template: >-
{% set time = value_json.total_time %}
{% set minutes = ((time % 3600) / 60) | int %}
{% set hours = ((time % 86400) / 3600) | int %}
{% set days = (time / 86400) | int %}
{%- if time < 60 -%}
<1分钟
{%- else -%}
{%- if days > 0 -%}
{{ days }}天
{%- endif -%}
{%- if hours > 0 -%}
{{ hours }}小时
{%- endif -%}
{%- if minutes > 0 -%}
{{ minutes }}分钟
{%- endif -%}
{%- endif -%}
#TC2
- platform: mqtt
name: 'ztc1_power_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/sensor'
unit_of_measurement: 'W'
icon: 'mdi:gauge'
value_template: '{{ value_json.power }}'
- platform: mqtt
name: 'ztc1_time_d0bae4632e62'
state_topic: 'device/ztc1/d0bae463b505/sensor'
#unit_of_measurement: '秒'
icon: 'mdi:gauge'
#value_template: '{{ value_json.total_time }}'
value_template: >-
{% set time = value_json.total_time %}
{% set minutes = ((time % 3600) / 60) | int %}
{% set hours = ((time % 86400) / 3600) | int %}
{% set days = (time / 86400) | int %}
{%- if time < 60 -%}
<1分钟
{%- else -%}
{%- if days > 0 -%}
{{ days }}天
{%- endif -%}
{%- if hours > 0 -%}
{{ hours }}小时
{%- endif -%}
{%- if minutes > 0 -%}
{{ minutes }}分钟
{%- endif -%}
{%- endif -%}
homeassistant:
customize:
#tc1A
switch.ztc1_1_d0bae4632e62:
friendly_name: 打印机
switch.ztc1_2_d0bae4632e62:
friendly_name: 电脑主机
switch.ztc1_3_d0bae4632e62:
friendly_name: 书房摄像头
switch.ztc1_4_d0bae4632e62:
friendly_name: 电脑显示器
switch.ztc1_5_d0bae4632e62:
friendly_name: 服务器
switch.ztc1_6_d0bae4632e62:
friendly_name: 书房路由器
sensor.ztc1_power_d0bae4632e62:
friendly_name: zTC1功率
sensor.ztc1_time_d0bae4632e62:
friendly_name: zTC1运行时间
#TC2
switch.ztc1_1_d0bae463b505:
friendly_name: S1
switch.ztc1_2_d0bae463b505:
friendly_name: S2
switch.ztc1_3_d0bae463b505:
friendly_name: S3
switch.ztc1_4_d0bae463b505:
friendly_name: S4
switch.ztc1_5_d0bae463b505:
friendly_name: S5
switch.ztc1_6_d0bae463b505:
friendly_name: S6
sensor.ztc1_power_d0bae463b505:
friendly_name: ztc1功率
sensor.ztc1_time_d0bae463b505:
friendly_name: ztc1运行时间
oosee
发表于 2020-4-19 00:25:42
cooltigers 发表于 2020-4-18 23:27
我写到configuration .yaml 这个文件里行不行?
内容如不,如行说,2行,和76行有错
# Configure a defaul ...
完全可以,不过个人觉得这样不容易拍错。。。。
复制粘贴即可,如果提示编码错误,转成UTF-8
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switch:
#tc1A
- platform: mqtt
name: 'ztc1_1_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_0":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_0":{"on":0}}'
value_template: '{{ value_json.plug_0.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_2_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_1":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_1":{"on":0}}'
value_template: '{{ value_json.plug_1.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_3_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_2":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_2":{"on":0}}'
value_template: '{{ value_json.plug_2.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_4_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_3":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_3":{"on":0}}'
value_template: '{{ value_json.plug_3.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_5_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_4":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_4":{"on":0}}'
value_template: '{{ value_json.plug_4.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_6_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/state'
command_topic: 'device/ztc1/d0bae4632e62/set'
payload_on: '{"mac":"d0bae4632e62","plug_5":{"on":1}}'
payload_off: '{"mac":"d0bae4632e62","plug_5":{"on":0}}'
value_template: '{{ value_json.plug_5.on }}'
state_on: '1'
state_off: '0'
#tc1B
- platform: mqtt
name: 'ztc1_1_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_0":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_0":{"on":0}}'
value_template: '{{ value_json.plug_0.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_2_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_1":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_1":{"on":0}}'
value_template: '{{ value_json.plug_1.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_3_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_2":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_2":{"on":0}}'
value_template: '{{ value_json.plug_2.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_4_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_3":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_3":{"on":0}}'
value_template: '{{ value_json.plug_3.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_5_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_4":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_4":{"on":0}}'
value_template: '{{ value_json.plug_4.on }}'
state_on: '1'
state_off: '0'
- platform: mqtt
name: 'ztc1_6_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/state'
command_topic: 'device/ztc1/d0bae463b505/set'
payload_on: '{"mac":"d0bae463b505","plug_5":{"on":1}}'
payload_off: '{"mac":"d0bae463b505","plug_5":{"on":0}}'
value_template: '{{ value_json.plug_5.on }}'
state_on: '1'
state_off: '0'
sensor:
#tc1A
- platform: mqtt
name: 'ztc1_power_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/sensor'
unit_of_measurement: 'W'
icon: 'mdi:gauge'
value_template: '{{ value_json.power }}'
- platform: mqtt
name: 'ztc1_time_d0bae4632e62'
state_topic: 'device/ztc1/d0bae4632e62/sensor'
#unit_of_measurement: '秒'
icon: 'mdi:gauge'
#value_template: '{{ value_json.total_time }}'
value_template: >-
{% set time = value_json.total_time %}
{% set minutes = ((time % 3600) / 60) | int %}
{% set hours = ((time % 86400) / 3600) | int %}
{% set days = (time / 86400) | int %}
{%- if time < 60 -%}
<1分钟
{%- else -%}
{%- if days > 0 -%}
{{ days }}天
{%- endif -%}
{%- if hours > 0 -%}
{{ hours }}小时
{%- endif -%}
{%- if minutes > 0 -%}
{{ minutes }}分钟
{%- endif -%}
{%- endif -%}
#tc1B
- platform: mqtt
name: 'ztc1_power_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/sensor'
unit_of_measurement: 'W'
icon: 'mdi:gauge'
value_template: '{{ value_json.power }}'
- platform: mqtt
name: 'ztc1_time_d0bae463b505'
state_topic: 'device/ztc1/d0bae463b505/sensor'
#unit_of_measurement: '秒'
icon: 'mdi:gauge'
#value_template: '{{ value_json.total_time }}'
value_template: >-
{% set time = value_json.total_time %}
{% set minutes = ((time % 3600) / 60) | int %}
{% set hours = ((time % 86400) / 3600) | int %}
{% set days = (time / 86400) | int %}
{%- if time < 60 -%}
<1分钟
{%- else -%}
{%- if days > 0 -%}
{{ days }}天
{%- endif -%}
{%- if hours > 0 -%}
{{ hours }}小时
{%- endif -%}
{%- if minutes > 0 -%}
{{ minutes }}分钟
{%- endif -%}
{%- endif -%}
homeassistant:
customize:
#tc1A
switch.ztc1_1_d0bae4632e62:
friendly_name: 打印机
switch.ztc1_2_d0bae4632e62:
friendly_name: 电脑主机
switch.ztc1_3_d0bae4632e62:
friendly_name: 书房摄像头
switch.ztc1_4_d0bae4632e62:
friendly_name: 电脑显示器
switch.ztc1_5_d0bae4632e62:
friendly_name: 服务器
switch.ztc1_6_d0bae4632e62:
friendly_name: 书房路由器
sensor.ztc1_power_d0bae4632e62:
friendly_name: zTC1功率
sensor.ztc1_time_d0bae4632e62:
friendly_name: zTC1运行时间
#tc1B
switch.ztc1_1_d0bae463b505:
friendly_name: S1
switch.ztc1_2_d0bae463b505:
friendly_name: S2
switch.ztc1_3_d0bae463b505:
friendly_name: S3
switch.ztc1_4_d0bae463b505:
friendly_name: S4
switch.ztc1_5_d0bae463b505:
friendly_name: S5
switch.ztc1_6_d0bae463b505:
friendly_name: S6
sensor.ztc1_power_d0bae463b505:
friendly_name: ztc1功率
sensor.ztc1_time_d0bae463b505:
friendly_name: ztc1运行时间
colock
发表于 2020-4-19 09:56:14
M1A1连动后能给个完整的说明打包吗?现在图都废了一张都看不了。谢谢。。
余歌唱晚
发表于 2020-4-22 23:23:57
a2633063 发表于 2020-4-13 09:30
M1的版本才更新优化此问题app上点版本号更新
感谢大佬告知
页:
1
2
3
4
5
6
[7]
8
9
10
11
12
13
14