Giter Site home page Giter Site logo

hf_weather's Introduction

hf_weather

一个不知道改了几手的和风天气最简单的配置版本

hacs_badge hacs_badge visit

使用方式

安装完成重启HA,刷新一下页面,在集成里搜索和风天气即可

Add Integration

注意:请自行申请appkey: https://wx.jdcloud.com/market/datas/26/10610

Lovelace配置

type: 'custom:hf_weather-card'
entity: weather.tian_qi

# 不设置则同时显示
mode: hourly按小时天气预报、daily按天天气预报

# 不设置则使用entity的friendly_name
title: 卡片标题

TTS语音提醒模板

data:
  message: >-
    {% set state = state_attr('weather.tian_qi', 'forecast')%}
    今天的天气是{{state[0].condition_cn}},最高温度:{{state[0].temperature}}度,最低温度:{{state[0].templow}}度,
    明天的天气是{{state[1].condition_cn}},最高温度:{{state[1].temperature}}度,最低温度:{{state[1].templow}}度,
    后天的天气是{{state[2].condition_cn}},最高温度:{{state[2].temperature}}度,最低温度:{{state[2].templow}}度
service: ha_cloud_music.tts
data:
  message: >-
    {% set state = state_attr('weather.tian_qi', 'hourly_forecast')%}
    {{state[0].datetime | regex_replace(now().strftime('%Y-%m-%d'), '')}}
    的天气是{{state[0].condition_cn}},温度是{{state[0].temperature}}度,
    {{state[1].datetime | regex_replace(now().strftime('%Y-%m-%d'), '')}}
    的天气是{{state[1].condition_cn}},温度是{{state[1].temperature}}度,
    {{state[2].datetime | regex_replace(now().strftime('%Y-%m-%d'), '')}}
    的天气是{{state[2].condition_cn}},温度是{{state[2].temperature}}度
service: ha_cloud_music.tts

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

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

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

HomeAssistant家庭助理


在使用的过程之中,如果遇到无法解决的问题,付费咨询请加Q635147515

hf_weather'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

Watchers

 avatar

hf_weather's Issues

日志报警

custom_components.hf_weather.weather::HeFengWeather 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.

京东万象已经停止运营了 无法获取数据了.

由于业务发展策略的变更, 我们怀着万分遗憾的心情宣布万象将于公告发布之日起三十天后(截止到2023年3月18日)终止运营, 自公告发布之日起(2月16日),所有万象已上架产品将无法进行购买。

大佬这个怎么处理啊?

卡片不显示

按照配置添加loveplace卡片发现提示No visual editor available for type "custom:hf_weather-card".
资源列表没有本项目相关的js,已经手动添加,也把自定义卡片的文件复制了一份到www文件下。但是还是不显示卡片。

Error while setting up hf_weather platform for weather

HA环境:
设备:N1
系统:openwrt_s905d_n1_R22.3.13_k5.4.184-flippy-70+o
安装方式:Docker安装的"homeassistant core"
HA版本:Home Assistant 2022.4.2

Error while setting up hf_weather platform for weather Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/hf_weather/weather.py", line 85, in async_setup_entry await data.async_update(dt_util.now()) File "/config/custom_components/hf_weather/weather.py", line 413, 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"], datemsg[6]["cond"]["txt_d"]] IndexError: list index out of range

我在集成里面配置成功后,日志里出现了这样的错误,请问应该怎么修复呢?

HAOS 7.2 以上版本不可用

Logger: homeassistant.components.weather
Source: custom_components/hf_weather/weather.py:99
Integration: Weather (documentation, issues)
First occurred: 11:34:55 (1 occurrences)
Last logged: 11:34:55

Error while setting up hf_weather platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/hf_weather/weather.py", line 88, in async_setup_entry
async_add_entities([HeFengWeather(data, name)], True)
File "/config/custom_components/hf_weather/weather.py", line 99, in init
self._temperature_unit = None
AttributeError: can't set attribute '_temperature_unit'

Logger: homeassistant.components.weather
Source: components/weather/init.py:308
Integration: Weather (documentation, issues)
First occurred: 11:34:52 (2 occurrences)
Last logged: 11:34:54

custom_components.qweather.weather::QWeather 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.
custom_components.hf_weather.weather::HeFengWeather 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.

hf_weather启动失败

之前一直试用良好,但是昨天开始启动出现错误,日志信息如下:

Logger: homeassistant.components.weather
Source: custom_components/hf_weather/weather.py:360
Integration: Weather (documentation, issues)
First occurred: 17:51:13 (1 occurrences)
Last logged: 17:51:13

Error while setting up hf_weather platform for weather
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/hf_weather/weather.py", line 85, in async_setup_entry
    await data.async_update(dt_util.now())
  File "/config/custom_components/hf_weather/weather.py", line 360, in async_update
    with async_timeout.timeout(15, loop=self._hass.loop):
TypeError: timeout() got an unexpected keyword argument 'loop'

我的系统是Ubuntu 18.04.6 LTS、supervisor-2022.01.1、Home Assistant 2022.3.1。
麻烦您看一下,谢谢

显示不了卡片

系统10.1

type: 'custom:hf_weather-card'

Custom element doesn't exist: hf_weather-card
显示错误

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.