Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Feature Request: climate support #47

Open
marc3k18 opened this issue Jun 9, 2024 · 38 comments · Fixed by #266
Open

Feature Request: climate support #47

marc3k18 opened this issue Jun 9, 2024 · 38 comments · Fixed by #266
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@marc3k18
Copy link

marc3k18 commented Jun 9, 2024

Hello,

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

Thanka
Screenshot_20240609-182558

@t0bst4r
Copy link
Owner

t0bst4r commented Jun 10, 2024

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

@t0bst4r
Copy link
Owner

t0bst4r commented Jun 10, 2024

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
Copy link
Author

marc3k18 commented Jun 10, 2024 via email

@t0bst4r
Copy link
Owner

t0bst4r commented Jun 10, 2024

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
Copy link
Author

marc3k18 commented Jun 10, 2024 via email

@t0bst4r
Copy link
Owner

t0bst4r commented Jun 10, 2024

  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?

@t0bst4r t0bst4r changed the title Problem installing plugin Feature Request: add support for climate devices Jun 10, 2024
@t0bst4r t0bst4r added the enhancement New feature or request label Jun 10, 2024
@t0bst4r t0bst4r self-assigned this Jun 10, 2024
@marc3k18
Copy link
Author

marc3k18 commented Jun 10, 2024 via email

@t0bst4r
Copy link
Owner

t0bst4r commented Jun 10, 2024

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

@t0bst4r t0bst4r transferred this issue from t0bst4r/matterbridge-home-assistant-addon Jun 10, 2024
@t0bst4r
Copy link
Owner

t0bst4r commented Jun 12, 2024

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
Copy link
Author

No worry! Thanks!

@t0bst4r
Copy link
Owner

t0bst4r commented Jun 17, 2024

@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
Copy link
Author

marc3k18 commented Jun 18, 2024 via email

@t0bst4r
Copy link
Owner

t0bst4r commented Jun 18, 2024

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
Copy link
Author

marc3k18 commented Jun 20, 2024

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
Copy link
Owner

t0bst4r commented Jun 20, 2024

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 t0bst4r added the bug Something isn't working label Jun 20, 2024
@t0bst4r t0bst4r changed the title Feature Request: add support for climate devices work in progress: climate support Jun 20, 2024
@t0bst4r
Copy link
Owner

t0bst4r commented Jun 20, 2024

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 t0bst4r changed the title work in progress: climate support Feature Request: climate support Jul 17, 2024
@t0bst4r
Copy link
Owner

t0bst4r commented Jul 17, 2024

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
Copy link

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
Copy link

Would be happy to help in any way.

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

@t0bst4r
Copy link
Owner

t0bst4r commented Aug 14, 2024

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
  • What features do they have and which of some are conditional? (Looking at hvac_mode). I can probably look that up in the Home Assistant documentation.
  • temperature means the target temperature, right?
  • Since there are also device able to do cooling, I don’t think setting the target temperature to min-temperature will turn off all devices. I’d expect to have a turn off service in home assistant, isn’t there one?
  • How do those auto or smart modes work? Are they needed in the first step?
  • What does hvac_action mean?

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
Copy link

thanks for following up

@kaovilai
Copy link

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
Copy link

here is mine

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

@t0bst4r
Copy link
Owner

t0bst4r commented Aug 16, 2024

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
Copy link
Author

marc3k18 commented Aug 16, 2024 via email

@t0bst4r
Copy link
Owner

t0bst4r commented Aug 16, 2024

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

@tammeryousef1006
Copy link

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

@t0bst4r
Copy link
Owner

t0bst4r commented Aug 16, 2024

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

@t0bst4r t0bst4r reopened this Aug 16, 2024
@tammeryousef1006
Copy link

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

@tammeryousef1006
Copy link

Screenshot_20240816_224207_SmartThings
Screenshot_20240816_224158_SmartThings

@t0bst4r
Copy link
Owner

t0bst4r commented Aug 16, 2024

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
Copy link

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

@t0bst4r
Copy link
Owner

t0bst4r commented Aug 16, 2024

  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
Copy link

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
Copy link
Owner

t0bst4r commented Aug 17, 2024

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

@t0bst4r
Copy link
Owner

t0bst4r commented Aug 18, 2024

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
Copy link

pkoutsovasilis commented Aug 21, 2024

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
Copy link

mclever commented Oct 2, 2024

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants