Reference#

IntelliFire4PY#

IntelliFire API for Python.

IntelliFireAPILocal#

class intellifire4py.IntelliFireAPILocal(fireplace_ip, user_id='', api_key='')#

Top level API for IntelliFire Data - local network only.

Class Initialization.

Parameters:
  • fireplace_ip (str) – _description_

  • user_id (str, optional) – The user_id as retrieved from IntelliFireAPICloud. If left blank - will not be able to control the unit. Defaults to “”.

  • api_key (str, optional) – Each fireplace has a unique api_key. If left blank - will not be able to control the unit. Defaults to “”.

async beep()#

Issue a beep command (Cloud Only).

Return type:

None

property data: IntelliFirePollData#

Return data to the user.

async fan_off()#

Turn fan off.

Return type:

None

async flame_off()#

Turn off the flame.

Return type:

None

async flame_on()#

Turn on the flame.

Return type:

None

property is_polling_in_background: bool#

Return whether api is polling.

log_status()#

Log a status message.

Return type:

None

overwrite_data(new_data)#

Overwrite existing poll data.

Parameters:

new_data (IntelliFirePollData) –

Return type:

None

async pilot_off()#

Turn off the pilot light.

Return type:

None

async pilot_on()#

Turn on the pilot light.

Return type:

None

async poll(suppress_warnings=False)#

Read the /poll endpoint.

Parameters:

suppress_warnings (bool, optional) – If True will inhibit the printing of log messages Useful for a specific case in Home Assistant. Defaults to False.

Raises:

ConnectionError – _description_

Return type:

None

async send_command(*, command, value)#

Send a command (local only for now).

Parameters:
  • command (IntelliFireCommand) –

  • value (int) –

Return type:

None

async set_fan_speed(speed)#

Set fan speed.

Parameters:

speed (int) –

Return type:

None

async set_flame_height(height)#

Set flame height.

Parameters:

height (int) – Valid height 0-4 (in the future this will be 1-5)

Return type:

None

async set_lights(level)#

Modify light levels.

Parameters:

level (int) –

Return type:

None

async set_sleep_timer(minutes)#

Set the sleep timer in minutes.

Parameters:

minutes (int) – Valid range 0-180

Return type:

None

async set_thermostat_c(temp_c)#

Set thermostat value in centigrade.

Parameters:

temp_c (int) –

Return type:

None

async set_thermostat_f(temp_f)#

Set thermostat value in fahrenheit.

Example

# Set to 70 and store the value internally
await ift_control.set_thermostat_f(temp_f=70)
# Turn off thermostat
await ift_control.turn_off_thermostat()
# Turn on thermostat - will remember the last temp (70)
await ift_control.turn_on_thermostat()
Parameters:

temp_f (int) –

Return type:

None

async soft_reset()#

Issue a soft reset command (Cloud Only).

Return type:

None

async start_background_polling(minimum_wait_in_seconds=15)#

Start an ensure-future background polling loop.

Parameters:

minimum_wait_in_seconds (int) –

Return type:

None

async stop_background_polling()#

Stop background polling - return whether it had been polling.

Return type:

bool

async stop_sleep_timer()#

Stop the sleep timer.

Return type:

None

async turn_off_thermostat()#

Turn off thermostat mode.

Return type:

None

async turn_on_thermostat()#

Turn on thermostat mode.

Return type:

None

IntelliFireAPICloud#

class intellifire4py.IntelliFireAPICloud(*, use_http=False, verify_ssl=True)#

Api for cloud access.

Initialize the class.

In most cases you should not specify either the use_http or verify_ssl parameters - however in some special cases such as protected networks you may need these options.

Parameters:
  • use_http (bool, optional) – whether to use HTTP or HTTPS mode. Defaults to False.

  • verify_ssl (bool, optional) – Enable/Disable SSL Verification. Defaults to True.

async beep()#

Issue a beep command (Cloud Only).

Return type:

None

property data: IntelliFirePollData#

Return data to the user.

async fan_off()#

Turn fan off.

Return type:

None

async flame_off()#

Turn off the flame.

Return type:

None

async flame_on()#

Turn on the flame.

Return type:

None

get_fireplace_api_key(fireplace=None)#

Get API key for specific fireplace.

Parameters:

fireplace (IntelliFireFireplace | None) –

Return type:

str

async get_fireplaces(client, *, location_id)#

Get fireplaces at a location with associated API keys!.

Parameters:
  • client (AsyncClient) –

  • location_id (str) –

Return type:

list[intellifire4py.model.IntelliFireFireplace]

async get_locations(client)#

Enumerate configured locations that a user has access to.

‘location_id’ can be used to discovery fireplaces and associated serial numbers + api keys at a give location.

Parameters:

client (AsyncClient) –

Return type:

list[dict[str, str]]

get_user_id()#

Get user ID from cloud.

Return type:

str

property is_polling_in_background: bool#

Return whether api is polling.

async login(*, username, password)#

Login to Cloud API.

Parameters:
  • username (str) – IFTAPI.net Username (usually email)

  • password (str) – IFTAPI.net Password

Raises:

LoginError – _description_

Returns:

None

Return type:

None

async long_poll(fireplace=None)#

Perform a LongPoll to wait for a Status update.

Only returns a status update when the fireplace’s status actually changes (excluding normal periodic decreases in the “time remaining” field). If the fireplace status does not change during the time period, the server returns status code 408 after the time limit is exceeded. The app can then immediately issue another request on this function. If the status changes, then the server returns a 200 status code, the status content (in the same format as for apppoll), and an Etag header. The Etag should be sent in an If-None- Match header for the next request, so the server knows where in the queue to look for the next command to return. The correct order to do this is first issue an apppoll request (or equivalently, an enumuserfireplaces request), and then issue applongpoll requests for as long as the status is needed. Although this may seem to create a race condition, the server puts fireplace status updates in a queue where they last for 30 seconds. Therefore, as long as the Internet connection isn’t unusably slow, no status updates will be lost. If the connection goes down, then the process needs to be restarted. The time limit is nominally 60 seconds. After 57 seconds, the server will send a 408 response, and after 61 seconds, the mobile app should assume that the connection has been dropped.

Parameters:

fireplace (IntelliFireFireplace | None, optional) – _description_. Defaults to None.

Raises:

ApiCallError – Issue with the API call, either bad credentials or a bad serial number

Returns:

True if status changed, False if it did not

Return type:

bool

overwrite_data(new_data)#

Overwrite existing poll data.

Parameters:

new_data (IntelliFirePollData) –

Return type:

None

async pilot_off()#

Turn off the pilot light.

Return type:

None

async pilot_on()#

Turn on the pilot light.

Return type:

None

async poll(fireplace=None)#

Return a fireplace’s status in JSON.

Parameters:

fireplace (IntelliFireFireplace | None, optional) – _description_. Defaults to None.

Raises:
  • ApiCallError – _description_

  • ApiCallError – _description_

  • Exception – _description_

Returns:

_description_

Return type:

_type_

Example:

{
"name":"undefined",
"temperature":"22",
"battery":"0",
"pilot":"0",
"light":"3",
"height":"4",
"fanspeed":"0",
"hot":"0",
"power":"0",
"schedule_enable":"0",
"thermostat":"0",
"setpoint":"0",
"timer":"0",
"timeremaining":"0",
"prepurge":"0",
"feature_light":"1",
"feature_thermostat":"1",
"power_vent":"0",
"feature_fan":"1",
"errors":[3269],
"firmware_version":"0x01000000"
"brand":"H&G"
}
async send_command(*, command, value)#

Send a command (cloud based).

Parameters:
  • command (IntelliFireCommand) –

  • value (int) –

Return type:

None

async set_fan_speed(speed)#

Set fan speed.

Parameters:

speed (int) –

Return type:

None

async set_flame_height(height)#

Set flame height.

Parameters:

height (int) – Valid height 0-4 (in the future this will be 1-5)

Return type:

None

async set_lights(level)#

Modify light levels.

Parameters:

level (int) –

Return type:

None

async set_sleep_timer(minutes)#

Set the sleep timer in minutes.

Parameters:

minutes (int) – Valid range 0-180

Return type:

None

async set_thermostat_c(temp_c)#

Set thermostat value in centigrade.

Parameters:

temp_c (int) –

Return type:

None

async set_thermostat_f(temp_f)#

Set thermostat value in fahrenheit.

Example

# Set to 70 and store the value internally
await ift_control.set_thermostat_f(temp_f=70)
# Turn off thermostat
await ift_control.turn_off_thermostat()
# Turn on thermostat - will remember the last temp (70)
await ift_control.turn_on_thermostat()
Parameters:

temp_f (int) –

Return type:

None

async soft_reset()#

Issue a soft reset command (Cloud Only).

Return type:

None

async start_background_polling(minimum_wait_in_seconds=10)#

Start an ensure-future background polling loop.

Parameters:

minimum_wait_in_seconds (int) –

Return type:

None

async stop_background_polling()#

Stop background polling - return whether it had been polling.

Return type:

bool

async stop_sleep_timer()#

Stop the sleep timer.

Return type:

None

async turn_off_thermostat()#

Turn off thermostat mode.

Return type:

None

async turn_on_thermostat()#

Turn on thermostat mode.

Return type:

None

IntelliFireErrorCode#

class intellifire4py.IntelliFireErrorCode(value=<no_arg>, names=None, module=None, qualname=None, type=None, start=1, boundary=None)#

The following is a description of various error codes. These were obtained by decompiling the Android APK.

PILOT_FLAME#

Pilot Flame Error: Your appliance has been safely disabled. Please contact your dealer and report this issue.

FAN_DELAY#

Fan Information: Fan will turn on within 3 minutes. Your appliance has a built-in delay that prevents the fan from operating within the first 3 minutes of turning on the appliance. This allows the air to be heated prior to circulation.

FLAME#

Pilot Flame Error. Your appliance has been safely disabled. Please contact your dealer and report this issue.

MAINTENANCE#

Maintenance: Your appliance is due for a routine maintenance check. Please contact your dealer to ensure your appliance is operating at peak performance.

DISABLED#

Appliance Safely Disabled: Your appliance has been disabled. Please contact your dealer and report this issue.

FAN#

Fan Error. Your appliance has detected that an accessory is not functional. Please contact your dealer and report this issue.

LIGHTS#

Lights Error. Your appliance has detected that an accessory is not functional. Please contact your dealer and report this issue.

ACCESSORY#

Your appliance has detected that an AUX port or accessory is not functional. Please contact your dealer and report this issue.

SOFT_LOCK_OUT#

Sorry your appliance did not start. Try again by pressing Flame ON.

OFFLINE#

Your appliance is currently offline.

ECM_OFFLINE#

ECM is offline.