-
-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Homeassistant MQTT Discovery #260
base: main
Are you sure you want to change the base?
Conversation
javimurcia
commented
Mar 7, 2023
- Improved Homeassistant MQTT discovery: all ESPAltherma's entities should apear under the same device.
- Make the thermostat relay (switch) optional, allowing users to disable it (by not defining its pin) so it doesn't show up on home assistant.
- Added the option to change the active level for the thermostat relay
…ppear under the same device. Make the thermostat relay (switch) optional, allowing users to disable it (by not defining its pin) so it doesn't show up on home assistant. Added the option to change the active level for the thermostat relay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small comments for your consideration. But great improvement overall, thanks.
I will test it to see if it breaks stuff on mine, and merge afterwards.
|
||
#ifdef PIN_THERM | ||
// Thermostat relay - Set first to the inactive state, before configuring as outputs (avoid false triggering when initializing) | ||
digitalWrite(PIN_THERM, THERM_RELAY_INACTIVE_STATE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should come after pinMode
// Subscribe | ||
// Thermostat relay | ||
#ifdef PIN_THERM | ||
client.publish("homeassistant/switch/espAltherma/switch/config", "{\"availability\":[{\"topic\":\"espaltherma/LWT\",\"payload_available\":\"Online\",\"payload_not_available\":\"Offline\"}],\"availability_mode\":\"all\",\"unique_id\":\"espaltherma_switch\",\"device\":{\"identifiers\":[\"ESPAltherma\"],\"manufacturer\":\"ESPAltherma\",\"model\":\"M5StickC PLUS ESP32-PICO\",\"name\":\"ESPAltherma\"},\"icon\":\"mdi:water-boiler\",\"name\":\"EspAltherma Heat Pump Demand\",\"command_topic\":\"espaltherma/POWER\",\"state_topic\":\"espaltherma/STATE\",\"payload_on\":\"ON\",\"payload_off\":\"OFF\"}", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Model depends on the esp32 used. I would remove it, or put a more generic "ESP"
I try to build your version, but I got an error: |