Smartfox SDK for Python
NOTE: This is not an offical Smartfox SDK. Only reverse engineered the browser requests.
This Python Package enables you to develop applications with the Smartfox.
Install:
pip install smartfox
Example get a value:
from smartfox import Smartfox
# Initialize a new smartfox connection
smartfox = Smartfox("my-smartfox.local")
# update the values
smartfox.getValues()
# print
print(smartfox.consumption)
# print the value
print(smartfox.consumption.value)
Example set a relay or analog output:
from smartfox import Smartfox
# Initialize a new smartfox connection
smartfox = Smartfox("my-smartfox.local")
smartfox.relay1.turnOff() # turn off relay 1
smartfox.relay1.turnOn() # turn on relay 1
smartfox.analog.set(10) # set analog output to 10%
smartfox.analog.setAuto() # set analog output to auto
smartfox.analog.off() # set analog output to off
Value Objects
| Type | Names | Methods | Args | Class Variables |
|---|---|---|---|---|
| PowerValue | consumption, pv, carCharger, heatPump, power, effectivePower, heatPumpPower, power, effectivePower, heatPumpPower, heatPumpThermPower, batteryPower |
- | - | value, unit |
| EnergyValue | energy, returnEnergy, effectiveEnergy, apparentEnergy, dayEnergy, dayReturnEnergy, carChargeCurrentChargeEnergy, carChargeEnergy, heatPumpEnergy, heatPumpThermEnergy |
- | - | value, unit |
| VoltageValue | - | - | value, unit | |
| PFValue | - | - | value, unit | |
| CurrentValue | - | - | value, unit | |
| TimeValue | - | - | value, unit | |
| PercentValue | soc | - | - | value, unit |
| TempValue | bufferHot, bufferCold, warmWater |
- | - | value, unit |
Example
from smartfox import Smartfox
# Initialize a new smartfox connection
smartfox = Smartfox("my-smartfox.local")
# update the values
smartfox.getValues()
# get power
print(smartfox.power) # returns string
print(smartfox.power.value) # returns power as float
print(smartfox.power.unit) # returns the unit of power
Result:
>> power value: 972.0 W
>> 972.0
>> W
Objects
| Type | names | Methods | Args | Class Variables |
|---|---|---|---|---|
| Phase | phase1, phase2, phase3 |
- | - | voltage: VoltageValue, current: CurrentValue, power: PowerValue, powerFactor: PFValue |
| Relay | relai1, relai2, relai3, relai4 |
turnOn(), turnOff() |
- | id, remainingTime: TimeValue, overallTime: TimeValue, smartfox: Smartfox |
| AnalogOut | analog | set(value), setAuto(), off() |
- | percentage: PercentValue, power: Powervalue |
Example
from smartfox import Smartfox
# Initialize a new smartfox connection
smartfox = Smartfox("my-smartfox.local")
print(smartfox.phase1.power) # returns phase1 power
print(smartfox.relai4.turnOn()) # turns relai4 on
Metadata
Release files for smartfox 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smartfox-1.0.0.tar.gz | 27.7 kB | Without provenance | Details for smartfox-1.0.0.tar.gz |
Release files / smartfox-1.0.0.tar.gz
| Download URL | smartfox-1.0.0.tar.gz |
|---|---|
| Size | 27.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e969baf383bc2d0b0fb542be5cd1cf69312b7ec13441097825d57e12067bd61
|
|
BLAKE2b-256 checksum How to use checksums |
0aebbd6bab0dc86d0219937990d64b1c4e05227ab512d8e693483bb7ba62b187
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.5
|
Security for smartfox 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.