An API to read the status of an intellifire wifi module
Project description
Intellifire (New and Improved)
This is a 100% unofficial python module for working with the IntelliFire API for Intellifire WIFI Modules.
Intellifire is a wifi module for a variety of fireplaces. It has both ios/android apps - but they dont like to publish the api.
From my research I've identified 4 endpoints:
/poll
/get_serial
/get_challenge
/post
This module will parse data from botht he /get_serial and /poll endpoints and parse the resultatn JSON into something readable.
If anybody knows more about OAuth and wants to help me reverse engineer the control endpoints I'd love the help!
Hit me up on github: https://github.com/jeeftor
Local Polling
Both Intellifire and IntellifireAsync classes will poll an intellifire interface on the local network for a read-only view of the device. All that is required is the ip address. If you need to discover that see further on in this document.
Sync
# Define an intellifre instance
fire = Intellifire("192.168.1.80")
# Poll to update the internal data source
fire.poll()
# Print out all values
print(fire.data)
Async
async def main():
fire = IntellifireAsync("127.0.0.1")
await fire.poll()
# Poll the fire
print(f"{fire.data.temperature_c} c")
print(f"{fire.data.temperature_f} f")
print(f"{fire.data.thermostat_setpoint_c} c")
print(f"{fire.data.thermostat_setpoint_f} f")
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Local Control
The Intellifire unit has the ability to accept local control commands on the /post endpoint. However there is some cloud access as an ApiKey needs to be extracted from iftapi.net.
Local control is currently not yet implemented
Cloud Control
Taking advantage of the iftapi.net REST API - the module can send commands to the cloud in order to control a specific fireplace. Conceptually the API is divided into Users who have control of Locations which contain Fireplaces.
┌───────────┐
│ Users │
└─────┬─────┘
│
│
┌─────▼─────┐
│ Location │
└─────┬─────┘
│
│
┌─────▼─────┐
│ Fireplace │
└───────────┘
The IFT-API requires cookie based authentication for sending control commands via its REST API endpoint. These cookies are generated by the login method:
username = os.environ['IFT_USER']
password = os.environ['IFT_PASS']
# Init and login
control_interface = IntellifireControl(fireplace_ip='192.168.1.65')
control_interface.login(username=username, password=password)
Once the login is complete all further control requests will use the cookies to authenticate and control things.
Power (Flame on/off)
The following calls will toggle the flame on or off:
control_interface.flame_on(fireplace=fireplace)
control_interface.flame_off(fireplace=fireplace)
Flame Height
You can control the flame height with set_flame_height method. Height ranges from 0 to 4:
control_interface.set_flame_height(fireplace=fireplace, height=3)
Fan Speed
Fan speed is controled via the set_fan_speed method. Valid ranges for speed 0 to 4.
control_interface.set_fan_speed(fireplace=fireplace, speed=1)
Lights
You can control lights with set_lights method. Valid ranges for level are 0 to 3.
control_interface.set_lights(fireplace=fireplace, speed=1)
Beep
Apparently, if the fireplace is on (flame on) you can send a beep.
control_interface.beep(fireplace=fireplace)
Control Exceptions
LoginException- problem with the login process (username/password).InputRangeException- control value is out of valid range.ApiCallException- Some sort of api exception occured.
Where have all the firepalces gone!
The fireplace moduels are configured to respond to a specific UDP packet and return information. As such we can discover fireplaces on the network. Currently this will only return the ip address of the first fireplace to respond... (oh well).
# Creates a Fireplace Finder
finder = UDPFireplaceFinder()
# Prints IP of first fireplace to respond
print(finder.search_fireplace())
TODO: Listen for a set time and return a list of all fireplaces that respond.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file intellifire4py-0.7.5.tar.gz.
File metadata
- Download URL: intellifire4py-0.7.5.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d86d615aa7c2e2bed303975a7b3099b969971e13288c508dcc69004bd2f4aa4
|
|
| MD5 |
3f69acb6081995075e9ac289b61961c4
|
|
| BLAKE2b-256 |
dbf2285ab4e6c3bdae87a8d82c6c87521ca36997000f81e260363da3387b9d31
|
File details
Details for the file intellifire4py-0.7.5-py3-none-any.whl.
File metadata
- Download URL: intellifire4py-0.7.5-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.0 keyring/23.4.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f4722974ea47bd03c2e45a3d98ddfb8184f8befcb7b5c77e9774b83d2da7e7f
|
|
| MD5 |
5ae0d3a05f964dced9bdb161426c0b8f
|
|
| BLAKE2b-256 |
5e950f0adccd68a23d24689f1169a4c34630fc4e307448423db6a19acee7b526
|