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

标题: 关于企业微信推送图片手机端使用缓存不更新的问题,求解 [打印本页]

作者: tiger81    时间: 2019-9-13 10:31
标题: 关于企业微信推送图片手机端使用缓存不更新的问题,求解
如题,使用企业微信推送图片时发现手机端使用缓存导致图片不更新的问题,除非把文件名改了否则手机端显示的永远是旧的图片。
现在的思路是给文件名加个时间,关键是推送时如何正确读取文件名,希望大神们解决一下,谢谢!

作者: tiger81    时间: 2019-9-13 10:41
https://developers.weixin.qq.com ... e480ed919b9b5751c00

确认是微信问题
作者: linlingzi    时间: 2019-9-13 12:57
抓图的时候加入时间戳:
  - service: camera.snapshot
    data_template:
      entity_id: 你的摄像机
      filename: /home/homeassistant/.homeassistant/www/images/door1bell{{ now().strftime('%Y%m%d%H%M') }}.jpg
使用目录检测最新文件
folder_watcher:
  - folder: /home/homeassistant/.homeassistant/www/images(目录自己设定)
    patterns:
      - '*.jpg'
以下是自动化程序,发现新图片,推送至微信
- alias: New file alert
  trigger:
    platform: event
    event_type: folder_watcher
    event_data:
      event_type: created
  action:
  - service: notify.weixin_quanjia
    data_template:
      title: 安全提醒
      message: "news|门外来人!|视频文件|你的地址/local/images/{{ trigger.event.data.file }}"


作者: linlingzi    时间: 2019-9-13 12:59
特别说明:
以下需要加入config,不然好像检测不到
homeassistant:
  whitelist_external_dirs:
    - /home/homeassistant/.homeassistant/www/images

作者: tiger81    时间: 2019-9-13 13:14
linlingzi 发表于 2019-9-13 12:57
抓图的时候加入时间戳:
  - service: camera.snapshot
    data_template:

非常感谢,我试试!
作者: tiger81    时间: 2019-9-13 14:36
linlingzi 发表于 2019-9-13 12:59
特别说明:
以下需要加入config,不然好像检测不到
homeassistant:

再次感谢!
我是推送实时的路况用的,已经按照你的方法搞定了!




欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/) Powered by Discuz! X3.5