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

 找回密码
 立即注册
查看: 116256|回复: 246

[经验分享] 获取“天气通”天气数据,不需要APIKEY,没有次数限制,...

  [复制链接]

6

主题

743

帖子

6032

积分

论坛元老

Rank: 8Rank: 8

积分
6032
金钱
5284
HASS币
20
发表于 2019-4-7 21:53:55 | 显示全部楼层 |阅读模式
本帖最后由 mitu 于 2019-4-12 10:01 编辑

天气通的气象数据,一次可取得当前天气情况,AQI的各项指标,七日天气预报,15日天气预报,24小时分时预报,数据很多,而且不需要APIKEY,没有次数限制。
URL:http://yun.rili.cn/tianqi/index.html?city=天气城市代码。
天气代码可问度娘。。
以下是http://zhwnlapi.etouch.cn/Ecalen ... r?citykey=101160707取得的数据

{
    "indexes": [
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/chenlian.png", 
                "statsKey": "-1055"
            }, 
            "valueV2": "较不宜晨练", 
            "name": "晨练指数", 
            "value": "较不宜", 
            "desc": "风力稍大,较不宜晨练,室外锻炼请注意选择避风的地点,避免迎风锻炼。年老体弱人群适当减少晨练时间。"
        }, 
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/tianqi.png", 
                "statsKey": "-1053"
            }, 
            "valueV2": "天气较舒适", 
            "name": "穿衣指数", 
            "value": "较舒适", 
            "desc": "建议着薄外套或牛仔衫裤等服装。年老体弱者宜着夹克衫、薄毛衣等。昼夜温差较大,注意适当增减衣服。"
        }, 
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/shushidu.png", 
                "statsKey": "-1059"
            }, 
            "valueV2": "舒适", 
            "name": "舒适度指数", 
            "value": "舒适", 
            "desc": "白天不太热也不太冷,风力不大,相信您在这样的天气条件下,应会感到比较清爽和舒适。"
        }, 
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/ganmao.png", 
                "statsKey": "-1056"
            }, 
            "valueV2": "易发感冒", 
            "name": "感冒指数", 
            "value": "易发", 
            "desc": "天冷风大且昼夜温差也很大,易发生感冒,请注意适当增减衣服。"
        }, 
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/ziwaixian.png", 
                "statsKey": "-1054"
            }, 
            "valueV2": "紫外线弱", 
            "name": "紫外线强度指数", 
            "link": "http://m.weathercn.com/index.do?language=zh-cn&smartid=101160707&partner=1000001009", 
            "value": "弱", 
            "desc": "紫外线强度较弱,建议出门前涂擦SPF在12-15之间、PA+的防晒护肤品。"
        }, 
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/lvyou.png", 
                "statsKey": "-1057"
            }, 
            "valueV2": "适宜旅游", 
            "name": "旅游指数", 
            "link": "http://m.weathercn.com/index.do?language=zh-cn&smartid=101160707&partner=1000001009", 
            "value": "适宜", 
            "desc": "天气较好,温度适宜,但风稍微有点大。这样的天气适宜旅游,您可以尽情地享受大自然的无限风光。"
        }, 
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/xiche.png", 
                "statsKey": "-1052"
            }, 
            "valueV2": "较不宜洗车", 
            "name": "洗车指数", 
            "link": "http://m.weathercn.com/index.do?language=zh-cn&smartid=101160707&partner=1000001009", 
            "value": "较不宜", 
            "desc": "较不宜洗车,未来一天无雨,风力较大,如果执意擦洗汽车,要做好蒙上污垢的心理准备。"
        }, 
        {
            "ext": {
                "icon": "http://static.etouch.cn/icon/liangshai.png", 
                "statsKey": "-1058"
            }, 
            "valueV2": "不宜晾晒", 
            "name": "晾晒指数", 
            "link": "http://m.weathercn.com/index.do?language=zh-cn&smartid=101160707&partner=1000001009", 
            "value": "不宜", 
            "desc": "有降水,不适宜晾晒。若需要晾晒,请在室内准备出充足的空间。"
        }, 
        {
            "ext": {
                "icon": "", 
                "statsKey": ""
            }, 
            "valueV2": "较适宜钓鱼", 
            "name": "钓鱼指数", 
            "value": "较适宜", 
            "desc": "较适合垂钓,但风力稍大,会对垂钓产生一定的影响。"
        }, 
        {
            "ext": {
                "icon": "", 
                "statsKey": ""
            }, 
            "valueV2": "保湿化妆", 
            "name": "化妆指数", 
            "value": "保湿", 
            "desc": "风力不大,建议用中性保湿型霜类化妆品,无需选用防晒化妆品。"
        }, 
        {
            "ext": {
                "icon": "", 
                "statsKey": ""
            }, 
            "valueV2": "较不宜运动", 
            "name": "运动指数", 
            "value": "较不宜", 
            "desc": "天气较好,但考虑天气寒冷,风力较强,推荐您进行室内运动,若户外运动请注意保暖并做好准备活动。"
        }, 
        {
            "ext": {
                "icon": "", 
                "statsKey": ""
            }, 
            "valueV2": "不带伞", 
            "name": "雨伞指数", 
            "value": "不带伞", 
            "desc": "天气较好,不会降水,因此您可放心出门,无须带雨伞。"
        }, 
        {
            "ext": {
                "icon": "", 
                "statsKey": ""
            }, 
            "valueV2": "较不适宜约会", 
            "name": "约会指数", 
            "value": "较不适宜", 
            "desc": "风力较大,建议尽量不要去室外约会,如果外出,请您挑选避风的地点。"
        }
    ], 
    "meta": {
        "circle_count": 1678, 
        "up_date": "20190407211945", 
        "post_id": "501401", 
        "citykey": "101160707", 
        "city": "甘州区", 
        "upper": "张掖市", 
        "html_url": "http://yun.rili.cn/tianqi/index.html?city=101160707", 
        "wcity": [
            "w_101160707"
        ], 
        "up_time": "21:14", 
        "post_count": 380, 
        "status": 1000, 
        "desc": "看看离你最近的历友在哪里"
    }, 
    "forecast_up_time": "20190407113813", 
    "weatherUrls": {
        "w_life_index_more": "http://m.weathercn.com/livingindex.do?language=zh-cn&smartid=101160701&partner=1000001009#Indices", 
        "w_forecast_90": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&partner=1000001009", 
        "w_gradual_hour": ""
    }, 
    "forecast15": [
        {
            "date": "20190406", 
            "sunrise": "06:58", 
            "high": 22, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=0&partner=1000001009", 
            "low": 6, 
            "sunset": "19:45", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "无持续风向", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "aqi": 104, 
            "forecastAirUrl": "", 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "4-5级", 
                "type": 1, 
                "wd": "西北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190407", 
            "sunrise": "06:57", 
            "high": 21, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=1&partner=1000001009", 
            "low": 5, 
            "sunset": "19:46", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "无持续风向", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "aqi": 70, 
            "forecastAirUrl": "", 
            "day": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371463.3431.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284459.5844.jpg", 
                "wp": "4-5级", 
                "type": 2, 
                "wd": "西北风", 
                "notice": "阴晴之间,谨防紫外线侵扰"
            }
        }, 
        {
            "date": "20190408", 
            "sunrise": "06:55", 
            "high": 11, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=2&partner=1000001009", 
            "low": 0, 
            "sunset": "19:47", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "无持续风向", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "aqi": 55, 
            "forecastAirUrl": "", 
            "day": {
                "wthr": "小雨", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371550.6113.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284574.0261.jpg", 
                "wp": "3-4级", 
                "type": 8, 
                "wd": "西北风", 
                "notice": "雨虽小,注意保暖别感冒"
            }
        }, 
        {
            "date": "20190409", 
            "sunrise": "06:54", 
            "high": 16, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=3&partner=1000001009", 
            "low": -1, 
            "sunset": "19:48", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "无持续风向", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "aqi": 61, 
            "forecastAirUrl": "", 
            "day": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371463.3431.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284459.5844.jpg", 
                "wp": "4-5级", 
                "type": 2, 
                "wd": "西北风", 
                "notice": "阴晴之间,谨防紫外线侵扰"
            }
        }, 
        {
            "date": "20190410", 
            "sunrise": "06:52", 
            "high": 17, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=4&partner=1000001009", 
            "low": 0, 
            "sunset": "19:49", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "无持续风向", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "aqi": 56, 
            "forecastAirUrl": "", 
            "day": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371463.3431.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284459.5844.jpg", 
                "wp": "4-5级", 
                "type": 2, 
                "wd": "西北风", 
                "notice": "阴晴之间,谨防紫外线侵扰"
            }
        }, 
        {
            "date": "20190411", 
            "sunrise": "06:51", 
            "high": 19, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=5&partner=1000001009", 
            "low": 2, 
            "sunset": "19:50", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "无持续风向", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "aqi": 54, 
            "forecastAirUrl": "", 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "3-4级", 
                "type": 1, 
                "wd": "西北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190412", 
            "sunrise": "06:49", 
            "high": 19, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=6&partner=1000001009", 
            "low": 4, 
            "sunset": "19:51", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "无持续风向", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "aqi": 48, 
            "forecastAirUrl": "", 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "3-4级", 
                "type": 1, 
                "wd": "西北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190413", 
            "sunrise": "06:48", 
            "high": 20, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=7&partner=1000001009", 
            "low": 4, 
            "sunset": "19:52", 
            "night": {
                "wthr": "小雨", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371554.566.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284577.5363.jpg", 
                "wp": "<3级", 
                "type": 8, 
                "wd": "无持续风向", 
                "notice": "别看雨还小,冒雨要不得"
            }, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "3-4级", 
                "type": 1, 
                "wd": "西北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190414", 
            "sunrise": "06:46", 
            "high": 15, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=8&partner=1000001009", 
            "low": 2, 
            "sunset": "19:53", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "南风", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "day": {
                "wthr": "小雨", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371550.6113.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284574.0261.jpg", 
                "wp": "3-4级", 
                "type": 8, 
                "wd": "西北风", 
                "notice": "雨虽小,注意保暖别感冒"
            }
        }, 
        {
            "date": "20190415", 
            "sunrise": "06:45", 
            "high": 17, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=9&partner=1000001009", 
            "low": 3, 
            "sunset": "19:54", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "西南风", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "day": {
                "wthr": "小雨", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371550.6113.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284574.0261.jpg", 
                "wp": "<3级", 
                "type": 8, 
                "wd": "西北风", 
                "notice": "雨虽小,注意保暖别感冒"
            }
        }, 
        {
            "date": "20190416", 
            "sunrise": "06:43", 
            "high": 21, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=10&partner=1000001009", 
            "low": 5, 
            "sunset": "19:55", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "南风", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "西北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190417", 
            "sunrise": "06:42", 
            "high": 19, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=11&partner=1000001009", 
            "low": 6, 
            "sunset": "19:56", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "东南风", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190418", 
            "sunrise": "06:40", 
            "high": 18, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=12&partner=1000001009", 
            "low": 3, 
            "sunset": "19:57", 
            "night": {
                "wthr": "小雨", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371554.566.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284577.5363.jpg", 
                "wp": "<3级", 
                "type": 8, 
                "wd": "东南风", 
                "notice": "别看雨还小,冒雨要不得"
            }, 
            "day": {
                "wthr": "小雨", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371550.6113.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284574.0261.jpg", 
                "wp": "3-4级", 
                "type": 8, 
                "wd": "西北风", 
                "notice": "雨虽小,注意保暖别感冒"
            }
        }, 
        {
            "date": "20190419", 
            "sunrise": "06:39", 
            "high": 21, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=13&partner=1000001009", 
            "low": 5, 
            "sunset": "19:58", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "南风", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "东北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190420", 
            "sunrise": "06:37", 
            "high": 20, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=14&partner=1000001009", 
            "low": 8, 
            "sunset": "19:59", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "东南风", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "东北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190421", 
            "sunrise": "06:36", 
            "high": 20, 
            "forecastUrl": "http://m.weathercn.com/daily-weather-forecast.do?language=zh-cn&smartid=101160701&day=15&partner=1000001009", 
            "low": 6, 
            "sunset": "20:00", 
            "night": {
                "wthr": "阴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371482.976.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284487.8387.jpg", 
                "wp": "<3级", 
                "type": 34, 
                "wd": "东风", 
                "notice": "今晚虽阴,月光洒满你的梦"
            }, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "东风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }
    ], 
    "hourfc_up_date": "20190407210204", 
    "forecast": [
        {
            "date": "20190406", 
            "sunrise": "06:58", 
            "high": 22, 
            "low": 6, 
            "sunset": "19:45", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "无持续风向", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "aqi": 104, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "4-5级", 
                "type": 1, 
                "wd": "西北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }, 
        {
            "date": "20190407", 
            "sunrise": "06:57", 
            "high": 21, 
            "low": 5, 
            "sunset": "19:46", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "无持续风向", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "aqi": 70, 
            "day": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371463.3431.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284459.5844.jpg", 
                "wp": "4-5级", 
                "type": 2, 
                "wd": "西北风", 
                "notice": "阴晴之间,谨防紫外线侵扰"
            }
        }, 
        {
            "date": "20190408", 
            "sunrise": "06:55", 
            "high": 11, 
            "low": 0, 
            "sunset": "19:47", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "无持续风向", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "aqi": 55, 
            "day": {
                "wthr": "小雨", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371550.6113.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284574.0261.jpg", 
                "wp": "3-4级", 
                "type": 8, 
                "wd": "西北风", 
                "notice": "雨虽小,注意保暖别感冒"
            }
        }, 
        {
            "date": "20190409", 
            "sunrise": "06:54", 
            "high": 16, 
            "low": -1, 
            "sunset": "19:48", 
            "night": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371467.4939.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284464.307.jpg", 
                "wp": "<3级", 
                "type": 2, 
                "wd": "无持续风向", 
                "notice": "夜晚多云,愿你梦里有月光"
            }, 
            "aqi": 61, 
            "day": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371463.3431.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284459.5844.jpg", 
                "wp": "4-5级", 
                "type": 2, 
                "wd": "西北风", 
                "notice": "阴晴之间,谨防紫外线侵扰"
            }
        }, 
        {
            "date": "20190410", 
            "sunrise": "06:52", 
            "high": 17, 
            "low": 0, 
            "sunset": "19:49", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "无持续风向", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "aqi": 56, 
            "day": {
                "wthr": "多云", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371463.3431.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505284459.5844.jpg", 
                "wp": "4-5级", 
                "type": 2, 
                "wd": "西北风", 
                "notice": "阴晴之间,谨防紫外线侵扰"
            }
        }, 
        {
            "date": "20190411", 
            "sunrise": "06:51", 
            "high": 19, 
            "low": 2, 
            "sunset": "19:50", 
            "night": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505371453.2293.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505215052.3458.jpg", 
                "wp": "<3级", 
                "type": 1, 
                "wd": "无持续风向", 
                "notice": "祝你有个晴朗的梦"
            }, 
            "aqi": 54, 
            "day": {
                "wthr": "晴", 
                "bgPic": "http://static.etouch.cn/imgs/upload/1505379621.3163.jpg", 
                "smPic": "http://static.etouch.cn/imgs/upload/1505181366.5006.jpg", 
                "wp": "3-4级", 
                "type": 1, 
                "wd": "西北风", 
                "notice": "愿你拥有比阳光明媚的心情"
            }
        }
    ], 
    "hourfc": [
        {
            "wthr": 15, 
            "shidu": "26%", 
            "hourfcUrl": "", 
            "wp": "4-5级", 
            "type_desc": "阴", 
            "time": "201904072100", 
            "type": 34, 
            "wd": "东南风"
        }, 
        {
            "wthr": 14, 
            "shidu": "28%", 
            "hourfcUrl": "", 
            "wp": "4-5级", 
            "type_desc": "阴", 
            "time": "201904072200", 
            "type": 34, 
            "wd": "东北风"
        }, 
        {
            "wthr": 13, 
            "shidu": "28%", 
            "hourfcUrl": "", 
            "wp": "4-5级", 
            "type_desc": "阴", 
            "time": "201904072300", 
            "type": 34, 
            "wd": "北风"
        }, 
        {
            "wthr": 12, 
            "shidu": "31%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "阴", 
            "time": "201904080000", 
            "type": 34, 
            "wd": "北风"
        }, 
        {
            "wthr": 11, 
            "shidu": "31%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "阴", 
            "time": "201904080100", 
            "type": 34, 
            "wd": "北风"
        }, 
        {
            "wthr": 10, 
            "shidu": "33%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "阴", 
            "time": "201904080200", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 9, 
            "shidu": "42%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "多云", 
            "time": "201904080300", 
            "type": 2, 
            "wd": "西北风"
        }, 
        {
            "wthr": 7, 
            "shidu": "45%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "多云", 
            "time": "201904080400", 
            "type": 2, 
            "wd": "西北风"
        }, 
        {
            "wthr": 6, 
            "shidu": "48%", 
            "hourfcUrl": "", 
            "wp": "6-7级", 
            "type_desc": "多云", 
            "time": "201904080500", 
            "type": 2, 
            "wd": "西北风"
        }, 
        {
            "wthr": 5, 
            "shidu": "49%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "多云", 
            "time": "201904080600", 
            "type": 2, 
            "wd": "西北风"
        }, 
        {
            "wthr": 5, 
            "shidu": "49%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904080700", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 7, 
            "shidu": "45%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904080800", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 7, 
            "shidu": "41%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904080900", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 9, 
            "shidu": "33%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904081000", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 9, 
            "shidu": "32%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904081100", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 10, 
            "shidu": "40%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904081200", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 11, 
            "shidu": "42%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "小雨", 
            "time": "201904081300", 
            "type": 8, 
            "wd": "西北风"
        }, 
        {
            "wthr": 12, 
            "shidu": "45%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904081400", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 13, 
            "shidu": "45%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904081500", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 14, 
            "shidu": "43%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "小雨", 
            "time": "201904081600", 
            "type": 8, 
            "wd": "西北风"
        }, 
        {
            "wthr": 15, 
            "shidu": "38%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "小雨", 
            "time": "201904081700", 
            "type": 8, 
            "wd": "西风"
        }, 
        {
            "wthr": 14, 
            "shidu": "41%", 
            "hourfcUrl": "", 
            "wp": "8-9级", 
            "type_desc": "阴", 
            "time": "201904081800", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 13, 
            "shidu": "42%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "阴", 
            "time": "201904081900", 
            "type": 34, 
            "wd": "西北风"
        }, 
        {
            "wthr": 11, 
            "shidu": "45%", 
            "hourfcUrl": "", 
            "wp": "5-6级", 
            "type_desc": "阴", 
            "time": "201904082000", 
            "type": 34, 
            "wd": "西北风"
        }
    ], 
    "xianhao": [ ], 
    "source": {
        "link": "http://m.weathercn.com/index.do?language=zh-cn&smartid=101160707&partner=1000001009", 
        "icon": "http://static.etouch.cn/icon/tianqitong.png", 
        "title": "中国天气通"
    }, 
    "evn": {
        "no2": 11, 
        "mp": "颗粒物(PM2.5)", 
        "pm25": 18, 
        "o3": 114, 
        "so2": 13, 
        "pm10": 38, 
        "aqi": 38, 
        "suggest": "各类人群可自由活动", 
        "time": "21:00:00", 
        "co": 0, 
        "quality": "优"
    }, 
    "observe": {
        "shidu": "24%", 
        "wthr": "阴", 
        "temp": 12, 
        "night": {
            "bgPic": "http://static.etouch.cn/imgs/upload/1505371482.976.jpg", 
            "smPic": "http://static.etouch.cn/imgs/upload/1505284487.8387.jpg"
        }, 
        "up_time": "21:14", 
        "wp": "2级", 
        "tigan": "12", 
        "type": 34, 
        "wd": "东南风", 
        "day": {
            "bgPic": "http://static.etouch.cn/imgs/upload/1505371479.5574.jpg", 
            "smPic": "http://static.etouch.cn/imgs/upload/1505284484.5873.jpg"
        }
    }
}


以下是我的配置
#天气通
- platform: rest
  name: situation
  resource: [url=http://zhwnlapi.etouch.cn/Ecalender/api/v2/weather?citykey=101160707]http://zhwnlapi.etouch.cn/Ecalen ... r?citykey=101160707[/url]
  scan_interval: 300
  value_template: >
    {{ value_json["forecast"][1]["day"]["wthr"].title()}},{{ value_json["forecast"][1]["day"]["wd"].title()}},{{ value_json["forecast"][1]["day"]["wp"].title()}},
    {{ value_json["forecast"][1]["low"]}}~{{ value_json["forecast"][1]["high"]}},{{ value_json["forecast"][1]["day"]["notice"].title()}}
  json_attributes:
    - forecast                       #七日情况
    - evn                            #空气质量
    - observe                        #当前温湿度
- platform: template
  sensors:
    cond:
      value_template: >
       {{states.sensor.situation.attributes.observe.wthr}},
       {{states.sensor.situation.attributes.forecast[1].day.notice}}
    aqi:
      value_template: '{{states.sensor.situation.attributes.evn.aqi}} ({{states.sensor.situation.attributes.evn.quality}})'
    aqiii:
      value_template: '{{states.sensor.situation.attributes.evn.aqi}}'
      friendly_name: 'AQI'
    pm25:
      value_template: '{{states.sensor.situation.attributes.evn.pm25}}'
      friendly_name: 'PM2.5'
      unit_of_measurement: "lx"
    pm10:
      value_template: '{{states.sensor.situation.attributes.evn.pm10}}'
      friendly_name: 'PM10'
      unit_of_measurement: "lx"
    so2:
      value_template: '{{ states.sensor.situation.attributes.evn.so2 }}'
      friendly_name: 'SO₂'
      unit_of_measurement: "lx"
    no2:
      value_template: '{{ states.sensor.situation.attributes.evn.no2 }}'
      friendly_name: 'NO₂'
      unit_of_measurement: "lx"
    o3:
      value_template: '{{ states.sensor.situation.attributes.evn.o3 }}'
      friendly_name: 'O₃'
      unit_of_measurement: "lx"
    co:
      value_template: '{{ states.sensor.situation.attributes.evn.co }}'
      friendly_name: 'CO'
      unit_of_measurement: "lx"
    dominentpol:
      value_template: '{{states.sensor.situation.attributes.evn.mp}}'
      friendly_name: '主要污染物'
      unit_of_measurement: ''
    temp:
      value_template: '{{ states.sensor.situation.attributes.observe.temp }}'
      friendly_name: '当前温度'
      unit_of_measurement: "°C"
    temp_min:
      value_template: '{{states.sensor.situation.attributes.forecast[1].low}}'
      friendly_name: '最低温度'
      unit_of_measurement: "°C"
    temp_max:
      value_template: '{{states.sensor.situation.attributes.forecast[1].high}}'
      friendly_name: '最高温度'
      unit_of_measurement: "°C"
    temp_fl:
      value_template: '{{states.sensor.situation.attributes.observe.tigan}}'
      friendly_name: '体感温度'
      unit_of_measurement: "°C"
    humidity:
      value_template: '{{states.sensor.situation.attributes.observe.shidu}}'
      friendly_name: '湿度'
      unit_of_measurement: "%"
    wind:
      value_template: '{{ states.sensor.situation.attributes.observe.wd }}{{ states.sensor.situation.attributes.observe.wp }}'
      friendly_name: '风向风速'

游客,如果您要查看本帖隐藏内容请回复
加个图
无标题.png

评分

参与人数 1金钱 +20 收起 理由
+ 20 感谢楼主分享!

查看全部评分

回复

使用道具 举报

123

主题

4665

帖子

1万

积分

管理员

囧死

Rank: 9Rank: 9Rank: 9

积分
16456
金钱
11706
HASS币
45
发表于 2019-4-7 21:58:28 | 显示全部楼层
感谢分享,楼主要附个图就更好了~
回复

使用道具 举报

23

主题

1338

帖子

6777

积分

超级版主

Rank: 8Rank: 8

积分
6777
金钱
5414
HASS币
100

教程狂人

发表于 2019-4-7 22:03:57 | 显示全部楼层
感谢分享
回复

使用道具 举报

6

主题

743

帖子

6032

积分

论坛元老

Rank: 8Rank: 8

积分
6032
金钱
5284
HASS币
20
 楼主| 发表于 2019-4-7 22:07:54 | 显示全部楼层
Jones 发表于 2019-4-7 21:58
感谢分享,楼主要附个图就更好了~

加了个aqi和当天天气的图。
回复

使用道具 举报

2

主题

206

帖子

855

积分

论坛积极会员

积分
855
金钱
649
HASS币
0
发表于 2019-4-7 22:19:38 | 显示全部楼层
感谢分享
回复

使用道具 举报

0

主题

56

帖子

292

积分

中级会员

Rank: 3Rank: 3

积分
292
金钱
236
HASS币
0
发表于 2019-4-7 22:56:37 | 显示全部楼层
感谢楼主分享!
回复

使用道具 举报

0

主题

167

帖子

5040

积分

论坛元老

Rank: 8Rank: 8

积分
5040
金钱
4873
HASS币
0
发表于 2019-4-7 23:02:37 | 显示全部楼层
感谢分享
回复

使用道具 举报

9

主题

251

帖子

4394

积分

元老级技术达人

积分
4394
金钱
4128
HASS币
100
发表于 2019-4-7 23:04:28 | 显示全部楼层
谢谢楼主分享!

不过现在用的是免费版darksky,凑合用。
E5-2650L-V2+华南X79+16GB*2
回复

使用道具 举报

0

主题

102

帖子

484

积分

中级会员

Rank: 3Rank: 3

积分
484
金钱
382
HASS币
0
发表于 2019-4-8 00:08:25 | 显示全部楼层
好东西,支持一下
回复

使用道具 举报

1

主题

64

帖子

592

积分

论坛积极会员

积分
592
金钱
528
HASS币
0
发表于 2019-4-8 05:47:03 | 显示全部楼层
天气问题一直没解决
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-1-10 10:44 , Processed in 0.304892 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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