Air Conditioner Controller Using Fuzzy Logic In Python


Artificial Intelligence - Fuzzy Logic Systems - Tutorialspoint

Air Conditioner Controller Using Fuzzy Logic In Python

Hello friends, Today our new tutorial is on Fuzzy Logic which will be used by Air Conditioner Controller in Python Programming Language.For this we are going to use a library hvac-ir to control the air conditioner devices.

Let’s start our tutorial :-


hvac-ir Introduction

 Quasi-adaptive fuzzy logic controller developed by Gouda et al ...

This is a python port of the great Arduino heatpumpir library which is used to control the air conditioner devices.

Supported devices of hvac-ir :-

·         Daikin
·         Carrier
·         Fuego
·         Fujitsu
·         Hisense
·         Hitachi
·         Hyundai

Install In System

 Temperature Control using Fuzzy Logic

$ pip install hvac_ir

Example Demo :-

import hvac_ir

Sender = hvac_ir.get_sender('Fuego')
if Sender is None:
print("No Sender")
exit(2)
AC = Sender()
AC.send(Sender.POWER_OFF, Sender.MODE_HEAT, Sender.FAN_AUTO, 24, Sender.VDIR_SWING_DOWN,
Sender.HDIR_SWING, False)
duration = AC.get_durations()

my_ir_sender.transmit(duration)

Full Code

 Implement fuzzy logic to bring AI characters alive in Unity ...

Full programming code in python is given and show the sending codes in the codes which is given below :-

import hvac_ir
import binascii

x = 32.6
token = 0x26


def fun_1(durations):
display = bytearray()
display .append(token)
display .append(0) 
display .append(len(durations) % 256)
display .append(int(len(durations) / 256))

for d in durations:
n = int(round(d / x))

if n > 255:
display .append(0)
display .append(int(n / 256))
display .append(num % 256)

display .append(0x0d)
display .append(0x05)
display .append(0x00)
display .append(0x00)
display .append(0x00)
display .append(0x00)

return display


def format_durations(data):
result = ''
for i in range(0, len(data)):
if len(result) > 0:
result += ''
result += ('+' if i % 2 == 0 else '-') + str(data[i])
return result


if __name__ == '__main__':
Sender = hvac_ir.get_sender('Fuego')
if Sender is None:
print("No Sender")
exit(2)
AC = Sender()
AC.send(Sender.POWER_OFF, Sender.MODE_HEAT, Sender.FAN_AUTO, 24, Sender.VDIR_SWING_DOWN,
Sender.HDIR_SWING, False)
duration = AC.get_durations()

my_ir_sender.transmit(duration)
print(format_durations(duration))


If you liked this post, then please distribute it among your friend circle or on the social media platforms you use.

Thank you Guys and Good Bye...

Keep learning,

Tech Prog

                    Related Links 

>>> Recursion in Python                             >>> CGI in Python


>>> Multi-threading In Python                   
>>> Convert Speech To Text 


>>> Installation of Python                        >>> Introduction of Python

>>> Linear Search & Binary Search   >>> Currency Detection By Image

      
 >>> Socket Programming in Python

>>> schemas used in pandas dataframes 
Reactions

Post a Comment

0 Comments