absalom-muc / MHI-AC-Ctrl

Reads and writes data (e.g. power, mode, fan status etc.) from/to a Mitsubishi Heavy Industries (MHI) air conditioner (AC) via SPI controlled by MQTT
MIT License
277 stars 62 forks source link

Possible to add PIR function? #78

Closed sacy80 closed 2 years ago

sacy80 commented 2 years ago

Hi thank alot for the work. i try and it work. but i not good at coding. would like to know possible to add pir as a binary sensor to sent mqtt messages ?

very sorry, took your pcb design and change abit. https://1drv.ms/u/s!Ait4O1a98isBgYgazJgTbZKurobcyw?e=mjVgwO

absalom-muc commented 2 years ago

short answer: Yes, should be possible

Usually you find in the web examples for many different sensors connected to ESP8266 and used with MQTT

sacy80 commented 2 years ago

ar, just add everything in void loop ? very sorry to ask about this.

absalom-muc commented 2 years ago

yes, in the loop() you read your PIR status and you publish the status with e.g. MQTTclient.publish("topic", "data", true); Please check the PubSubClient documentation for details

sacy80 commented 2 years ago

ok. noted. i try to figure out.. thanks alot for info and help :)

sacy80 commented 2 years ago

image image

Thanks alot for the info :) look like working :)

absalom-muc commented 2 years ago

you could simplify the code: replace grafik by grafik Since you are doing the same in both branches you don't need the if-clause

sacy80 commented 2 years ago

oh.. i try. .. thanks for the help :)