This is a simple widget for Scriptable that displays current power consumption data from your powermeter.
To set up the widget, follow these steps:
- Load the contents of
powermeter.js
file into Scriptable. - Update the
ip-adress
variable with the IP address or URL of your tasmota ir reader AND JSON variables. - Run the widget. Upon the first run, an
powermeter-config.json
file is created inside the Scriptable folder of your iCloud. - If desired, you may customize the thresholds section as well to configure how the Power value is colored.
depending on the variables used in the tasmota script, the designation “m60” or “power” must also be adapted. in my case, the output in the browser with the address http://IP-adress/cm?cmnd=status%208 looks like this
{"StatusSNS":{"Time":"2024-06-03T06:24:23","M60":{"E_in":2367.678,"E_out":41.915,"Power":46}}}
see line in script:
return parseFloat(powerDrawData.StatusSNS["M60"]["Power"]) || 0;
Due to power saving specifications from Apple iOS, the widget update rate cannot be triggered by the script, it is performed by iOS. The time since the last update is therefore displayed.
It is strongly recommended not to completely expose your Tasmota device to the internet due to security reasons. For additional security, you might want to set up HTTP Basic authentication for the URLs. The widget provides support for that as well (c.f. above).
- Scriptable
- Tasmota Smart Meter Interface
- Smartmeter Reader find smartmeter reader with tasmota firmware