找回密码
 立即注册
img_loading
智能检测中

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888广告投放联系QQ68610888
查看: 1499|回复: 0

[N1盒子] n1刷homeassistant找不到实体咋解决 ?

[复制链接]
发表于 2020-7-19 20:39 | 显示全部楼层 |阅读模式


configuration.yaml

  1. homeassistant:
  2.   # Name of the location where Home Assistant is running
  3.   name: Home
  4.   # Location required to calculate the time the sun rises and sets
  5.   latitude: 23.1000
  6.   longitude: 113.2500
  7.   # Impacts weather/sunrise data (altitude above sea level in meters)
  8.   elevation: 0
  9.   # metric for Metric, imperial for Imperial
  10.   unit_system: imperial
  11.   # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  12.   time_zone: America/Los_Angeles
  13.   # Customization file
  14.   #customize: !include customize.yaml

  15. # Show links to resources in log and frontend
  16. introduction:

  17. recorder:
  18.   purge_interval: 1
  19.   purge_keep_days: 5

  20. # Enables the frontend
  21. frontend:

  22. # Enables configuration UI
  23. config:

  24. # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  25. # http:
  26. #   base_url: example.duckdns.org:8123

  27. # Checks for available updates
  28. # Note: This component will send some information about your system to
  29. # the developers to assist with development of Home Assistant.
  30. # For more information, please see:
  31. # https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
  32. updater:
  33.   # Optional, allows Home Assistant developers to focus on popular components.
  34.   # include_used_components: true

  35. # Discover some devices automatically
  36. discovery:

  37. # Allows you to issue voice commands from the frontend in enabled browsers
  38. conversation:

  39. # Enables support for tracking state changes over time
  40. history:

  41. # View all events in a logbook
  42. logbook:

  43. # Enables a map showing the location of tracked devices
  44. map:

  45. # Track the sun
  46. sun:

  47. # Weather prediction
  48. sensor:
  49.   - platform: yr

  50. # Text to speech
  51. tts:
  52.   - platform: google

  53. # Cloud
  54. cloud:

  55. group: !include groups.yaml
  56. automation: !include automations.yaml
  57. script: !include scripts.yaml
  58. homeassistant:
  59.         packages: !include_dir_named packages

  60. mqtt:
  61.    broker:192.168.1.174
  62.    username:admin
  63.    password:123456

  64. homekit:
复制代码



packages目录下m1.yaml文件内容

  1. sensor:
  2.   - platform: mqtt
  3.     name: 'zm1_b0f89324168c_temperature'
  4.     # friendly_name: 温度
  5.     state_topic: 'device/zm1/b0f89324168c/sensor'
  6.     unit_of_measurement: '°C'
  7.     icon: 'mdi:thermometer'
  8.     value_template: '{{ value_json.temperature }}'
  9.   - platform: mqtt
  10.     name: 'zm1_b0f89324168c_humidity'
  11.     # friendly_name: 湿度
  12.     state_topic: 'device/zm1/b0f89324168c/sensor'
  13.     unit_of_measurement: '%'
  14.     icon: mdi:water-percent
  15.     value_template: '{{ value_json.humidity }}'
  16.   - platform: mqtt
  17.     name: 'zm1_b0f89324168c_pm25'
  18.     # friendly_name: PM25
  19.     state_topic: 'device/zm1/b0f89324168c/sensor'
  20.     unit_of_measurement: 'μg/m3'
  21.     icon: mdi:blur
  22.     value_template: '{{ value_json.PM25 }}'
  23.   - platform: mqtt
  24.     name: 'zm1_b0f89324168c_hcho'
  25.     # friendly_name: 甲醛
  26.     state_topic: 'device/zm1/b0f89324168c/sensor'
  27.     unit_of_measurement: 'mg/m3'
  28.     icon: mdi:chemical-weapon
  29.     value_template: '{{ value_json.formaldehyde }}'

  30. light:
  31.   - platform: mqtt
  32.     name: zm1_b0f89324168c_brightness
  33.     schema: template
  34.     command_topic: "device/zm1/b0f89324168c/set"
  35.     state_topic: "device/zm1/b0f89324168c/state"
  36.     command_on_template: >
  37.       {"mac": "b0f89324168c"
  38.       {%- if brightness is defined -%}
  39.       , "brightness": {{ ((brightness-1) / 64 )|int +1 }}
  40.       {%- else -%}
  41.       , "brightness": 4
  42.       {%- endif -%}
  43.       }
  44.     command_off_template: '{"mac": "b0f89324168c", "brightness": 0}'
  45.     state_template: >
  46.       {%- if value_json.brightness == 0 -%}
  47.         off
  48.       {%- else -%}
  49.         on
  50.       {%- endif -%}
  51.     brightness_template: >
  52.       {%- if value_json.brightness is defined -%}
  53.         {{ ( value_json.brightness *64 )|int }}
  54.       {%- endif -%}


  55. homeassistant:
  56.   customize:
  57.     light.zm1_b0f89324168c_brightness:
  58.       friendly_name: 卧室M1亮度
  59.     sensor.zm1_b0f89324168c_temperature:
  60.       friendly_name: 卧室温度
  61.     sensor.zm1_b0f89324168c_humidity:
  62.       friendly_name: 卧室湿度
  63.     sensor.zm1_b0f89324168c_pm25:
  64.       friendly_name: 卧室PM2.5
  65.     sensor.zm1_b0f89324168c_hcho:
  66.       friendly_name: 卧室甲醛
复制代码


本帖子中包含更多资源

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

×
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应。胡乱输入灌水等操作将会被封禁ID。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛

只谈技术、莫论政事!切勿转播谣言!为了你也为了他人。
只谈技术、莫论政事!(点击见详情) 切记不要随意传播谣言,把自己的日子过安稳了就行,为了自己好也为了大家好。 恩山无线论坛欢迎您的来访,请互相尊重、友善交流,建议保持一颗平常心看待网友的评论,切勿过度反应。

查看 »

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

GMT+8, 2025-7-16 00:32

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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

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