-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add Homeassistant Discovery Feature #360
Conversation
cleaned mqtt.h updated references updated mqtt lib added correct ha discovery function updated hassio_discovery function updated hassio functions
Why was the pull request closed without merging into master? |
The PR is open for 2 Months. @einarhauks if you tested it please confirm it here so this can finally be merged or closed |
It's only @dafes and me that I know that uses home assistant. |
@einarhauks did you had time to test? |
@LoQue90 No, sorry. I’ll try to test it soon, give to the end of the week :) |
Tested and it looks good. Editing configuration from Home Assistant works as expected and temperature is reported I suggest improving the texts: |
* @brief Send MQTT Homeassistant Discovery Messages | ||
* @return 0 if successful, MQTT connection error code if failed to send messages | ||
*/ | ||
int sendHASSIODiscoveryMsg() { |
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.
I suggest improving the texts
DiscoveryObject brewSetpoint = GenerateNumberDevice("brewSetpoint", "Brew setpoint", BREW_SETPOINT_MIN, BREW_SETPOINT_MAX, 0.1, "°C"); DiscoveryObject steamSetPoint = GenerateNumberDevice("steamSetpoint", "Steam setpoint", STEAM_SETPOINT_MIN, STEAM_SETPOINT_MAX, 0.1, "°C"); DiscoveryObject brewTempOffset = GenerateNumberDevice("brewTempOffset", "Brew Temp. Offset", BREW_TEMP_OFFSET_MIN, BREW_TEMP_OFFSET_MAX, 0.1, "°C"); DiscoveryObject brewPidDelay = GenerateNumberDevice("brewPidDelay", "Brew Pid Delay", BREW_PID_DELAY_MIN, BREW_PID_DELAY_MAX, 0.1, ""); DiscoveryObject startKp = GenerateNumberDevice("startKp", "Start kP", PID_KP_START_MIN, PID_KP_START_MAX, 0.1, ""); DiscoveryObject startTn = GenerateNumberDevice("startTn", "Start Tn", PID_TN_START_MIN, PID_TN_START_MAX, 0.1, ""); DiscoveryObject steamKp = GenerateNumberDevice("steamKp", "Start Kp", PID_KP_STEAM_MIN, PID_KP_STEAM_MAX, 0.1, ""); DiscoveryObject aggKp = GenerateNumberDevice("aggKp", "aggKp", PID_KP_REGULAR_MIN, PID_KP_REGULAR_MAX, 0.1, ""); DiscoveryObject aggTn = GenerateNumberDevice("aggTn", "aggTn", PID_TN_REGULAR_MIN, PID_TN_REGULAR_MAX, 0.1, ""); DiscoveryObject aggTv = GenerateNumberDevice("aggTv", "aggTv", PID_TV_REGULAR_MIN, PID_TV_REGULAR_MAX, 0.1, ""); DiscoveryObject aggIMax = GenerateNumberDevice("aggIMax", "aggIMax", PID_I_MAX_REGULAR_MIN, PID_I_MAX_REGULAR_MAX, 0.1, ""); DiscoveryObject brewtime = GenerateNumberDevice("brewtime", "Brew time", BREW_TIME_MIN, BREW_TIME_MAX, 0.1, "s"); // Sensor Devices DiscoveryObject actual_temperature = GenerateSensorDevice("temperature", "Boiler Temperature"); DiscoveryObject heaterPower = GenerateSensorDevice("heaterPower", "Heater Power", "ms", "power_factor"); // Switch Devices DiscoveryObject pidOn = GenerateSwitchDevice("pidON", "Use PID"); DiscoveryObject steamON = GenerateSwitchDevice("steamON", "Steam"); DiscoveryObject backflushON = GenerateSwitchDevice("backflushON", "Backflush"); DiscoveryObject startUsePonM = GenerateSwitchDevice("startUsePonM", "Use PonM");
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.
Also tested building and uploading to my machine, works as expected
@LoQue90 I've tested this and verified, now someone with merge review/rights need to take the next step |
I can merge it, but i do not have tested it. |
worked on my machine :D |
adding the new names from @einarhauks would be nice |
let us merge the PR first. You or anybody can create a PR with these suggestions. |
updated |
then go for merge and let us improve it later! |
const unsigned long HomeAssistantDiscoveryExecutionInterval = 300000;
in main.cpp