过年在家研究下树莓派

1.每次重启树莓派都会改变mac地址,造成route设备不能绑定到IP。
解决方案:修改/etc/rc.local文件。
增加:ifconfig wlan0 down
ifconfig wlan0 hw ether XX:XX:XX:XX:XX:XX
ifconfig wlan0 up
重启后解决问题。SSH登录再也不是烦恼了。
2.关于树莓派的蓝牙设置
sudo bluetoothctl
之后可以scan on  connect MAC
3.ha 自动播报天气的设置
alias: 天气播报
trigger:

  • hours: '0'
    minutes: '27'
    platform: time_pattern
    seconds: '0'
    condition:
  • above: '0'
    condition: numeric_state
    entity_id: sensor.weather_temperature
    action:
  • alias: ''
    data_template:##这个很重要,之前只写了个data,导致TTS并没有转化数据,而只是按字符串读出。
    message: "现在播报天气信息。温度,{{states('sensor.weather_temperature')}}°C, 湿度{{states('sensor.weather_humidity')}},风速{{states('sensor.weather_wind_speed')}}, 气压{{states('sensor.weather_pressure')}}"
    service: tts.baidu_say

猜你喜欢

转载自www.cnblogs.com/smartOnePunchMan/p/12221883.html