-
Notifications
You must be signed in to change notification settings - Fork 498
Feature/matter britzyhub #2189
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
base: main
Are you sure you want to change the base?
Feature/matter britzyhub #2189
Conversation
@KyuminAhn And, there was no difference between the existing EdgeDriver and the EdgeDriver related to the dimming-light, elevator, gas-valve, etc. you made. If a Bridged Device can operate with the existing Matter Generic EdgeDriver, no separate EdgeDriver code is required. That is, if it can be operated as a Matter Generic EdgeDriver, the EdgeDriver suitable for the Bridged Device is automatically downloaded when the Bridge Device is onboarded without further development. If you have your own Bridged Device function that cannot be supported by Matter Generic EdgeDriver, you'd better implement the EdgeDriver for the separated directory at this time. However, even in this case, it would be better to implement the function under the directory such as matter-switch or matter-sensor, matter-thermostat, ... depending on the characteristics of the Bridged Device. This is because duplicate code can be minimized. @hcarter-775 , @nickolas-deboom |
components: | ||
- id: main | ||
capabilities: | ||
- id: valve |
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.
please use safetyValve
.
safetyValve capability has only close
command.
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.
@DongHoon-Ryu
we will change that, Thanks for your advice,
@@ -0,0 +1,530 @@ | |||
-- SinuxSoft (c) 2025 |
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 think it would be best to introduce a "is_air_conditioner" function in this subdriver (and similar for the other subdrivers) so that it is only loaded for AC devices. You can reference a similar function in the SmartThings Matter Appliance driver here for example. You could just check the device type and then return true if it matches AC.
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've applied the source code based on your advice. Thank you.
- add DeviceTypeId to gas, vent, elevator in lua code - change valve capabilitiy of gas-valve to safetyValve
|
||
local matter_driver = MatterDriver("britzyhub-matter", { | ||
sub_drivers = { | ||
require ("elevator"), |
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 assume that 'air-conditioner' and 'dimming-light' are not included here because there would be a conflict with the generic fingerprints for those device types already belonging in other drivers? (matter-thermostat and matter-switch, respectively)
}, | ||
capability_handlers = { | ||
[valve_cap.ID] = { | ||
--[valve_cap.commands.open.NAME] = function(driver, device, cmd) |
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 may be commented out accidentally
else | ||
device:emit_event_for_endpoint(ib.endpoint_id, capabilities.airConditionerFanMode.fanMode("auto")) | ||
end | ||
elseif device:supports_capability_by_id(capabilities.airPurifierFanMode.ID) then |
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.
The elseif and else clauses can be removed since airConditionerFanMode should be used here.
return false | ||
end | ||
|
||
local function match_profile(driver, device) |
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 think that all of the profiling logic should be removed from this sub-driver since the profile used by devices using this driver would be "air-conditioner.yml"
supported_capabilities = { | ||
capabilities.switch, | ||
capabilities.airPurifierFanMode, | ||
-- capabilities.fanSpeedPercent, |
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 think these may be inadvertently commented out
|
||
local function fan_mode_handler(_, device, ib, _) | ||
local cap = capabilities.airPurifierFanMode | ||
if device:supports_capability_by_id(cap.ID) then |
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 check shouldn't be needed since this capability is present in the ventilator profile
local args = cmd.args.airPurifierFanMode | ||
local mode_map = { | ||
low = clusters.FanControl.attributes.FanMode.LOW, | ||
sleep = clusters.FanControl.attributes.FanMode.LOW, |
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.
The enabled values in the profile are low, medium, high, auto, and off, so the other modes here aren't needed to be included
Check all that apply
Type of Change
Checklist
Description of Change
Initial Commit of matter-britzyhub edge driver
Summary of Completed Tests
Tested gas valve
Tested elevator
Tested dimming light