Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
"""
Hasivo Switch Scraper for Home Assistant
放置於: /config/scripts/hasivo_scraper.py
記得設定執行權限: chmod +x /config/scripts/hasivo_scraper.py
"""
import requests
import hashlib
import json
import sys
@patrick3399
patrick3399 / hasivo_2.5g_sw.yaml
Last active November 21, 2025 17:10
Login YAML
command_line:
- sensor:
name: "Hasivo Switch2 All Ports"
unique_id: hasivo_switch2_ports
command: "python3 /config/python_scripts/hasivo_2.5g_scraper.py"
scan_interval: 180
value_template: "{{ value_json.status }}"
json_attributes:
- ports
template:
@patrick3399
patrick3399 / decode.yaml
Last active March 6, 2026 15:22
ESPHome MiBeacon v5 AES-CCM Remote Decoder
substitutions:
devicename: "mi decode"
upper_devicename: "Mi Decode"
comment: ""
bindkey: "fa0fd744af52860c2ac77a61a29ada89"
key_press_delay: "2s"
esp32_ble_tracker:
on_ble_advertise:
- mac_address: AA:BB:CC:DD:EE:DD
@patrick3399
patrick3399 / Hasivo-ui.yaml
Last active September 26, 2025 13:07
Hasivo POE Switch UI for Home Assistant
type: entities
entities:
- entity: sensor.hasivo_switch_cpu_temperature
type: custom:multiple-entity-row
name: Switch
state_header: CPU Temp
icon: mdi:switch
styles:
width: 60px
entities:
@patrick3399
patrick3399 / Hasivo-entity.yaml
Last active September 26, 2025 13:06
Hasivo PoE Switch For Home Assistant
scrape:
- <<: &login
username: homeassistant
password: home
<<: &basic
scan_interval: 180
resource: "http://192.168.10.3/protected/systemCfg.do"
encoding: gbk
sensor:
# CPU Usage
# This is PZIOT-E02 ESPHome Yaml
# File at https://gist.github.com/patrick3399/bfc15074b6985d7c50fe8c06f6585b38
# wifi_ssid,wifi_password,api_key,ota_password,captive_portal_password setup at secret.yaml
substitutions:
devicename: "pziot-e02"
upper_devicename: PZIOT-E02
esphome:
name: $devicename
project:
name: "patrick3399.PZIOT-E02"
@patrick3399
patrick3399 / S31-Ultimate.yaml
Last active July 20, 2025 14:44
S31-Ultimate
#Feature:
#Adjustable Overload Protect, Custom Current and Timing.
#Auto Overload Recovery, Adjustable Timing
#All Time 16A Safety Overload Protect
#Changeable Relay Initial State
#Overload Warning With LED Effect
#Detachment Relay Mode Support
#Press the Buttom more then 10s to Return the Factory Setting (AP Mode)
#Web and OTA, mDNS Available
#Github https://gist.github.com/patrick3399/23297c6ca4b37dfc87ca8593183a9a17
substitutions:
devicename: sonoff-s31-auto
upper_devicename: Sonoff S31-1
comment: Sonoff S31 Auto Reboot
esphome:
name: $devicename
comment: $comment
libraries:
- akajes/AsyncPing(esp8266)
platformio_options: