def calc_week_summary(days=7, da=-8 ): """過去days日分の集計(今日を除く昨日まで)""" base_day = datetime.now().date() results = [] for i in range(1+8+da, days + 1+8+da): target_date = base_day - timedelta(days=i) try: df = load_day_data(target_date) date_label = target_date.strftime("%m/%d") summary = calc_daily_summary(df, date_label) results.append(summary) except Exception as e: print(f"{target_date} のデータ読み込み失敗: {e}")
if not results: return None
total_gen = sum(r["gen"] for r in results) total_buy = sum(r["buy"] for r in results) total_sell = sum(r["sell"] for r in results) total_use = sum(r["use"] for r in results)
lines = [f"【過去{days}日間実績】"] for r in reversed(results): # 古い順→新しい順 lines.append(f"{r['date']}: 発電{r['gen']} kWh") lines.append("") lines.append(f"合計発電量: {total_gen:.1f} kWh") lines.append(f"合計買電量: {total_buy:.1f} kWh") lines.append(f"合計売電量: {total_sell:.1f} kWh") lines.append(f"合計消費量: {total_use:.1f} kWh")
11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:04.599][192.168.x.xx:57372] server connect www.frontier-monitor.com:443(150.31.252.104:443) 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:05.235][192.168.x.xx:57372] Client TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min option. 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:05.240][192.168.x.xx:57372] client disconnect 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:05.245][192.168.x.xx:57372] server disconnect www.frontier-monitor.com:443 (150.31.252.104:443) 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:11.362][192.168.x.xx:43760] client connect 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:11.469][192.168.x.xx:43760] server connect www.frontier-monitor.com:443 (150.31.252.104:443) 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:12.019][192.168.x.xx:43760] Client TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min option. 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:12.023][192.168.x.xx:43760] client disconnect 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:12.028][192.168.x.xx:43760] server disconnect www.frontier-monitor.com:443 (150.31.252.104:443) 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:18.092][192.168.x.xx:40724] client connect 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:18.143][192.168.x.xx:40724] server connect www.frontier-monitor.com:443 (150.31.252.104:443) 11月 29 17:11:53 hsbox mitmdump[47809]: [17:10:18.670][192.168.x.xx:40724] Client TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust mitmproxy's tls_version_client_min option. 11月 29
「Client TLS handshake failed. Client and mitmproxy cannot agree on a TLS version to use. You may need to adjust」このログが大量に出ているが、これが問題だったようだ。 TLS1.0に下げるように要求されている。 hsBoxでも設定で下げれないことはないが、外部公開している入り口が怪しくなるので無理にTLS1.0にさげないことにした。