fineemb / colorfulclouds-weather Goto Github PK
View Code? Open in Web Editor NEW用于HASS的彩云天气组件
用于HASS的彩云天气组件
配置->集成->添加继承,单击提交按钮后显示Unknown error occurred
,无法正常添加。控制台输出如下:
2020-10-10 01:49:57 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "d:\services\homeassistant386\lib\site-packages\aiohttp\web_protocol.py", line 418, in start
resp = await task
File "d:\services\homeassistant386\lib\site-packages\aiohttp\web_app.py", line 458, in _handle
resp = await handler(request)
File "d:\services\homeassistant386\lib\site-packages\aiohttp\web_middlewares.py", line 119, in impl
return await handler(request)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\components\http\request_context.py", line 18, in request_context_middleware
return await handler(request)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\components\http\ban.py", line 72, in ban_middleware
return await handler(request)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\components\http\auth.py", line 127, in auth_middleware
return await handler(request)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\components\http\view.py", line 129, in handle
result = await result
File "d:\services\homeassistant386\lib\site-packages\homeassistant\components\config\config_entries.py", line 169, in post
return await super().post(request, flow_id)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\components\http\data_validator.py", line 60, in wrapper
result = await method(view, request, *args, **kwargs)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\helpers\data_entry_flow.py", line 106, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\data_entry_flow.py", line 156, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\data_entry_flow.py", line 204, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "D:\Services\HomeAssistant386\config\custom_components\colorfulclouds\config_flow.py", line 44, in async_step_user
json_text = requests.get(str.format("https://api.caiyunapp.com/{}/{}/{},{}/daily.json", user_input["api_version"], user_input["api_key"], user_input["longitude"], user_input["latitude"])).content
File "d:\services\homeassistant386\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "d:\services\homeassistant386\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "d:\services\homeassistant386\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "d:\services\homeassistant386\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "d:\services\homeassistant386\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "d:\services\homeassistant386\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "d:\services\homeassistant386\lib\site-packages\urllib3\connectionpool.py", line 392, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Program Files\Python38\lib\http\client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Program Files\Python38\lib\http\client.py", line 1266, in _send_request
self.putrequest(method, url, **skips)
File "d:\services\homeassistant386\lib\site-packages\urllib3\connection.py", line 199, in putrequest
return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
File "d:\services\homeassistant386\lib\site-packages\homeassistant\util\async_.py", line 120, in protected_loop_func
check_loop()
File "d:\services\homeassistant386\lib\site-packages\homeassistant\util\async_.py", line 91, in check_loop
raise RuntimeError(
RuntimeError: Detected I/O inside the event loop. This is causing stability issues. Please report issue
views:
type: grid
title: weather
view_layout:
grid-area: weather
columns: 1
cards:
前端用的是 matt8707大神的,主要配置文件如ui-lovelace.yaml都是来自于他,
纯小白,一点都没入门,多方比对弄的,上面是我现在的配置,前端是yaml格式,只能通过配置文件配置,
目前是网页版本天气预报和小时预报都不能滚动看,安卓手机版本的homeassistant小时预报能滚动,中间的天气预报动不了,
有遇到的兄弟么, 求助,
完全不懂呀
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:583
First occurred: 2022年2月21日 19:20:46 (13 occurrences)
Last logged: 2022年2月21日 19:20:47
Entity sensor.wo_de_jia_zi_wai_xian (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.wo_de_jia_shi_du (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.wo_de_jia_neng_jian_du (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.wo_de_jia_feng_su (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) implements device_state_attributes. Please report it to the custom component author.
Entity sensor.wo_de_jia_feng_xiang (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) implements device_state_attributes. Please report it to the custom component author.
我想在ha中根据一天的最高温度做一些自动化,发现只有最低温度,请问最高问题的实体叫什么?
此错误来自自定义集成。
Logger: homeassistant.config_entries
Source: custom_components/colorfulclouds/init.py:129
Integration: colorfulclouds (documentation, issues)
First occurred: 10:38:40 (2 occurrences)
Last logged: 11:06:27
Error setting up entry 彩云天气 for colorfulclouds
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/colorfulclouds/init.py", line 69, in async_setup_entry
coordinator = ColorfulcloudsDataUpdateCoordinator(
File "/config/custom_components/colorfulclouds/init.py", line 129, in init
self.is_metric = hass.config.units.is_metric
AttributeError: 'UnitSystem' object has no attribute 'is_metric'
先感谢插件~
然后有个问题,在插件配置时有个“极端天气预警”的选项,虽然一直勾选的,
但貌似从来没有看到过预警的相关信息(感觉应该是对应实体的forecast_alert属性,但一直是空的)
我代码小白,看了下config_flow.py,调用的API是https://api.caiyunapp.com/v2.5/.../daily.json
查了彩云的wiki,如果需要天气预警信息,则需要在API最后添加 ?alert=true。
大佬能否关心一下?谢谢。
最近收到邮件,提示9月份取消免费调用API,怎样限制调用频率?
Logger: homeassistant
Source: custom_components/colorfulclouds/sensor.py:181
First occurred: 下午7:32:20 (1 occurrences)
Last logged: 下午7:32:20
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 119, in _handle_refresh_interval
await self.async_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 193, in async_refresh
update_callback()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 323, in _async_write_ha_state
attr.update(self.device_state_attributes or {})
File "/config/custom_components/colorfulclouds/sensor.py", line 181, in device_state_attributes
self._attrs["nearest_intensity"] = self.coordinator.data["result"]["realtime"]["precipitation"]["nearest"]["intensity"]
KeyError: 'nearest'
记录器:homeassistant.helpers.entity
来源:helpers/entity.py:574 第一次发生: 22:47: 24 (10次) 最后记录: 22:47: 24
实体 sensor.home_shu_gua_zhi_shu (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) 实现了 device_state_attributes。请向自定义组件作者报告。
实体 sensor.home_zi_wai_xian (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) 实现了 device_state_attributes。请向自定义组件作者报告。
实体 sensor.home_shi_du (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) 实现 device_state_attributes。请向自定义组件作者报告。
实体 sensor.home_neng_jian_du (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) 实现了 device_state_attributes。请向自定义组件作者报告。
实体 sensor.home_feng_su (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) 实现 device_state_attributes。请向自定义组件作者报告。
在此十分感谢开发者大佬长期以来的开发维护。
你好,请问skycon获取到是英文,请问如果直接播报中文的?
Logger: homeassistant.components.weather
Source: components/weather/init.py:308
Integration: Weather (documentation, issues)
First occurred: 09:45:03 (1 occurrences)
Last logged: 09:45:03
custom_components.colorfulclouds.weather::ColorfulCloudsEntity is overriding deprecated methods on an instance of WeatherEntity, this is not valid and will be unsupported from Home Assistant 2023.1. Please report it to the custom component author.
Hass Core 2021.4.0.dev0
Frontend 20210330.0 - latest
Error details reference to attachments.
近期github的访问又变得很糟糕 好多人只能手动下载安装 还求大佬贴出手动下载后 configuration.yaml里的配置例子 谢谢!
搞彩云一大目的就是为了降雨预警,现在的实体体现不出这个功能,都是温度湿度之类的。
其实也就是openweather和accuweather都能做的。
我看HACS前端能够正常显示降雨预警状态:“未来两小时不会下雨,请放心出门吧”
能不能搞个实体专门体现这个文字报告?这个HACS的代码我不清楚怎么搞?
大佬json解析添加一个解析器?加个文字输出实体?
这样就可以实现下雨前提前微信提醒等等功能了。
特别是下面五个动态也显示 cpu就奔起来
在HACS和intergation里面没有发现ui界面
Version
Home Assistant: 0.116.2
HACS: 1.6.0
Colorfulclouds-weather: master version
下雨天的云量也只有1%。
请问默认的查询频率是每小时多少次?最近我的彩云API开始统计后台请求次数了,收费是8元每万次,昨天看到请求了500+次,这个频率能否手动设置,如果不方便增加配置选项,能否告知一下代码位置?谢谢!
比如 湿度 实体 需要以下两个属性homekit 才能正常显示
device_class: humidity
state_class: measurement
https://developers.home-assistant.io/docs/core/entity/sensor/
Home Assistant 2023.8.3
Supervisor 2023.08.1
前端版本: 20230802.1 - latest
stderr: [31m2023-08-19 09:42:24.515 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform colorfulclouds
stderr: Traceback (most recent call last):
stderr: File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in async_add_entities
stderr: await asyncio.gather(*tasks)
stderr: File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 750, in _async_add_entity
stderr: await entity.add_to_platform_finish()
stderr: File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in add_to_platform_finish
stderr: self.async_write_ha_state()
stderr: File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 746, in async_write_ha_state
stderr: self._async_write_ha_state()
stderr: File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 808, in _async_write_ha_state
stderr: state = self._stringify_state(available)
stderr: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stderr: File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 752, in _stringify_state
stderr: if (state := self.state) is None:
stderr: ^^^^^^^^^^
stderr: File "/config/custom_components/colorfulclouds/sensor.py", line 120, in state
stderr: return self.coordinator.data["result"]["realtime"][self.kind]
DEVICE_CLASS_TEMPERATURE是从colorfulclouds使用的,这是一个已弃用的常量,将在HA Core 2025.1中删除。 请改用 SensorDeviceClass.TEMPERATURE,请在 https://github.com/fineemb/Colorfulclouds-weather/issues 创建错误报告
TEMP_CELSIUS 是从 colorfulclouds 中使用的,这是一个已弃用的常量,将在 HA Core 2025.1 中删除。 请改用 UnitOfTemperature.CELSIUS,请在 https://github.com/fineemb/Colorfulclouds-weather/issues 创建错误报告
TEMP_FAHRENHEIT 是从 colorfulclouds 使用的,这是一个已弃用的常量,将在 HA Core 2025.1 中删除。 请使用 UnitOfTemperature.FAHRENHEIT 代替,请在 https://github.com/fineemb/Colorfulclouds-weather/issues 创建错误报告
HA版本:2021.11.5 supervised 版
是否有彩云key:是
是否安装最新彩云天气插件:是
时区是否正确:是,上海时区
GPS信息是否填写正确:是,为上海这边经纬度
其他信息是否显示正确:是
问题:
彩云卡片中日出时间显示为:“下午3:19:29”,日落时间显示为“下午11:36:36”,且第二天还是会显示错
尝试过用postman直接访问彩云API,返回信息中可以看到正确的日出日落时间,不知是否是HA版本太新,和彩云插件代码有冲突的原因?
彩云天气在HACS安装后搜索不到怎么回事
HA升级到2023.8后,仪表板上无法正常显示,实体全部变为不可用。
Logger: homeassistant.components.weather
Source: components/weather/init.py:169
Integration: 天气 (documentation, issues)
First occurred: 01:17:14 (1 occurrences)
Last logged: 01:17:14
custom_components.colorfulclouds.weather::ColorfulCloudsEntity is overriding deprecated methods on an instance of WeatherEntity, this is not valid and will be unsupported from Home Assistant 2023.1. Please report it to the custom integration author.
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:549
First occurred: 11:22:34 (11 occurrences)
Last logged: 11:22:34
Entity sensor.***紫外线等传感器 (<class 'custom_components.colorfulclouds.sensor.ColorfulcloudsSensor'>) implements device_state_attributes.
Please report it to the custom component author.
报告作者
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 13:31:16 (2 occurrences)
Last logged: 13:31:16
Detected integration that accesses the is_metric
property of the unit system. This is deprecated and will stop working in Home Assistant 2023.1. Please adjust to use instance check instead.. Please report issue to the custom integration author for colorfulclouds using this method at custom_components/colorfulclouds/init.py, line 129: self.is_metric = hass.config.units.is_metric
Detected integration that accesses the is_metric
property of the unit system. This is deprecated and will stop working in Home Assistant 2023.1. Please adjust to use instance check instead.. Please report issue to the custom integration author for colorfulclouds using this method at custom_components/colorfulclouds/init.py, line 130: if hass.config.units.is_metric:
记录器:homeassistant.helpers.frame
来源:helpers/frame.py:77
首次出现:13:31:16(2 次出现)
最后登录时间:13:31:16
检测到访问单位系统的“is_metric”属性的集成。 这已被弃用,并将停止在 Home Assistant 2023.1 中工作。 请调整以改用实例检查。请在 custom_components/colorfulclouds/init.py 第 129 行使用此方法向 colourclouds 的自定义集成作者报告问题:self.is_metric = hass.config.units.is_metric
检测到访问单位系统的“is_metric”属性的集成。 这已被弃用,并将停止在 Home Assistant 2023.1 中工作。 请调整以改用实例检查。请在 custom_components/colorfulclouds/init.py 第 130 行使用此方法向 colourclouds 的自定义集成作者报告问题:如果 hass.config.units.is_metric:
Logger: homeassistant.components.weather
Source: components/weather/init.py:199
Integration: Weather (documentation, issues)
First occurred: 13:31:18 (1 occurrences)
Last logged: 13:31:18
custom_components.colorfulclouds.weather::ColorfulCloudsEntity is overriding deprecated methods on an instance of WeatherEntity, this is not valid and will be unsupported from Home Assistant 2023.1. Please report it to the custom integration author.
记录器:homeassistant.components.weather
来源:组件/天气/init.py:199
集成:天气(文档、问题)
第一次发生:13:31:18(1 次)
最后登录时间:13:31:18
custom_components.colorfulclouds.weather::ColorfulCloudsEntity 正在覆盖 WeatherEntity 实例上不推荐使用的方法,这是无效的,并且将不受 Home Assistant 2023.1 的支持。 请将其报告给自定义集成作者。
已经通过 HACS 安装完毕,但是没有找到配置入口?
The integration colorfulclouds is using the deprecated forecast attribute.
求升级解决
湿度的单位不对,应该是%。
卡片有pm2.5的数值显示,但没有实体传感器,想调用pm2.5的值加个自动化,有知道的朋友吗?谢谢
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.