『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: lidicn

[插件集成] 彩云天气S【8月18日更新】增加8小时最大降雨量

  [复制链接]

0

主题

49

帖子

379

积分

中级会员

Rank: 3Rank: 3

积分
379
金钱
330
HASS币
0
发表于 2017-8-15 10:29:33 来自手机 | 显示全部楼层
谢谢大佬分享,下一步准备搞天气了
回复

使用道具 举报

5

主题

65

帖子

421

积分

论坛技术达人

Miracle

积分
421
金钱
356
HASS币
0
发表于 2017-8-16 07:45:35 | 显示全部楼层
不错~~,搜下了~~~~~~~
回复

使用道具 举报

7

主题

196

帖子

645

积分

高级会员

小白

Rank: 4

积分
645
金钱
449
HASS币
0
发表于 2017-8-17 10:40:05 | 显示全部楼层
666666666666.....
回复

使用道具 举报

2

主题

160

帖子

2584

积分

金牌会员

Rank: 6Rank: 6

积分
2584
金钱
2424
HASS币
0
发表于 2017-8-17 12:00:37 | 显示全部楼层
准备试一下用彩云,好像要申请API?
回复

使用道具 举报

219

主题

1287

帖子

7945

积分

超级版主

Rank: 8Rank: 8

积分
7945
金钱
6628
HASS币
86

教程狂人论坛风云人物突出贡献

 楼主| 发表于 2017-8-17 12:31:09 | 显示全部楼层
opalhair 发表于 2017-8-17 12:00
准备试一下用彩云,好像要申请API?

是的,要等审核。
回复

使用道具 举报

4

主题

192

帖子

1576

积分

金牌会员

Rank: 6Rank: 6

积分
1576
金钱
1384
HASS币
0
发表于 2017-8-17 13:01:35 | 显示全部楼层
有没有显示不了实时天气的,代码错误如下
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 440, in update
    self.data_currently = self.data_currently['result']['precipitation']['nearest']
KeyError: 'precipitation'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 443, in update
    self.data_currently = self.data_currently['result']['precipitation']['local']
KeyError: 'precipitation'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 446, in update
    self.data_currently = self.data_currently['result']['precipitation']['local']
KeyError: 'precipitation'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 449, in update
    self.data_currently = self.data_currently['result']['wind']
KeyError: 'wind'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 452, in update
    self.data_currently = self.data_currently['result']['wind']
KeyError: 'wind'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 433, in update
    self._state = self.data_currently [self._sensor]
KeyError: 'temperature'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 407, in update
    if self.data_currently ['skycon'] == 'CLEAR_DAY':
KeyError: 'skycon'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 428, in update
    self._state = self.data_currently['result']['cloudrate']*100
KeyError: 'cloudrate'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 433, in update
    self._state = self.data_currently [self._sensor]
KeyError: 'aqi'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 430, in update
    self._state = round(self.data_currently['result']['humidity']*100,2)
KeyError: 'humidity'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 433, in update
    self._state = self.data_currently [self._sensor]
KeyError: 'pm25'
2017-08-17 12:54:46 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/tasks.py", line 242, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
    new_entity, self, update_before_add=update_before_add
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
    yield from self.hass.async_add_job(entity.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 381, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 310, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 294, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/sensor/CaiyunweatherS.py", line 437, in update
    self.data_currently = self.data_currently['result']['precipitation']['nearest']
KeyError: 'precipitation'

回复

使用道具 举报

1

主题

211

帖子

2295

积分

金牌会员

Rank: 6Rank: 6

积分
2295
金钱
2084
HASS币
0
发表于 2017-8-17 13:04:55 | 显示全部楼层
学习,感谢分享
回复

使用道具 举报

5

主题

253

帖子

1946

积分

金牌会员

Rank: 6Rank: 6

积分
1946
金钱
1693
HASS币
0
发表于 2017-8-17 13:38:55 | 显示全部楼层

强烈支持
!!!
回复

使用道具 举报

3

主题

62

帖子

239

积分

中级会员

Rank: 3Rank: 3

积分
239
金钱
177
HASS币
0
发表于 2017-8-17 14:41:58 | 显示全部楼层
支持一下, 也想加个天气
回复

使用道具 举报

219

主题

1287

帖子

7945

积分

超级版主

Rank: 8Rank: 8

积分
7945
金钱
6628
HASS币
86

教程狂人论坛风云人物突出贡献

 楼主| 发表于 2017-8-17 16:53:42 | 显示全部楼层
zorankeinfo 发表于 2017-8-17 13:01
有没有显示不了实时天气的,代码错误如下
[code]2017-08-17 12:54:46 ERROR (Main ...

https://api.caiyunapp.com/v2/这里填你的彩云apikey/{{states.zone.home.attributes.longitude}},{{states.zone.home.attributes.latitude}}/realtime
经纬度替换成你的经纬度
用浏览器打开这个网址看看有没['result']['precipitation']['nearest']
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-23 11:18 , Processed in 0.103827 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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