发两个Lovelace卡片,一个地图一个空气净化器的.

Lovelace Gaode Map Card

hacs_badge

这个是一个基于高德地图API的Lovelace卡片,完全复刻的官方地图卡片,几乎包含了原来卡片的所有功能. 未来可能会支持更多新的技能.

  • 完全复刻官方的卡片
  • 支持前台自定义卡片配置.

预览


HACS 安装

搜索Gaode Map card, 或者手动添加地址安装

手动安装

  1. 下载 cn-map-card.js
  2. 复制到 www\community\lovelace-cn-map
  3. 在Lovelace的resources下添加以下配置
    resources:
      - url: /local/community/lovelace-cn-map/cn-map-card.js
        type: module
    
  4. 在Lovelace视图 views.cards 内部添加卡片配置
      type: 'custom:cn-map-card'
      default_zoom: '9'
      dark_mode: false
      hours_to_show: '168'
      entities:
        - entity: person.a
        - entity: person.b
        - entity: person.c
        - entity: zone.school
        - entity: zone.home
      key: f87e0c9c4f3e1e78f963075d142979f0
      title: Map
    

选项

属性名 类型 默认 描述
title string 选项 卡片标题
entities entity id 必选 需要显示的条目,支持person,zone,device_tracker
default_zoom Number 选项 地图默认缩放等级
dark_mode boolean 选项 地图夜间黑暗模式开关
hours_to_show Number 选项 指定时间内的历史路径,这里是填的是小时
key string 必选 自己去高德申请key,内置的key说不定哪天就失效了.

Lovelace Xiaomi Air Filter Card

hacs_badge

This is a card for Lovelace’s Xiaomi Air Purifier that supports most devices.

Preview

HACS Installation

Search for air filter

Manual Installation

  1. Download air-filter-card.js
  2. Copy to www\community\lovelace-air-filter-card
  3. Add the following to your Lovelace resources
    resources:
      - url: /community_plugin/lovelace-air-filter/air-filter-card.js
        type: module
    
  4. Add the following to your Lovelace config views.cards key
      type: 'custom:air-filter'
      modes:
        - auto
        - silent
        - Strong
      entity: fan.kong_qi_jing_hua_qi
      title: air_filter
      aspect_ratio: '.6'
    

Options

Name Type Default Description
type string Required custom:air-filter
entity entity id Required The entity id of climate
modes array Required Operating mode, currently includes auto,silent,favorite,strong,medium,high,low,humidity,interval
title string optional Card title entity. Example:fan.kong_qi_jing_hua_qi
aspect_ratio Number optional Aspect ratio, Ratio of height to width

厉害了,大神。卡片很漂亮。

泛艺大佬设计,必是精品,感谢分享

高德KEY需要什么类型?试了WEB和JS 都不能加载

js api

贴一下你的配置yaml

你要把自己配置截图贴出来,或者提供详细的logs文件截图,才有人能帮忙解答。

十分抱歉,这是我的配置yamlSnipaste_2020-05-06_23-35-09

贴了 可以帮忙看看嘛

我还没有用过这个,明天上班我先弄弄,看看是咋整的
或者我帮你通知一下作者有空看看?

那不麻烦大佬啦…也别通知作者,怪不好意思的,如果作者碰巧看到的话最好啦 谢谢大佬

image
是不是标点符号呢?

好像是自带的编辑器就是这样的 我用VSCODE这类编辑器是正常的

你试试,以前我记得我掉过如此的坑

我修改了 还是老样子…

要等我明天试试,我复盘给你看。

好的 先谢谢了~~~

泛艺大佬git上回复说已经修复了 还没发布

呃 是这样吗?那我等发布吧,这个插件确实可以,虽然现在地图没加载出来,但是我手机客户端能看到这个面板,之前也有用过一个类似的,经常报错

你好 我现在做了如下操作抓取到了日志:
1:清空当前日志;
2:添加高德面板后,保存高德面板YAML设置,然后去看日志,日志如下:
123123123
3:再次清空日志,然后删掉高德面板后随意找一个面板保存设置,再去查看日志;
4:之前做过报很长错误的日志消失只剩下
> '2020-05-07 10:24:07 ERROR (MainThread) [frontend.js.latest.202003181] http://XXXX/local/leaflet-src.min.js:7:145 Uncaught TypeError: Cannot set property 'L' of undefined'
这个报错应该和高德面板没关系,由此确定之前很长的报错日志应该对应高德面板;
希望大佬帮忙看看,已经使用V1.1版本

我是在电脑上能加载出来,在手机上不行
不能有key这个字段,会和默认的冲突,去掉后win7+chrome可以加载,手机ios客户端上不行
default_zoom字段貌似不生效…