Skip to content

Instantly share code, notes, and snippets.

@Staubgeborener
Last active December 7, 2024 10:40
Show Gist options
  • Save Staubgeborener/6eec0729b88e8b714b23237fd9d7a857 to your computer and use it in GitHub Desktop.
Save Staubgeborener/6eec0729b88e8b714b23237fd9d7a857 to your computer and use it in GitHub Desktop.
How to use Tasmota with homepage
Tasmota devices have a web ui which is accessible via the ip address of the device. This UI offers an API which can be accessed via the following URL:
http://tasmota-ip/cm?cmnd=Status%2010
You can select any variable there that you want to map in homepage with the custom API widget.
The output will look more or less like this:
{
"StatusSNS": {
"Time": "2024-12-07T11:39:47",
"Switch1": "ON",
"ANALOG": {
"Temperature1": 46.2
},
"ENERGY": {
"TotalStartTime": "2023-11-03T14:59:22",
"Total": 62.741,
"Yesterday": 0.291,
"Today": 0.229,
"Power": 271,
"ApparentPower": 451,
"ReactivePower": 360,
"Factor": 0.6,
"Voltage": 260,
"Current": 1.736
},
"TempUnit": "C"
}
}
To give you an idea, the following content in services.yaml shows Temp, Power, Current and Voltage in homepage:
- Tasmota:
widget:
type: customapi
url: http://tasmota-ip/cm?cmnd=Status%2010
refreshInterval: 1000
method: GET
mappings:
- field:
StatusSNS:
ANALOG: Temperature1
label: Temp
suffix: "C"
- field:
StatusSNS:
ENERGY: Power
label: Power
suffix: "W"
- field:
StatusSNS:
ENERGY: Current
label: Current
suffix: "A"
- field:
StatusSNS:
ENERGY: Voltage
label: Voltage
suffix: "V"
Example image: https://imgur.com/a/w3lplK6
The Tasmota API has other endpoints such as this: http://tasmota/cm?cmnd=Status%200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment