Skip to content

homeassistant client for switch and sensor, include mqtt and network, just for esp32

License

Notifications You must be signed in to change notification settings

zhcong/homeassistant-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homeassistant-mqtt

homeassistant client for switch and sensor, include mqtt and network, just for esp32 under arduino.

usage

#include "homeassistant.h"
#include "network.h"

void setpup(){
    ...
    networkInit(&displayNet, runner, REST_BUTTON_PIN);
    homeassistantInit(id, name, mqttHost, mqttPort, &onSwitchChange, runner, false, SWITCH_TYPE, "");
}

void loop(){
    homeassistantLoop();
    resetButtonCheck();
}

for complete examples, see example.

⚠attention

  • you need a button to reset the wifi, and also cut this function.
  • sensor type now support those:
#define SWITCH_TYPE 0
#define SENEOR_TYPE 1

🫵I WANT YOU

there are still many things that haven't been done yet, like

  • make those code with object-oriented.
  • support more sensor type in homeassistant

become the contributor of this project.

About

homeassistant client for switch and sensor, include mqtt and network, just for esp32

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages