Skip to content

Instantly share code, notes, and snippets.

@linusgke
Created February 20, 2025 11:16
Show Gist options
  • Select an option

  • Save linusgke/b5140f4f180606316fd14f39a2c0f0c2 to your computer and use it in GitHub Desktop.

Select an option

Save linusgke/b5140f4f180606316fd14f39a2c0f0c2 to your computer and use it in GitHub Desktop.
# === HomeAssistant RESTful Sensor for Avalon Nano ===
# <IP> is the ip address of your device
# <HASH> is your user password which you obtain as follows:
# Log into your Avalon Nano, open Dev Tools (F12), go to Network Tab, see outgoing reqeusts.
# Look at request headers and see Cookie-Header. Copy value for "auth" cookie.
rest:
- resource: http://<IP>/get_home.cgi
scan_interval: 10
headers:
Cookie: "auth=<HASH>"
sensor:
- name: "Miner 1 AVG Hashrate"
value_template: "{{ (value[13:-74]|from_json).av }}"
unit_of_measurement: THs
state_class: measurement
- name: "Miner 1 Real-time Hashrate"
value_template: "{{ (value[13:-74]|from_json).hash_5m }}"
unit_of_measurement: THs
state_class: measurement
- name: "Miner 1 Accepted"
value_template: "{{ (value[13:-74]|from_json).accepted }}"
state_class: measurement
- name: "Miner 1 Declined"
value_template: "{{ (value[13:-74]|from_json).reject }}"
state_class: measurement
- name: "Miner 1 System temperature"
value_template: "{{ (value[13:-74]|from_json).temperature }}"
device_class: temperature
state_class: measurement
unit_of_measurement: °C
- name: "Miner 1 CPU temperature"
value_template: "{{ (value[13:-74]|from_json).MTavg1 }}"
device_class: temperature
state_class: measurement
unit_of_measurement: °C
- name: "Miner 1 Fan RPM"
value_template: "{{ (value[13:-74]|from_json).fan1 }}"
unit_of_measurement: RPM
state_class: measurement
- name: "Miner 1 System status"
value_template: "{{ (value[13:-74]|from_json).sys_status }}"
- name: "Miner 1 Uptime"
value_template: "{{ (value[13:-74]|from_json).elapsed }}"
device_class: duration
state_class: total_increasing
@PJM2880
Copy link

PJM2880 commented Sep 29, 2025

How, this is great, but how can I access multiple Nano3 miners?
Just renaming Miner 1 to Miner 2 and copy/paste the same text below?
And changing the IP's then of course
I tried that but still get only 9entities...
I'm sure I'm doing smth wrong somewhere.
Can you help me out somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment