Created
February 20, 2025 11:16
-
-
Save linusgke/b5140f4f180606316fd14f39a2c0f0c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# === 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment