跳转至

天气预报与交通状况图——另类摄像头

操作步骤

  1. 访问yr本地天气预报矢量图
  2. 配置天气预报图片摄像头
  3. 访问上海实时交通状况图
  4. 配置实时交通状况图片摄像头

参考

  • YR上海天气矢量图地址

https://www.yr.no/place/Kina/Shanghai/Shanghai/meteogram.svg

  • generic摄像头配置文档

https://www.home-assistant.io/integrations/generic

  • 远程图片摄像头配置样例

    camera: - platform: generic name: cam7 still_image_url: https://www.yr.no/place/Kina/Shanghai/Shanghai/meteogram.svg content_type: 'image/svg+xml'

  • 上海实时交通路况图地址

http://www.jtcx.sh.cn/jtcximg/cityhot/gj_home.png

  • 本地文件摄像头配置文档

https://www.home-assistant.io/integrations/local_file

  • 更新本地图片并显示为摄像头example_8_6_1.yaml

```yaml # example_8_6_1.yaml # 一个显示本地图片camera设备 camera: - platform: local_file name: cam8 file_path: /home/pi/Pictures/shjt.png

# 更新本地图片的命令 shell_command: update_shjt: wget http://www.jtcx.sh.cn/jtcximg/cityhot/gj_home.png -O /home/pi/Pictures/shjt.png

# 每10分钟更新一张本地图片 automation: - alias: sh_triffic_condition_update trigger: - platform: time minutes: '/10' seconds: 00 action: - service: shell_command.update_shjt - delay: seconds: 5 - service: camera.local_file_update_file_path data: entity_id: camera.cam8 file_path: /home/pi/Pictures/shjt.png ```

返回课程目录↩