找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4091|回复: 3

[其他设备] DC1已经刷固件也接入hass 问题是这个界面

[复制链接]
发表于 2019-4-3 19:36 | 显示全部楼层 |阅读模式
怎么改成你们那些中文界面 电压显示那些怎么改?他的.yaml文件是刷进去的
  1. esphome:
  2.   name: $device_name
  3.   platform: ESP8266
  4.   board: $board_model
  5.   esphome_core_version:
  6.     #指定esphome_core来源
  7.     #指定本地来源
  8.     #local: path/to/esphome-core
  9.     #指定外部来源
  10.     repository: https://github.com/Samuel-0-0/esphome-core.git
  11.     branch: dc1
  12.   build_path: build\$device_name
  13.   esp8266_restore_from_flash: yes
  14.   arduino_version: 2.5.0
  15.   platformio_options:
  16.     #指定platform-espressif8266来源
  17.     platform: https://github.com/Samuel-0-0/platform-espressif8266.git#dc1

  18. #--------------------- 只需要改这下面的内容 ---------------------
  19. substitutions:
  20.   #WiFi芯片版本,型号中带B的为csm64f02_b,不带B的为csm64f02
  21.   board_model: csm64f02_b
  22.   #设备名称(多个dc1改成不一样的)
  23.   device_name: phicomm_dc1
  24.   #WiFi_SSID名称
  25.   wifi_ssid: 'ChinaNet-MeK9'
  26.   #WiFi密码
  27.   wifi_password: '7xzgrc3g'
  28.   #如果SSID是隐藏的,设置为true
  29.   wifi_fast_connect: 'false'
  30.   #WiFi离线多久后重启设备,秒s/分钟min/小时h,不需要此功能设置为0s
  31.   wifi_reboot_timeout: 600s
  32.   #OTA密码
  33.   ota_password: '123456'
  34.   #与客户端(如Home Assistant)失去连接多久后重启设备,秒s/分钟min/小时h,不需要此功能设置为0s
  35.   api_reboot_timeout: 600s
  36.   #电量统计的数据更新时间,秒s/分钟min/小时h
  37.   cse7766_update_interval: 1s
  38. #--------------------- 只需要改这上面的内容 ---------------------

  39. wifi:
  40.   ssid: $wifi_ssid
  41.   password: $wifi_password
  42. #需要设置静态地址的改下面的配置
  43. #  manual_ip:
  44. #    static_ip: 192.168.178.230
  45. #    gateway: 192.168.178.1
  46. #    subnet: 255.255.255.0
  47. #    dns1: 1.1.1.1
  48. #    dns2: 1.2.2.1
  49.   domain: .local
  50.   reboot_timeout: $wifi_reboot_timeout
  51.   power_save_mode: none
  52.   fast_connect: $wifi_fast_connect

  53. #不使用api与设备连接的话删除api配置
  54. api:
  55.   reboot_timeout: $api_reboot_timeout

  56. ota:
  57.   safe_mode: true
  58.   password: $ota_password
  59. #  port: 3286

  60. #web_server:
  61. #  port: 80
  62. #  css_url: https://esphome.io/_static/webserver-v1.min.css
  63. #  js_url: https://esphome.io/_static/webserver-v1.min.js

  64. #deep_sleep:
  65. #  run_duration: 20s
  66. #  sleep_duration: 50s

  67. i2c:
  68.   sda: GPIO3
  69.   scl: GPIO12
  70.   scan: false
  71.   frequency: 20kHz

  72. cat9554:
  73.   - id: cat9554_hub
  74.     address: 0x20
  75.     irq: GPIO4

  76. uart:
  77.   rx_pin: GPIO13
  78.   baud_rate: 4800

  79. #debug:

  80. logger:
  81. #  hardware_uart: UART1
  82. #  level: DEBUG
  83.   level: info

  84. sensor:
  85.   - platform: cse7766
  86.     voltage:
  87.       name: "${device_name} voltage"
  88.     current:
  89.       name: "${device_name} current"
  90.     power:
  91.       name: "${device_name} power"
  92.     update_interval: $cse7766_update_interval
  93.   - platform: uptime
  94.     name: "${device_name} uptime"
  95.   - platform: wifi_signal
  96.     name: "${device_name} wifi_signal"

  97. binary_sensor:
  98.   - platform: status
  99.     #设备状态
  100.     name: "${device_name} status"
  101.     #是否对外隐藏(true/false)
  102.     internal: false
  103.   - platform: gpio
  104.     #第一个按钮(内部引用,对外隐藏)
  105.     name: "${device_name} key1"
  106.     #是否对外隐藏(true/false)
  107.     internal: true
  108.     pin:
  109.       cat9554: cat9554_hub
  110.       # Use pin number 0
  111.       number: 0
  112.       mode: INPUT
  113.     filters:
  114.       - invert:
  115.       - delayed_on: 40ms
  116.       - delayed_off: 40ms
  117.     on_click:
  118.       - min_length: 50ms
  119.         max_length: 350ms
  120.         then:
  121.           - switch.toggle: switch1
  122.   - platform: gpio
  123.     #第二个按钮(内部引用,对外隐藏)
  124.     name: "${device_name} key2"
  125.     #是否对外隐藏(true/false)
  126.     internal: true
  127.     pin:
  128.       cat9554: cat9554_hub
  129.       # Use pin number 1
  130.       number: 1
  131.       mode: INPUT
  132.     filters:
  133.       - invert:
  134.       - delayed_on: 40ms
  135.       - delayed_off: 40ms
  136.     on_click:
  137.       - min_length: 50ms
  138.         max_length: 350ms
  139.         then:
  140.           - switch.toggle: switch2
  141.   - platform: gpio
  142.     #第三个按钮(内部引用,对外隐藏)
  143.     name: "${device_name} key3"
  144.     #是否对外隐藏(true/false)
  145.     internal: true
  146.     pin:
  147.       cat9554: cat9554_hub
  148.       # Use pin number 2
  149.       number: 2
  150.       mode: INPUT
  151.     filters:
  152.       - invert:
  153.       - delayed_on: 40ms
  154.       - delayed_off: 40ms
  155.     on_click:
  156.       - min_length: 50ms
  157.         max_length: 350ms
  158.         then:
  159.           - switch.toggle: switch3
  160.   - platform: gpio
  161.     #总开关(内部引用,对外隐藏)
  162.     name: "${device_name} key0"
  163.     #是否对外隐藏(true/false)
  164.     id: key0
  165.     internal: true
  166.     pin:
  167.       number: GPIO16
  168.       mode: INPUT_PULLDOWN_16
  169.     filters:
  170.       - invert:
  171.       - delayed_on: 40ms
  172.       - delayed_off: 40ms
  173.     on_click:
  174.       - min_length: 50ms
  175.         max_length: 350ms
  176.         then:
  177.           - switch.toggle: switch0
  178.   #影子
  179.   - platform: template
  180.     name: "shadow1"
  181.     id: shadow1
  182.     internal: true
  183.   - platform: template
  184.     name: "shadow2"
  185.     id: shadow2
  186.     internal: true
  187.   - platform: template
  188.     name: "shadow3"
  189.     id: shadow3
  190.     internal: true
  191.    
  192. #WiFi状态灯
  193. status_led:
  194.   pin: GPIO0

  195. text_sensor:
  196.   - platform: template
  197.     #配置文件版本
  198.     name: "${device_name} config_version"
  199.     lambda: |-
  200.       return {"v2019.03.28.002"};
  201.   - platform: version
  202.     #esphome版本
  203.     name: "${device_name} esphome_version"
  204.     icon: mdi:information-outline
  205.   - platform: wifi_info
  206.     ip_address:
  207.       name: "${device_name} IP Address"
  208.     ssid:
  209.       name: "${device_name} Connected SSID"
  210. #    bssid:
  211. #      name: "${device_name} Connected BSSID"

  212. output:
  213.   - platform: gpio
  214.     #继电器3(内部引用,对外隐藏)
  215.     id: realy3
  216.     pin:
  217.       cat9554: cat9554_hub
  218.       # Use pin number 4
  219.       number: 4
  220.       mode: OUTPUT
  221.       inverted: false
  222.   - platform: gpio
  223.     #继电器2(内部引用,对外隐藏)
  224.     id: realy2
  225.     pin:
  226.       cat9554: cat9554_hub
  227.       # Use pin number 5
  228.       number: 5
  229.       mode: OUTPUT
  230.       inverted: false
  231.   - platform: gpio
  232.     #继电器1(内部引用,对外隐藏)
  233.     id: realy1
  234.     pin:
  235.       cat9554: cat9554_hub
  236.       # Use pin number 6
  237.       number: 6
  238.       mode: OUTPUT
  239.       inverted: false
  240.   - platform: gpio
  241.     #总继电器(内部引用,对外隐藏)
  242.     id: realy0
  243.     pin:
  244.       cat9554: cat9554_hub
  245.       # Use pin number 7
  246.       number: 7
  247.       mode: OUTPUT
  248.       inverted: false

  249. switch:
  250.   - platform: output
  251.     #总开关(显示为一个开关)
  252.     name: "${device_name} switch0"
  253.     output: realy0
  254.     id: switch0
  255.     on_turn_on:
  256.       - switch.turn_on: LOGO_light
  257.       - lambda: |-
  258.           if (id(shadow1).state) {
  259.             id(switch1).turn_on();
  260.             id(shadow1).publish_state(false);
  261.           }
  262.           if (id(shadow2).state) {
  263.             id(switch2).turn_on();
  264.             id(shadow2).publish_state(false);
  265.           }
  266.           if (id(shadow3).state) {
  267.             id(switch3).turn_on();
  268.             id(shadow3).publish_state(false);
  269.           }
  270.     on_turn_off:
  271.       - switch.turn_off: LOGO_light
  272.       - lambda: |-
  273.           if (id(switch1).state) {
  274.             id(switch1).turn_off();
  275.             id(shadow1).publish_state(true);
  276.           }
  277.           if (id(switch2).state) {
  278.             id(switch2).turn_off();
  279.             id(shadow2).publish_state(true);
  280.           }
  281.           if (id(switch3).state) {
  282.             id(switch3).turn_off();
  283.             id(shadow3).publish_state(true);
  284.           }
  285.   - platform: output
  286.     #开关1(显示为一个开关)
  287.     name: "${device_name} switch1"
  288.     output: realy1
  289.     id: switch1
  290.     on_turn_on:
  291.       - lambda: |-
  292.           if (!id(switch0).state) {
  293.             id(switch0).turn_on();
  294.           }
  295.   - platform: output
  296.     #开关2(显示为一个开关)
  297.     name: "${device_name} switch2"
  298.     output: realy2
  299.     id: switch2
  300.     on_turn_on:
  301.       - lambda: |-
  302.           if (!id(switch0).state) {
  303.             id(switch0).turn_on();
  304.           }
  305.   - platform: output
  306.     #开关3(显示为一个开关)
  307.     name: "${device_name} switch3"
  308.     output: realy3
  309.     id: switch3
  310.     on_turn_on:
  311.       - lambda: |-
  312.           if (!id(switch0).state) {
  313.             id(switch0).turn_on();
  314.           }
  315.   - platform: gpio
  316.     pin: GPIO14
  317.     #LOGO灯
  318.     name: "${device_name} LOGO_light"
  319.     id: LOGO_light
  320.     internal: false
  321.     inverted: true
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
发表于 2019-4-4 15:37 | 显示全部楼层
你怎么刷的,我现在有ch341不知道能不能当TTL
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

发表于 2019-4-17 23:46 | 显示全部楼层
能分享下您的刷固件过程么?我刷了好多次,都不成功。已经拆了3个插排了。
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

发表于 2019-12-25 16:43 | 显示全部楼层
没头没脑不知所云
只谈技术、莫论政事!(点击见详情) | 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-9-28 08:13

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com

快速回复 返回顶部 返回列表