本帖最后由 lidicn 于 2018-4-8 18:36 编辑
微信小程序【油价助手】
配置Yaml
sensor:
- platform: rest
resource: https://t.weimeihuo.com/oil/today?pid=??
name: oil
value_template: '{{ value_json["items"][2]["unit"]}}'
unit_of_measurement: "元"
- platform: rest
resource: https://t.weimeihuo.com/car/fee/cate?id=???&month=1
name: oil_cost
value_template: '{{ value_json["items"][0]["cates"][0]["total"]}}'
unit_of_measurement: "元"
headers:
Content-Type: application/json
Accept-Encoding: gzip
referer: https://servicewechat.com/wx?????????/19/page-frame.html
api-key: ?????????????????????????????????
api-udid: 00000000000000000000000000000000
api-apiver: 1
content-type: application/json
api-auth: ?????????????????????????????????
api-chn: 0
User-Agent: Mozilla/5.0 (Linux; Android 8.0; MIX 2 Build/OPR1.170623.027; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 MQQBrowser/6.2 TBS/044005 Mobile Safari/537.36 MicroMessenger/6.6.5.1280(0x26060536) NetType/WIFI Language/zh_CN MicroMessenger/6.6.5.1280(0x26060536) NetType/WIFI Language/zh_CN
Host: t.weimeihuo.com
Connection: Keep-Alive
group:
oil:
name: 今日油价
view: no
entities:
- sensor.oil
- sensor.oil_cost
homeassistant:
customize:
sensor.oil:
friendly_name: 今日油价
homebridge_hidden: true
sensor.oil_cost:
friendly_name: 本月油费
homebridge_hidden: true
其中??为需要修改的
|