cnk700i / ha_modified_components Goto Github PK
View Code? Open in Web Editor NEW一些经过个人修改的home assistant插件
一些经过个人修改的home assistant插件
HA 2021.7后版本图表曲线不显示,其它正常。
可否更新适配?谢谢
升级到Home Assistant 0.99.1之后不兼容,error如下:
2019-09-25 20:32:05 ERROR (MainThread) [frontend.js.latest.201909181] https://隐藏隐藏/local/custom-lovelace/hf_weather-card/hf_weather-card.js:435:90 TypeError: undefined is not an object (evaluating 'this.weatherObj.attributes.forecast.slice')
{"code":"10000","charge":false,"msg":"查询成功","result":{"HeWeather5":[{"aqi":{"city":{"aqi":"73","qlty":"良","pm25":"53","pm10":"62","no2":"48","so2":"4","co":"1.0","o3":"8"}},"basic":{"city":"海珠","cnty":"**","id":"CN101280108","lat":"23.10313034","lon":"113.26200867","update":{"loc":"2020-02-12 00:35","utc":"2020-02-11 16:35"}},"daily_forecast":[{"astro":{"mr":"20:33","ms":"08:35","sr":"07:01","ss":"18:21"},"cond":{"code_d":"104","code_n":"104","txt_d":"阴","txt_n":"阴"},"date":"2020-02-11","hum":"87","pcpn":"5.1","pop":"80","pres":"1017","tmp":{"max":"18","min":"16"},"uv":"1","vis":"24","wind":{"deg":"-1","dir":"无持续风向","sc":"1-2","spd":"5"}},{"astro":{"mr":"21:37","ms":"09:19","sr":"07:00","ss":"18:21"},"cond":{"code_d":"104","code_n":"306","txt_d":"阴","txt_n":"中雨"},"date":"2020-02-12","hum":"87","pcpn":"1.8","pop":"60","pres":"1013","tmp":{"max":"22","min":"16"},"uv":"2","vis":"25","wind":{"deg":"-1","dir":"无持续风向","sc":"1-2","spd":"10"}},{"astro":{"mr":"22:39","ms":"10:00","sr":"07:00","ss":"18:22"},"cond":{"code_d":"310","code_n":"305","txt_d":"暴雨","txt_n":"小雨"},"date":"2020-02-13","hum":"88","pcpn":"5.1","pop":"80","pres":"1010","tmp":{"max":"20","min":"17"},"uv":"2","vis":"24","wind":{"deg":"87","dir":"东风","sc":"3-4","spd":"22"}},{"astro":{"mr":"23:40","ms":"10:41","sr":"06:59","ss":"18:22"},"cond":{"code_d":"306","code_n":"314","txt_d":"中雨","txt_n":"小到中雨"},"date":"2020-02-14","hum":"86","pcpn":"0.0","pop":"25","pres":"1011","tmp":{"max":"22","min":"17"},"uv":"1","vis":"10","wind":{"deg":"109","dir":"东南风","sc":"3-4","spd":"22"}},{"astro":{"mr":"00:00","ms":"11:24","sr":"06:58","ss":"18:23"},"cond":{"code_d":"307","code_n":"306","txt_d":"大雨","txt_n":"中雨"},"date":"2020-02-15","hum":"68","pcpn":"0.0","pop":"25","pres":"1022","tmp":{"max":"22","min":"10"},"uv":"2","vis":"21","wind":{"deg":"2","dir":"北风","sc":"4-5","spd":"25"}},{"astro":{"mr":"00:41","ms":"12:07","sr":"06:58","ss":"18:23"},"cond":{"code_d":"101","code_n":"101","txt_d":"多云","txt_n":"多云"},"date":"2020-02-16","hum":"50","pcpn":"2.2","pop":"56","pres":"1024","tmp":{"max":"14","min":"8"},"uv":"3","vis":"24","wind":{"deg":"3","dir":"北风","sc":"3-4","spd":"19"}},{"astro":{"mr":"01:42","ms":"12:54","sr":"06:57","ss":"18:24"},"cond":{"code_d":"100","code_n":"100","txt_d":"晴","txt_n":"晴"},"date":"2020-02-17","hum":"40","pcpn":"0.0","pop":"1","pres":"1026","tmp":{"max":"16","min":"7"},"uv":"6","vis":"25","wind":{"deg":"350","dir":"北风","sc":"3-4","spd":"22"}}],"hourly_forecast":[{"cond":{"code":"101","txt":"多云"},"date":"2020-02-12 01:00","hum":"95","pop":"4","pres":"1017","tmp":"16","wind":{"deg":"48","dir":"东北风","sc":"1-2","spd":"4"}},{"cond":{"code":"104","txt":"阴"},"date":"2020-02-12 04:00","hum":"96","pop":"4","pres":"1017","tmp":"16","wind":{"deg":"21","dir":"东北风","sc":"1-2","spd":"10"}},{"cond":{"code":"104","txt":"阴"},"date":"2020-02-12 07:00","hum":"96","pop":"2","pres":"1014","tmp":"16","wind":{"deg":"57","dir":"东北风","sc":"1-2","spd":"10"}},{"cond":{"code":"104","txt":"阴"},"date":"2020-02-12 10:00","hum":"88","pop":"2","pres":"1012","tmp":"18","wind":{"deg":"87","dir":"东风","sc":"1-2","spd":"9"}},{"cond":{"code":"101","txt":"多云"},"date":"2020-02-12 13:00","hum":"77","pop":"7","pres":"1012","tmp":"21","wind":{"deg":"91","dir":"东风","sc":"1-2","spd":"3"}},{"cond":{"code":"101","txt":"多云"},"date":"2020-02-12 16:00","hum":"72","pop":"7","pres":"1013","tmp":"21","wind":{"deg":"87","dir":"东风","sc":"1-2","spd":"2"}},{"cond":{"code":"101","txt":"多云"},"date":"2020-02-12 19:00","hum":"78","pop":"7","pres":"1012","tmp":"18","wind":{"deg":"104","dir":"东南风","sc":"1-2","spd":"1"}},{"cond":{"code":"101","txt":"多云"},"date":"2020-02-12 22:00","hum":"87","pop":"7","pres":"1012","tmp":"18","wind":{"deg":"105","dir":"东南风","sc":"1-2","spd":"11"}}],"now":{"cond":{"code":"104","txt":"阴"},"fl":"16","hum":"97","pcpn":"0.0","pres":"1015","tmp":"15","vis":"16","wind":{"deg":"188","dir":"南风","sc":"0","spd":"1"}},"status":"ok","suggestion":{"air":{"brf":"较差","txt":"气象条件较不利于空气污染物稀释、扩散和清除。"},"comf":{"brf":"舒适","txt":"白天温度适宜,风力不大,相信您在这样的天气条件下,应会感到比较清爽和舒适。"},"cw":{"brf":"不宜","txt":"不宜洗车,未来24小时内有雨,如果在此期间洗车,雨水和路上的泥水可能会再次弄脏您的爱车。"},"drsg":{"brf":"较舒适","txt":"建议着薄外套、开衫牛仔衫裤等服装。年老体弱者应适当添加衣物,宜着夹克衫、薄毛衣等。"},"flu":{"brf":"较易发","txt":"天气转凉,空气湿度较大,较易发生感冒,体质较弱的朋友请注意适当防护。"},"sport":{"brf":"适宜","txt":"天气较好,赶快投身大自然参与户外运动,尽情感受运动的快乐吧。"},"trav":{"brf":"适宜","txt":"天气较好,温度适宜,总体来说还是好天气哦,这样的天气适宜旅游,您可以尽情地享受大自然的风光。"},"uv":{"brf":"最弱","txt":"属弱紫外线辐射天气,无需特别防护。若长期在户外,建议涂擦SPF在8-12之间的防晒护肤品。"}}}]}}
2020-01-06 11:03:43 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved' 'Traceback (most recent call last):' ' File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 408, in _async_add_entity' ' await entity.async_update_ha_state()' 'File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 286, in async_update_ha_state self._async_write_ha_state()' ' File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state state = self.state' ' File "/usr/src/homeassistant/homeassistant/components/weather/__init__.py", line 188, in state return self.condition' ' File "/config/custom_components/hf_weather/weather.py", line 161, in condition return [k for k, v in CONDITION_CLASSES.items() if self._condition in v][0]' 'IndexError: list index out of range
'
如题,不知道为什么
运行环境:群晖docker
Home Assistant版本:0.93.2
Configuration.yaml配置:
weather:
Lovelace配置:
resources:
RT
树莓派+docker+hass.io
尝试过
目录结构是这样的
Home Assistant/homeassistant/custom_components/
尝试过这样
url: /homeassistant/www/custom-lovelace/hf_weather-card/hf_weather-more-info.js
url: /local/www/custom-lovelace/hf_weather-card/hf_weather-more-info.js
证书是这样写的可以正常调用
Home Assistant/ssl
ssl_key: /ssl/privkey.pem
请问该怎么写,谢谢!
如题,最后感谢分享好东西!
图表和图标均不能显示,Mac和Win10都试过,更换不同浏览器也不行
感谢你的付出和帮助!!
HA版本:2021.2.3 (群晖docker)
Log错误信息:
Logger: frontend.js.latest.202101277
Source: components/system_log/init.py:190
First occurred: 4:23:12 PM (265 occurrences)
Last logged: 4:28:38 PM
https://xxxxxxxxx/frontend_latest/chunk.f5fcf7cefb050a60a0b0.js:142:7488 TypeError: undefined is not an object (evaluating 'this.hass.language')
https://xxxxxxxxx/frontend_latest/chunk.671cccf625c3b6fcb0ba.js:2:69052 TypeError: undefined is not an object (evaluating 's._view.skip')
https://xxxxxxxxx/frontend_latest/chunk.671cccf625c3b6fcb0ba.js:2:69053 Uncaught TypeError: Cannot read property 'skip' of undefined
https://xxxxxxxxx/frontend_latest/chunk.f5fcf7cefb050a60a0b0.js:142:3055 Uncaught TypeError: Cannot read property 'language' of undefined
将hf_weather放在了custom_components下。检测配置提示Platform error weather.hf_weather - Integration 'hf_weather' not found.
/data/docker/homeassistant/config/custom_components
hf_weather/
├── init.py
├── manifest.json
├── pycache
│ ├── heweather_forecast.cpython-36.pyc
│ ├── init.cpython-37.pyc
│ └── weather.cpython-37.pyc
└── weather.py
还是说0.91.4的py内容都和0.92不一样了。新手,还望指教
资源目录如下:
/custom_components/hf_weather
├── hf_weather
│ ├── init.py
│ ├── manifest.json
│ ├── pycache
│ │ ├── heweather_forecast.cpython-36.pyc
│ │ ├── init.cpython-37.pyc
│ │ ├── init.cpython-38.pyc
│ │ ├── weather.cpython-37.pyc
│ │ └── weather.cpython-38.pyc
│ └── weather.py
/www/hf_weather-card
├── hf_weather-card
│ ├── hf_weather-card.js
│ ├── hf_weather-card_new.js
│ ├── hf_weather-more-info.js
│ └── icons
│ ├── animated
│ │ ├── cloudy-day-1.svg
│ │ ├── cloudy-day-2.svg
│ │ ├── cloudy-day-3.svg
│ │ ├── cloudy-night-1.svg
│ │ ├── cloudy-night-2.svg
│ │ ├── cloudy-night-3.svg
│ │ ├── cloudy.svg
│ │ ├── day.svg
│ │ ├── night.svg
│ │ ├── rainy-1.svg
│ │ ├── rainy-2.svg
│ │ ├── rainy-3.svg
│ │ ├── rainy-4.svg
│ │ ├── rainy-5.svg
│ │ ├── rainy-6.svg
│ │ ├── rainy-7.svg
│ │ ├── snowy-1.svg
│ │ ├── snowy-2.svg
│ │ ├── snowy-3.svg
│ │ ├── snowy-4.svg
│ │ ├── snowy-5.svg
│ │ ├── snowy-6.svg
│ │ ├── thunder.svg
│ │ ├── weather_sagittarius.svg
│ │ ├── weather-sprite.svg
│ │ ├── weather_sunset.svg
│ │ └── weather.svg
│ ├── README.md
│ └── static
│ ├── cloudy-day-1.svg
│ ├── cloudy-day-2.svg
│ ├── cloudy-day-3.svg
│ ├── cloudy-night-1.svg
│ ├── cloudy-night-2.svg
│ ├── cloudy-night-3.svg
│ ├── cloudy.svg
│ ├── day.svg
│ ├── night.svg
│ ├── rainy-1.svg
│ ├── rainy-2.svg
│ ├── rainy-3.svg
│ ├── rainy-4.svg
│ ├── rainy-5.svg
│ ├── rainy-6.svg
│ ├── rainy-7.svg
│ ├── snowy-1.svg
│ ├── snowy-2.svg
│ ├── snowy-3.svg
│ ├── snowy-4.svg
│ ├── snowy-5.svg
│ ├── snowy-6.svg
│ ├── thunder.svg
│ ├── weather_sagittarius.svg
│ ├── weather-sprite.svg
│ ├── weather_sunset.svg
│ └── weather.svg
/config/configuration.yaml 配置文件的配置如下:
weather:
lovelace:
resources:
- url: /local/hf_weather-card/hf_weather-card.js
type: module
- url: /local/hf_weather-card/hf_weather-more-info.js
type: module
卡片手动模式创建,配置文件如下:
type: 'custom:hf_weather-card' # card类型
entity: weather.test # 天气插件生成实体的entityId
mode: daily
title: 天气 # 标题,不设置则使用entity的friendly_name
icons: /local/hf_weather-card/icons/animated/
系统 日志有一个报错。。
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup,
self._temperature = float(all_result["now"]["tmp"]),
File "/config/custom_components/hf_weather/weather.py", line 384, in async_update,
yield from data.async_update(dt_util.now()),
File "/config/custom_components/hf_weather/weather.py", line 86, in async_setup_platform,
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform,
await asyncio.shield(task),
报错: Error: Custom element not found: hf_weather-card
请指导 下错误 在哪里。。。感谢。
Error while setting up platform hf_weather
Traceback (most recent call last):
File "/home/homeassistant/.local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
return fut.result()
File "/home/homeassistant/.homeassistant/custom_components/hf_weather/weather.py", line 86, in async_setup_platform
yield from data.async_update(dt_util.now())
File "/home/homeassistant/.homeassistant/custom_components/hf_weather/weather.py", line 407, in async_update
[forec_cond[6], int(datemsg[6]["tmp"]["max"]), int(datemsg[6]["tmp"]["min"]), datemsg[6]["date"], datemsg[6]["pcpn"], datemsg[6]["pop"]]
IndexError: list index out of range
arch | armv7l- | --
dev | false
docker | false
hassio | false
os_name | Linux
python_version | 3.7.3
timezone | Asia/Shanghai
version | 0.102.3
virtualenv | false
May I have your reply on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.