Giter Site home page Giter Site logo

ha_baidu_map's Introduction

本插件停止更新,推荐使用新版插件:https://github.com/shaonianzhentan/google_maps

关注我的微信订阅号,了解更多HomeAssistant相关知识

HomeAssistant家庭助理

百度地图

在HA里使用的百度地图,支持GPS定位轨迹显示

使用方式

不懂就看视频哈

ha_baidu_map:
  ak: 百度地图【浏览器的浏览器的浏览器的AK密钥】 - 如果不会配置ak就把这行删掉,初次安装空白就刷新一下页面

在GPSLogger应用里的配置

http://IP:8123/ha_baidu_map-location-【自动生成的key】?entity_id=【实体ID】&latitude=%LAT&longitude=%LON&battery=%BATT&sts=%STARTTIMESTAMP

更新日志

v2.4.3

  • 修复地图点击后出现地点详情的问题
  • 增加设备里的编码地理位置显示
  • 隐藏百度地图版权信息
  • 调整头部高度样式
  • 支持集成添加

v2.4

  • 将百度HTTP协议改为HTTPS
  • 移除隐藏默认地图功能
  • 新增定位数据添加接口
  • 修复不显示person实体的问题
  • 更换实体名称
  • 添加地图卡片
  • 不是管理员也能显示百度地图侧边栏

v2.3

  • 修复图标不显示的问题
  • 右上角新增编辑图标

v2.2

  • 修复在HA的APP中无法加载GPS轨迹的问题
  • 解决移动端不能点击实体的问题

v2.1

  • 修复https下无法加载接口的问题

v2.0

  • 修改为本地json文件存储(文件在.storage/ha_baidu_map/)
  • 支持多设备分类记录
  • 修复设备多次重复记录问题
  • 支持配置隐藏自带地图

v1.0.5

  • 修复菜单图标一直显示的问题

v1.0.4(测试版)

  • 加入数据库存储(目前只支持HA自带的数据库)
  • 加入GPS运动轨迹显示

v1.0

  • 区域设置passive属性为true会自动隐藏(同官方地图)
  • 设备设置hidden属性为true会自动隐藏(同官方地图)
  • 修复更新坐标时,会出现重复的问题
  • 修复多个区域无法加载的问题
  • 修复头像和官方地图显示不一致的问题
  • 加入区域可以点击查看的功能(这个官方没有)

如果这个项目对你有帮助,请我喝杯咖啡奶茶吧😘

支付宝 微信
支付宝 微信支付

ha_baidu_map's People

Contributors

shaonianzhentan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ha_baidu_map's Issues

日志一直在报错

2020-02-03 00:49:55 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/pi/.homeassistant/custom_components/ha_baidu_map/init.py", line 74, in interval
attr = dict(state.attributes)
AttributeError: 'NoneType' object has no attribute 'attributes'
一直报这个错,看不明白代码,如何解决

最新版貌似系统出现报错!?

HA日志:
Logger: frontend.js.latest.202108040
Source: components/system_log/init.py:190
First occurred: 17:36:50 (15 occurrences)
Last logged: 20:21:07
http://:8123/ha_baidu_map-local/2.4.3/ha-panel-baidu-map.js:759:120 Uncaught TypeError: Cannot read property 'attributes' of undefined
http://
:8123/ha_baidu_map-local/2.4.3/ha-panel-baidu-map.js:759:120 TypeError: undefined is not an object (evaluating 'this._hass.states[entity_id]['attributes']')
:0:0 Script error.
最后一个报错之前就有,但是清除浏览器缓存可以消失,时常复现,升级最新版之后出现上面两个。
再次感谢大佬的集成!

能否考虑加个纠偏功能的开关

因为车辆GPS得到的是高德经纬度,转为百度经纬度后在百度坐标拾取里查询定位准确,但在插件中定位偏移了。调用百度纠偏接口后再查询坐标拾取其偏移位置和插件位置一致,应该是纠偏导致了位置的偏移。

打开GPS运动轨迹时间是空白的

你好大佬,我在好几个主机中都发现,设备在地图中显示是正常的,但是打开GPS运动轨迹页面是空白的页面,什么都没有,GPS轨迹记录没法用,希望能帮忙找一下原因,感谢!

Home Assistant 升级到core-2021.6.1后报错

版本 | core-2021.6.1
前端版本: 20210603.0 - latest

错误日志:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/homeassistant/init.py:161
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 09:33:18 (2 occurrences)
Last logged: 09:38:33

[140673840394144] The system cannot restart because the configuration is not valid: Component error: ha_baidu_map - Integration 'ha_baidu_map' not found.
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1491, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1526, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 728, in admin_handler
await result
File "/usr/src/homeassistant/homeassistant/components/homeassistant/init.py", line 161, in async_handle_core_service
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Component error: ha_baidu_map - Integration 'ha_baidu_map' not found.

0.105.3版本能用吗?

ha_baidu_map: name: 百度地图 icon: mdi:map-marker-radius ak: TWx3d69uSA2TeVZr7voEA0rQyiGRe9e2 map: hidden record: - device_tracker.tourage
在config里这么写入了,然后就一直报错,显示找不到ha_baidu_map,文件目录是/homeassistant/custom_components

gpsloger

gpsloger配置按你的说明没搞定,文中那段加http内容????
http://..*:8123/ha_baidu_map-location-ge0URp8SGyAHd0D8DbjsAcnZAGaZF5?entity_id=device_tracker.mate9&latitude=%LAT&longitude=%LON&battery=%BATT&sts=%STARTTIMESTAMP

报错了。。。请教。

Configure a default setup of Home Assistant (frontend, api, etc)

default_config:

Text to speech

tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

ha_baidu_map:
ak:oOzBCaXzWa9f3oPvxxxx后面的隐藏了哈
homekit:

以上是我的配置文件,提示

Invalid config
The following integrations and platforms could not be set up:

ha_baidu_map

Please check your config.

没有搞懂为什么。。。

ha升级最新版本2021.04.06版后,集成没法加载和使用

2021-04-28 19:47:29 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'ha_baidu_map'. As of Home Assistant 2021.6, this integration will no longer be loaded. Please report this to the maintainer of 'ha_baidu_map'

AttributeError: 'str' object has no attribute 'get'

Logger: homeassistant.setup
Source: custom_components/ha_baidu_map/init.py:17
First occurred: 下午8:10:43 (1 occurrences)
Last logged: 下午8:10:43

Error during setup of component ha_baidu_map
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
result = await task
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/ha_baidu_map/init.py", line 17, in setup
_name = cfg.get('name', '百度地图')
AttributeError: 'str' object has no attribute 'get'

申请了浏览器AK
ha_baidu_map:
ak:cwSYQbW4G0aoY***********OLtYEc

配置了AK会报错。 不配置正常。
请教一下

地图无法显示

系统最新的 Raspbian
Home Assistant 0.104.3

配置
ha_baidu_map:
name: 百度地图
icon: mdi:map-marker-radius
ak: 自己申请的AK

启动 HASS 没有错误日志,能打印出

2020-01-27 20:30:04 INFO (SyncWorker_19) [custom_components.ha_baidu_map] 
-------------------------------------------------------------------

    百度地图【作者QQ:635147515】
    版本:1.0.5    
    项目地址:https://github.com/shaonianzhentan/ha_baidu_map
    
-------------------------------------------------------------------
2020-01-27 20:30:04 INFO (SyncWorker_19) [custom_components.ha_baidu_map] SELECT COUNT(*) as a FROM sqlite_master where type='table' and name='ha_baidu_map'

侧边栏有“百度地图”这一项
但是右边主内容是空白的

1.0.6版本显示不了地图

不知为何之前1.0版本能显示地图,刚刚更新了1.0.6反而显示不了地图,只能看到设备选项,地图一片白。百度地图APK是正常的,额度也够。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.