t0bst4r / matterbridge-home-assistant

Apache License 2.0
110 stars 14 forks source link

Feature Request: climate support #47

Open marc3k18 opened 5 months ago

marc3k18 commented 5 months ago

Hello,

I trying to install zigbee2mqtt addon but im still having some error. Its only for testing purpose!

Thanka Screenshot_20240609-182558

t0bst4r commented 5 months ago

Hi, can you provide some more details? Are you able to get the docker logs from the plugin page (tab next to configuration) ?

t0bst4r commented 5 months ago

To be honest, I am wondering what you are doing there. This addon is publishing the entities you already have in Home Assistant as a matter bridge to other matter clients (like Alexa). why do you need zigbee2mqtt in there? wouldn’t it be more useful to have zigbee2mqtt in home assistant, have the entities in there and publish them via HA to this plugin?

marc3k18 commented 5 months ago

Hi,

I want to use the climate device also.

[15:38:05.112] [Matterbridge] Installing plugin matterbridge-zigbee2mqtt... [15:38:05.118] [Matterbridge] Failed to start child process: spawn sudo ENOENT [15:38:05.118] [Matterbridge] Error installing plugin matterbridge-zigbee2mqtt [15:38:05.120] [Matterbridge] Child process stdio streams have closed with code -2 [15:38:10.151] [Matterbridge] WebSocket client disconnected [15:38:10.318] [Matterbridge] WebSocketServer client connected [15:38:10.337] [Matterbridge] WebSocket received message => Connected to WebSocket: ws://10.18.0.250:8284 [15:38:14.374] [Matterbridge] WebSocket client disconnected

Le lun. 10 juin 2024, 1 h 20 a.m., Tobias Glatthar @.***> a écrit :

To be honest, I am wondering what you are doing there. This addon is publishing the entities you already have in Home Assistant as a matter bridge to other matter clients (like Alexa). why do you need zigbee2mqtt in there? wouldn’t it be more useful to have zigbee2mqtt in home assistant, have the entities in there and publish them via HA to this plugin?

— Reply to this email directly, view it on GitHub https://github.com/t0bst4r/matterbridge-home-assistant/issues/47, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKJDQFP5ETU7QTFAC4QDLTZGUZSBAVCNFSM6AAAAABJBHVIIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJXGI4TANRUGA . You are receiving this because you authored the thread.Message ID: @.*** com>

t0bst4r commented 5 months ago

Okay umm, i see. You are using the home assistant addon and you are trying to add the zigbee matterbridge plugin using the webui of matterbridge. Am i right?

The docker image I am building for this addon does not include any other plugin than mine. Even when the UI of matterbridge allows adding plugins which are already installed, it does not allow installing plugins which are missing.

i am not sure if I should add those matterbridge plugins to the addon. I should rather add support for the entity types of home assistant which are missing.

Since I don’t have any climate devices, I’d need help for that. What attributes does a entity has? What service calls are needed in home assistant?

as long as not all entity types are supported, I would be fine adding the zigbee plugin (without any support from my side) . But i don’t think it’s a good solution.

marc3k18 commented 5 months ago

Yes you are right. I'm trying to put some zigbee baseboard heater on Matter!

There is the attribute:

hvac_modes:

The only service need is the set target temperature. To put them at off, their need to be set at 5 degres.

There is the model: https://www.zigbee2mqtt.io/devices/HT402.html

Le lun. 10 juin 2024, 4 h 11 p.m., Tobias Glatthar @.***> a écrit :

Okay umm, i see. You are using the home assistant addon and you are trying to add the zigbee matterbridge plugin using the webui of matterbridge. Am i right?

The docker image I am building for this addon does not include any other plugin than mine. Even when the UI of matterbridge allows adding plugins which are already installed, it does not allow installing plugins which are missing.

i am not sure if I should add those matterbridge plugins to the addon. I should rather add support for the entity types of home assistant which are missing.

Since I don’t have any climate devices, I’d need help for that. What attributes does a entity has? What service calls are needed in home assistant?

as long as not all entity types are supported, unwould be fine adding the zigbee plugin (without any support from my side) . But i don’t think it’s a good solution.

— Reply to this email directly, view it on GitHub https://github.com/t0bst4r/matterbridge-home-assistant/issues/47, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKJDQHQRWZWBCP6PVGTOMLZGYB6XAVCNFSM6AAAAABJBHVIIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJZGE4TQOJZHA . You are receiving this because you authored the thread.Message ID: @.*** com>

t0bst4r commented 5 months ago
  1. Those are the attributes from home assistant right? So it is connected to HA? Just to make sure.
  2. Can you post the detailed service call in yaml format of how you set the temperature in home assistant (e.g. in automations) ?
  3. Could you provide a list of all service calls available for this kind of entity?
  4. Could you provide the entity_id of one of those devices?
marc3k18 commented 5 months ago
  1. Yes. Those are connect directly to zigbee2mqtt.

  2. service: climate.set_temperature data_template: temperature: 20 entity_id: climate.z2m_t_chambre_garcons

  3. It's the only service call available for this model. It's also returning the energy mesurement but I dont need it.

  4. climate.z2m_t_chambre_garcons

Le lun. 10 juin 2024, 5 h 43 p.m., Tobias Glatthar @.***> a écrit :

  1. Those are the attributes from home assistant right? So it is connected to HA? Just to make sure.
  2. Can you post the detailed service call in yaml format of how you set the temperature in home assistant (e.g. in automations) ?
  3. Could you provide a list of all service calls available for this kind of entity?
  4. Could you provide the entity_id of one of those devices?

— Reply to this email directly, view it on GitHub https://github.com/t0bst4r/matterbridge-home-assistant/issues/47, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKJDQFSS7MZGJAHOLRSF43ZGYMWPAVCNFSM6AAAAABJBHVIIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJZGMZTQMJZGA . You are receiving this because you authored the thread.Message ID: @.*** com>

t0bst4r commented 5 months ago

Thank you. I’ll give it a try in the next couple of days and then come back to you to test it 🙂

t0bst4r commented 5 months ago

I didn’t had the chance to look into this yet, since there are some other bugs to fix before. But I am still having this in mind. 😁

marc3k18 commented 5 months ago

No worry! Thanks!

t0bst4r commented 5 months ago

@marc3k18

I have implemented basic climate support (only level control = temperature), but have no way to test it since i have no climate device. It is currently available in the next beta-release.

You can fetch it (via Docker) using ghcr.io/t0bst4r/matterbridge-home-assistant/beta:1.1.0-beta88. Could you please give it a try and provide feedback? Including screenshots of Alexa or google or apple home, and what is missing etc.

marc3k18 commented 5 months ago

Thanks for your work!

But Im not equipe to run docker. Im running HA on with HAOS.

Can you add this to the addon in beta?

Le lun. 17 juin 2024, 2 h 56 p.m., Tobias Glatthar @.***> a écrit :

@marc3k18 https://github.com/marc3k18

I have implemented basic climate support, but have no way to test it since i have no climate device. It is currently available in the next beta-release.

You can fetch it (via Docker) using ghcr.io/t0bst4r/matterbridge-home-assistant/beta:1.1.0-beta88. Could you please give it a try and provide feedback?

— Reply to this email directly, view it on GitHub https://github.com/t0bst4r/matterbridge-home-assistant/issues/47#issuecomment-2174208565, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKJDQCT743BQH63HO2DY63ZH4WMBAVCNFSM6AAAAABJDD7NOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZUGIYDQNJWGU . You are receiving this because you were mentioned.Message ID: @.***>

t0bst4r commented 5 months ago

Okay, I am currently refactoring the release flow - again 😂

I’ll change it to not release beta versions at all, but immediately release everything as soon as possible to get direct feedback. It‘ll be available with the addon latest end of this week.

marc3k18 commented 5 months ago

Hey!

I just try the last update for the climate. It automaticly crash when I add a climate entity.

Node.js v18.20.3
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Matterbridge
 Populate your Home Assistant instance as Matter Bridge
-----------------------------------------------------------
 Add-on version: 1.2.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.4  (amd64 / generic-x86-64)
 Home Assistant Core: 2024.6.3
 Home Assistant Supervisor: 2024.06.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
#############################
CURRENT CLIENT CONFIGURATION:
{
  "includeDomains": [],
  "includePatterns": [
    "light.gv_led_lumiere_ambiance_exterieur",
    "light.sl_lamp_c*",
    "switch.z2m_p_prise_exterieur",
    "switch.z2m_wv*",
    "climate.z2m*"
  ],
  "excludeDomains": [],
  "excludePatterns": []
}
#############################

> matterbridge
> matterbridge -add ./node_modules/matterbridge-home-assistant

[21:01:19.640] [Matterbridge] Created Matterbridge Plugin Directory: /root/Matterbridge 
[21:01:19.646] [Matterbridge] Matterbridge version 1.3.0 mode  running on Linux 6.6.33-haos linux x64 
[21:01:19.652] [Matterbridge] Plugin /app/node_modules/matterbridge-home-assistant/package.json already added to matterbridge 

> matterbridge
> matterbridge -bridge

[21:01:20.995] [Matterbridge] Matterbridge version 1.3.0 mode bridge running on Linux 6.6.33-haos linux x64 
[21:01:21.239] [Matterbridge] Loading plugin matterbridge-home-assistant type DynamicPlatform 
[21:01:21.241] [Matterbridge] WebSocketServer is listening on ws://10.18.0.250:8284 
[21:01:21.241] [Matterbridge] The frontend is listening on http://10.18.0.250:8283 
[21:01:21.323] [Matterbridge] Loaded plugin matterbridge-home-assistant type DynamicPlatform (entrypoint /app/node_modules/matterbridge-home-assistant/lib/index.js) 
[21:01:21.324] [Matterbridge] Starting plugin matterbridge-home-assistant type DynamicPlatform 
[21:01:21.324] [HomeAssistantPlatform] onStart called with reason: Matterbridge is starting 
[21:01:21.368] [Matterbridge] Started plugin matterbridge-home-assistant type DynamicPlatform 
[21:01:21.600] [Matterbridge] Added and registered bridged device (1/1) SL - LAMP - Chambre Principale (Local) (MA-onofflight) for plugin matterbridge-home-assistant 
[21:01:21.608] [Matterbridge] Added and registered bridged device (2/2) SL - LAMP - Cuisine (Local) (MA-onofflight) for plugin matterbridge-home-assistant 
[21:01:21.614] [Matterbridge] Added and registered bridged device (3/3) Z2M - T - Chambre Principale (MA-heatcool) for plugin matterbridge-home-assistant 
file:///app/node_modules/@project-chip/matter.js/dist/esm/cluster/server/ClusterServer.js:261
          throw new ImplementationError(
                ^

ImplementationError: Attribute minLevel is optional and not initialized. To use it please initialize it first.
    at ClusterServer.result.<computed> [as setMinLevelAttribute] (file:///app/node_modules/@project-chip/matter.js/dist/esm/cluster/server/ClusterServer.js:261:17)
    at LevelControlAspect.update (file:///app/node_modules/matterbridge-home-assistant/lib/devices/aspects/level-control-aspect.js:34:39)
    at ClimateDevice.updateState (file:///app/node_modules/matterbridge-home-assistant/lib/devices/home-assistant-device.js:21:26)
    at async HomeAssistantMatterAdapter.create (file:///app/node_modules/matterbridge-home-assistant/lib/home-assistant/home-assistant-matter-adapter.js:88:9)
    at async HomeAssistantMatterAdapter.expensiveUpdate (file:///app/node_modules/matterbridge-home-assistant/lib/home-assistant/home-assistant-matter-adapter.js:42:13)
    at async HomeAssistantClient.expensiveUpdate (file:///app/node_modules/matterbridge-home-assistant/lib/home-assistant/home-assistant-client.js:50:13)

Node.js v18.20.3
s6
t0bst4r commented 4 months ago

Thank you for the feedback. I’ll have a look into detail tomorrow. I just found a way to create a virtual devices using generic-thermostat and hass-virtual.

If that works, I can test it locally and release more stable versions 🙂

t0bst4r commented 4 months ago

Virtual devices works! Since the current implementation is just wrong, I need to re-implement the climate device. I’ve disabled that device type for now in version 1.2.1

It’s not that easy. I need to understand how climates or thermostats work in matter.

t0bst4r commented 4 months ago

Due to limited time on my side and a slightly higher complexity in this kind of matter devices, i didn't have the possibility to finally implement that. Sorry for postponing it even more.

tammeryousef1006 commented 3 months ago

hi there , im really awaiting climate since day one , can you add support for it in near soon or it will take longer time?

thanks in advance

kaovilai commented 3 months ago

Would be happy to help in any way.

I have a home kit enabled thermostat and HA + Google Home as Matter Controllers.

t0bst4r commented 3 months ago

Thanks for reminding me 😄 I just had a quick look and it seemed that my initial implementation from months ago was just wrong 😆

In general it will be possible, but I need to understand how climates work in home assistant. Taking your previously posted attributes:


hvac_modes:
  - heat
min_temp: 5
max_temp: 30
target_temp_step: 0.5
current_temperature: 21
temperature: 5
hvac_action: idle
friendly_name: Z2M - T - Chambre Garçons
supported_features: 385

On the other hand I need to understand the matter api. For that I’d need to read a bit of the documentation as well.

I’ll try to get that done till the end of this week, but please forgive me if it takes longer, since I am doing that in my spare time besides family and full time work.

tammeryousef1006 commented 3 months ago

thanks for following up

kaovilai commented 3 months ago

My thermostat on HA via HomeKit and in real life have three modes: cool, heat, off. The same thermostat was earlier connected via Smartthings integration with Honeywell Home which also added fan control.

References:

type string Required climate-hvac-modes

style string (Optional, default: icons) How the modes should be displayed. It can be either dropdown or icons.

hvac_modes list Required List of modes to show on the card. The list can contain auto, heat_cool, heat, cool, dry, fan_only, and off.

https://www.home-assistant.io/dashboards/features#climate-fan-modes

type string Required climate-preset-modes

style string (Optional, default: dropdown) How the preset modes should be displayed. It can be either dropdown or icons.

preset_modes list Required List of preset modes to show on the card. The list can contain eco, away, boost, comfort, home, sleep, and activity or any other custom preset mode.

https://www.home-assistant.io/dashboards/features#climate-preset-modes

Other climate details: https://www.home-assistant.io/integrations/climate

tammeryousef1006 commented 3 months ago

here is mine

4th ac 3rd ac 2nd ac 1st ac

t0bst4r commented 3 months ago

okay, i've got a working version with my virtual heat-only device 😀 I couldnt test cooling or combined devices. Additionally i did not implement "dry" or "fan_only", yet. Just wanted to release early with limited features to get fast feedback.

marc3k18 commented 3 months ago

All my device are heat only if it could help.

Le ven. 16 août 2024, 11 h 56 a.m., Tobias Glatthar < @.***> a écrit :

okay, i've got a working version with my virtual heat-only device 😀 I couldnt test cooling or combined devices. Additionally i did not implement "dry" or "fan_only", yet. Just wanted to release early with limited features to get fast feedback.

— Reply to this email directly, view it on GitHub https://github.com/t0bst4r/matterbridge-home-assistant/issues/47#issuecomment-2293758840, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXKJDQDWBWM4PAVAGOORWULZRYOJXAVCNFSM6AAAAABJDD7NOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJTG42TQOBUGA . You are receiving this because you were mentioned.Message ID: @.***>

t0bst4r commented 3 months ago

yeah, it was just released as 2.7.0. please give it a try.

tammeryousef1006 commented 3 months ago

i did try and exposed 4 ac's , all appears at smartthings but not controlling cool nor heat

t0bst4r commented 3 months ago

Can you provide some details? Do you see controls, but they just don’t do anything? Do you see no controls at all?

tammeryousef1006 commented 3 months ago

i see controls yes and they dont do anything , I will upload photo

tammeryousef1006 commented 3 months ago

Screenshot_20240816_224207_SmartThings Screenshot_20240816_224158_SmartThings

t0bst4r commented 3 months ago

Is it also not possible to set the mode to „cool“ or „heat“? At the moment, auto is not implemented.

Could you please enable debug logging and see if there are any logs?

tammeryousef1006 commented 3 months ago

i can choose coot heat auto , but the icon keeps loading forever and no command goes to ac

t0bst4r commented 3 months ago
  1. Yes, that’s probably the point. We cannot control the temperature without setting the mode to something other than off. I have added debug logs which show „change system mode from x to y“ when changing it. I’d like to see that in your logs. But therefore you need to enable debug log first.

  2. A different test: Can you try setting the mode in home assistant to (e.g.) heat? Does it change in smartthings as well then? Is it then possible to change the temperature?

kaovilai commented 3 months ago
2024-08-16 17:52:01.692 ERROR  InteractionServer    Error while handling write request from udp://fe80::a400:fb07:2700:1988%end0:5540 on session secure/5609 to MA-thermostat(0xb0)/Thermostat(0x201)/systemMode(0x1c): (136) Fixed attributes cannot be written
t0bst4r commented 3 months ago

Thank you! That is helpful. I’ll have a look at it later today

t0bst4r commented 3 months ago

That's interesting. Attributes in matter.js can be FixedAttribute or WritableAttribute. If we try to change fixed attributes, we get the error message you have. On the other hand we can change writable attributes.

Bildschirmfoto 2024-08-18 um 10 35 30

The only thing that makes me sceptical is writeAcl: AccessLevel.Manage. But there is no documentation available for that in matter.js.


Additionally I just had a look at the list of supported devices and ecosystems. Noone ever tested thermostats on smartthings and tuya.

pkoutsovasilis commented 2 months ago
2024-08-16 17:52:01.692 ERROR  InteractionServer    Error while handling write request from udp://fe80::a400:fb07:2700:1988%end0:5540 on session secure/5609 to MA-thermostat(0xb0)/Thermostat(0x201)/systemMode(0x1c): (136) Fixed attributes cannot be written

just providing some extra info; the same happens for me using google home, I can see my AC but I as soon as I try to change anything on Google home, such as mode, fan speed, temparature, nothing happens. I checked the matterbridge logs and I get a similar to the quoted message

mclever commented 1 month ago

And when trying to change the temp from google app the display changes from fahrenheit to Celsius